Recent

Author Topic: BGRA Version Number  (Read 1591 times)

winni

  • Sr. Member
  • ****
  • Posts: 415
BGRA Version Number
« on: April 22, 2019, 09:50:32 pm »
Hi!

Is the BGRA Version Number somewhere stored inside the units?

I didn't find  anything.

If not, this is a wish for future releases:

Put the Version Number somewhere into BGRA.

Thanx, Winni

dsiders

  • Full Member
  • ***
  • Posts: 221
Re: BGRA Version Number
« Reply #1 on: April 22, 2019, 10:00:30 pm »
Hi!

Is the BGRA Version Number somewhere stored inside the units?

I didn't find  anything.

If not, this is a wish for future releases:

Put the Version Number somewhere into BGRA.

Thanx, Winni

I don't see any version constants defined in source code. But version information is in the update_*.json files for the OPM downloads.
Lazarus 2.0.4 / FPC 3.0.4 / Windows 8.1 64-bit

RAW

  • Hero Member
  • *****
  • Posts: 794
Re: BGRA Version Number
« Reply #2 on: April 22, 2019, 10:24:11 pm »
https://github.com/bgrabitmap/bgrabitmap/releases

It's easier to see with open eyes ...  :P  :)
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 2.0.4 FPC 3.0.4 - TRUNK 2.1.0 FPC 3.3.1

lainz

  • Hero Member
  • *****
  • Posts: 3270
    • Lainz
Re: BGRA Version Number
« Reply #3 on: April 22, 2019, 10:25:34 pm »
Hi!

Is the BGRA Version Number somewhere stored inside the units?

I didn't find  anything.

If not, this is a wish for future releases:

Put the Version Number somewhere into BGRA.

Thanx, Winni

You need to read it from code? for some reason?

dsiders

  • Full Member
  • ***
  • Posts: 221
Re: BGRA Version Number
« Reply #4 on: April 22, 2019, 10:36:06 pm »
https://github.com/bgrabitmap/bgrabitmap/releases

It's easier to see with open eyes ...  :P  :)

Well that's certainly nice. But how is it relevant to version numbers in uniits?
Lazarus 2.0.4 / FPC 3.0.4 / Windows 8.1 64-bit

winni

  • Sr. Member
  • ****
  • Posts: 415
Re: BGRA Version Number
« Reply #5 on: April 22, 2019, 11:11:20 pm »
@dsiders: It's as relevant as the version number in Lazarurs/LCL is and as the version number in fpc is.

@ RAW: you didn't understand my question

Thanx
Winni

winni

  • Sr. Member
  • ****
  • Posts: 415
Re: BGRA Version Number
« Reply #6 on: April 22, 2019, 11:27:46 pm »
@lainz: to write some code like

Code: Pascal  [Select]
  1. const fpcVersion = {$I %FPCVERSION%};
  2. var s : string;
  3.  
  4. begin
  5. s := 'Made with' + lineEnding +
  6.        'fpc version '+ fpcVersion + LineEnding+
  7.        'Lazarus  version '+ LCLVersion + LineEnding +
  8.        'BGRA Version ' + ??BGRAVersion??;
  9. showMessage (s);
  10. end;    
  11.  
  12.  

Got me?

lainz

  • Hero Member
  • *****
  • Posts: 3270
    • Lainz
Re: BGRA Version Number
« Reply #7 on: April 22, 2019, 11:38:54 pm »
It's a good use.

Maybe you can report a bug so this don't get lost:
https://github.com/bgrabitmap/bgrabitmap/issues

Asking to add version number as a constant in the package.

dsiders

  • Full Member
  • ***
  • Posts: 221
Re: BGRA Version Number
« Reply #8 on: April 23, 2019, 12:27:49 am »
@dsiders: It's as relevant as the version number in Lazarurs/LCL is and as the version number in fpc is.

Glad you think so. Have at it.
Lazarus 2.0.4 / FPC 3.0.4 / Windows 8.1 64-bit

winni

  • Sr. Member
  • ****
  • Posts: 415
Re: BGRA Version Number
« Reply #9 on: April 23, 2019, 03:32:57 pm »
Hi!

Add a new issue to BGRA:

https://github.com/bgrabitmap/bgrabitmap/issues/57

Perhaps it doesn't get lost ....

Winni




circular

  • Hero Member
  • *****
  • Posts: 3022
    • Personal webpage
Re: BGRA Version Number
« Reply #10 on: April 24, 2019, 09:00:14 pm »
I wonder how to retrieve the package version inside a unit. Is it possible ?

Because I would prefer not to have more litteral copies of the version number.
Conscience is the debugger of the mind

winni

  • Sr. Member
  • ****
  • Posts: 415
Re: BGRA Version Number
« Reply #11 on: April 24, 2019, 10:22:19 pm »
As there are the package names with version number in the two listboxes in Package --> Configure installed packages (ger.: Installierte Pakete einrichten) one could reach it with following steps:

1) Inside a BGRA unit is a const like
BGRAversion = {$I BGRAversion.inc};
2) Get the package version from the IDE - no idea how to get.
3) If PackageVersion <> BGRAVersion then
     begin
      delete BGRAVersion.inc
       write PackageVersion to new BGRAversion.inc
    end else exit;

Anybody who knows details about the package names inside the IDE??

Winni

lainz

  • Hero Member
  • *****
  • Posts: 3270
    • Lainz
Re: BGRA Version Number
« Reply #12 on: April 25, 2019, 12:58:32 am »
What you can try to do is execute a program every new release is added.

That program reads the version number from the package and stores it into a BGRAVersion.pas for example.

As well it will be usefull to store the version number in the updates JSON for OPM.

Anyways you need to change the version number when releasing, is just another step that can be automatic with that program.

lucamar

  • Hero Member
  • *****
  • Posts: 2075
Re: BGRA Version Number
« Reply #13 on: April 25, 2019, 01:07:11 am »
What you can try to do is execute a program every new release is added.

That program reads the version number from the package and stores it into a BGRAVersion.pas for example.

Indeed, since the maintainer has to update the JSON with evry release, it wouldn't be too onerous to write a litle utility to which you pass the version number and which updates both the JSON file and a "bgraversion.inc".

It could then be run automatically before/after a "release" mode compilation, with v.g. a couple switches "--include" and "--json" to know which file to update, so before compilation it may run as "updateversion --include X.Y.Z" and after compilation as "updateversion --json X.Y.Z".

And "updateversion --json" would get the version from the "version.inc" and viceversa ...

And maybe ..

Well, just a thought. Design brainstorming ;)

ETA: Thining about, it could be fully automatic, getting the version from the LPI if you have "Version Info" on in the project options. Is that valid for packages?

Ah ... sorry ... I'm stopping now.
« Last Edit: April 25, 2019, 01:20:59 am by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

circular

  • Hero Member
  • *****
  • Posts: 3022
    • Personal webpage
Re: BGRA Version Number
« Reply #14 on: April 25, 2019, 09:59:53 am »
Indeed one could do an update program. One of the reason is the JSON file and there is another reason: there are several BGRABitmap packages which are supposed to have the same version number (regular, for fpGUI and for noGUI).

Though I was hoping some compiler directive like:
Code: Delphi  [Select]
  1. const MyPackageVersion={$PACKAGEVERSION};

@lucamar
About updating, I see you mention the JSON update to be separate from the rest. In some way I agree because the proper way is:
- first update packages with the new version (and merge with master branch)
- make a release on the repository with the new version to get the zip file
- update the JSON file with version number and zip file (and merge with master branch)
- package manager is aware of new version

As a matter of fact, I did the latest releases like this:
- update package and JSON file with new version (and merge with master branch)
- hope package manager does not read it in the next seconds
- make a release to get the zip file

I wonder if that could be a problem.
Conscience is the debugger of the mind