#12 ✓resolved
Thell Fowler

Automate .rc file build version

Reported by Thell Fowler | October 17th, 2009 @ 07:10 PM | in v2.0.0

As has been discussed on IRC, we need to have a script that will generate a the FILEVERSION information for an rc file.

The goal would be to have a pre-build script execute that generates the file version based on the git repository's current commit.

git-describe could be used to generate this information, but since we cannot be sure that each builder will have git available in the command path when building the script will need to check availability and if it isn't available then use a fall-back version.

Here is an example of the output generated from git describe:


almostautomated@GWNOTEBOOK ~/datastore/repos/git/npp-community-setup (master)
$ git co -b version-describe
Switched to a new branch 'version-describe'

almostautomated@GWNOTEBOOK ~/datastore/repos/git/npp-community-setup (version-describe)
$ git describe
v1.0.0-rc1

almostautomated@GWNOTEBOOK ~/datastore/repos/git/npp-community-setup (version-describe)
$ touch test && git add test && git commit -m 'test' && git log --oneline -1
[version-describe ff7317a] test
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test
ff7317a test

almostautomated@GWNOTEBOOK ~/datastore/repos/git/npp-community-setup (version-describe)
$ git describe
v1.0.0-rc1-1-gff7317a

Comments and changes to this ticket

  • Thell Fowler

    Thell Fowler October 22nd, 2009 @ 05:14 AM

    • State changed from “new” to “open”

    The version generation script has been completed. The writing out of the RC information still remains along with modifying the project files for both Notepad++ and Scintilla.

    Currently the script has three sources of version information.

    1. A default value that will be updated as tags are created to be used when git-describe is not available and the source does not come from a source package download.
    2. A NPPCR-VERSION-FILE will be included in the $(SolutionDir) with source package downloads and used when git-describe is not available.
    3. Git-describe output processing.

    Here are some examples of the strings generated from some various directory states:

    • Using a NPPCR-VERSION-FILE with v1.0.0-alpha0.
    Version String:: 1.0.0.alpha0
    Digital Version ID: 1,0,0,0
    Special Build String: Alpha Release 0
    
    • Git describe at the tagged v1.0.0 commit with staged but uncommited changes.
    Version String:: 1.0.0.dirty
    Digital Version ID: 1,0,3,00
    Special Build String:
    Private Build Flagged: true
    
    • Git describe on HEAD of PU after v1.0.0-rc1 with a clean staging area.
    Version String:: 1.0.0.rc1.46.g8b07f
    Digital Version ID: 1,0,2,79
    Special Build String: Release Candidate 1
    
  • Thell Fowler

    Thell Fowler October 23rd, 2009 @ 05:19 PM

    • Tag changed from build, project_files, solution, version to build, project_files, solution, version, versioning
    • Assigned user changed from “Thell Fowler” to “npp-community”

    (from [1259be6372e16a60698e1c49d78247a38502ef0a]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include fileversioninfo.h which is built from the NPPCR-VERSION-GEN.bat script. The fileversioninfo.h is included in the project file but added to .gitignore and not tracked.

    • The NPPCR-VERSION-GEN.bat uses three possible sources:

      • NPPCR-VERSION-FILE (which should be included with packaged releases)
      • Default value within the script itself (updated when new tags are created)
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Stage.Revision

    Stage values: 0=alpha, 1=beta, 2=release candidate, 3=release

    The revision value is the number of commits since the '0' tag of the current stage. So, if a topic branch is 3 commits ahead of vX.Y.Z-rc1 which is 30 commits ahead of xX.Y.Z-rc0 then the Revision value would be 33.

    Builds created by while working with a dirty directory tree will have the version string amended with '-dirty'.

    VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_DEBUG, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    [#12 stage:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/1259be6372e1...

  • Thell Fowler

    Thell Fowler October 23rd, 2009 @ 05:23 PM

    • State changed from “open” to “needs_ack”

    (from [3d87bf2114da1226939c72f0fa5d9c86b5d5a45e]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include fileversioninfo.h which is built from the NPPCR-VERSION-GEN.bat script. The fileversioninfo.h is included in the project file but added to .gitignore and not tracked.

    • The NPPCR-VERSION-GEN.bat uses three possible sources:

      • NPPCR-VERSION-FILE (which should be included with packaged releases)
      • Default value within the script itself (updated when new tags are created)
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Stage.Revision

    Stage values: 0=alpha, 1=beta, 2=release candidate, 3=release

    The revision value is the number of commits since the '0' tag of the current stage. So, if a topic branch is 3 commits ahead of vX.Y.Z-rc1 which is 30 commits ahead of xX.Y.Z-rc0 then the Revision value would be 33.

    Builds created by while working with a dirty directory tree will have the version string amended with '-dirty'.

    VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_DEBUG, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/3d87bf2114da...

  • Jocelyn Legault

    Jocelyn Legault October 28th, 2009 @ 02:27 AM

    Lines 8 - 29

    • Is there a convention for variable names? If so, it's not clear to me. What does _ in front of the name means to you? Why some names all in uppercase, others with lowercase prefixes, and others still all in lowercase?

    Lines 24 and 165

    • I'd strongly recommand the use of pushd / popd over your makeshift method.

    Line 25

    • I'd suggest the if _%1==_ synthax to verify if parameter one is null, as in:
        IF _%~1==_ (
          cd ".\..\"
        ) ELSE (
          cd "%~1"
        )
    
    • Also you might want to use cd /D "%~dp1" for the ELSE clause.

    • Lastly, while you verify for the existence or not of %1, you don't verify for the existence of the folder it may represent.

    Lines 36 - 38

    • I'd break the IF and the FOR on separate lines for added clarity:
        IF EXIST %_VERSIONFILE% (
          FOR /F "tokens=3" %%A IN (%_VERSIONFILE%) DO (
            SET _strFILEVERSION=%%A
          )
        )
    
    • The goal of that loop isn't clear at first sight. You take the 3rd parameter of each lines and assign it to _strFILEVERSION? So in essence, you just want the 3rd parameter of the last line? Is that it? In any case, a little comment would be welcome.

    Line 42

    • Is "1" the only possible error code? If you're not 100% on that, I'd use IF %ERRORLEVEL% NEQ 0 instead.

    Lines 44 - 46

    • Like with lines 36-38 above, the goal of this loop isn't clear to me. You want the first token of the last line here?

    Line 51

    • I guess you know what I'm going to say about this by now! :-p

    Line 68

    • What in the first 5 letters of that file version that you skip?

    Lines 69 - 77

    • Again, comments on what you're doing, please.

    Line 87

    • You have to read this script carefully to know that DEFAULT is in fact "Git isn't available". Either change the name of the tag or add a comment on how you get here.

    • Will _DEFAULT_FILEVERSION be updated regularly? If so, I would suggest putting the setting of it in an outside file (NPP-VERSION-GEN-VARS.bat) and load this at the top of this script (with a CALL statement) to avoid getting frequent modifications on the script itself (which should not change much once we'll start using it).

    Lines 91

    • Again, comments please. What in characters 1-5?

    Line 102

    • _STAGE=3 ? What does that mean? Previously (lines 61-66), stage was set to "-alpha", "-beta" or "-rc"

    Lines 111, 121 and 131

    • These lines can be factored out in WRITEVN

    For the rest of the document

    • Comment the string truncations / manipulations and "trick" FOR, please.

    General comment

    • This is re-generated every time you recompile anything. Can't you cache something so it would generate it only once per branch?
  • Jocelyn Legault

    Jocelyn Legault October 28th, 2009 @ 04:38 AM

    • State changed from “needs_ack” to “acked”
  • Thell Fowler

    Thell Fowler October 28th, 2009 @ 09:25 PM

    • State changed from “acked” to “needs_ack”

    (from [7ed7e5ad04e21de4c0365eb16fe73bb7b480dca7]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include fileversioninfo.h which is built from the NPPCR-VERSION-GEN.bat script. The fileversioninfo.h is included in the project file but added to .gitignore and not tracked.

    • The NPPCR-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself (updated when new tags are created)
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Stage.Revision with stage values of:

    0=alpha, 1=beta, 2=release candidate, 3=release
    

    The revision value is the number of commits since the '0' tag of the current stage. So, if a topic branch is 3 commits ahead of vX.Y.Z-rc1 which is 30 commits ahead of xX.Y.Z-rc0 then the Revision value would be 33.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_DEBUG, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/7ed7e5ad04e2...

  • Thell Fowler

    Thell Fowler October 28th, 2009 @ 10:06 PM

    Joce,

    Thanks for the review, not sure why you acked it given all of the things the review showed as needing fixing, so if you could re-review it again I'd appreciate it.

    Regarding the previous review comments...

    Lines 8 - 29

    • Is there a convention for variable names? If so, it's not clear to me. What does _ in front of the name means to you? Why some names all in uppercase, others with lowercase prefixes, and others still all in lowercase?

    Fixed and clarified.

    Lines 24 and 165

    • I'd strongly recommand the use of pushd / popd over your makeshift method.

    Fixed

    Line 25

    • I'd suggest the if %1== syntax to verify if parameter one is null, as in:
        IF _%~1==_ (
          cd ".\..\"
        ) ELSE (
          cd "%~1"
        )
    
    • Also you might want to use cd /D "%~dp1" for the ELSE clause.
    • Lastly, while you verify for the existence or not of %1, you don't verify for the existence of the folder it may represent.

    I restructured the path handling and also setup the script to take both the Solution path and header out file as arguments.

    Lines 36 - 38

    • I'd break the IF and the FOR on separate lines for added clarity:
        IF EXIST %_VERSIONFILE% (
          FOR /F "tokens=3" %%A IN (%_VERSIONFILE%) DO (
            SET _strFILEVERSION=%%A
          )
        )
    
    • The goal of that loop isn't clear at first sight. You take the 3rd parameter of each lines and assign it to _strFILEVERSION? So in essence, you just want the 3rd parameter of the last line? Is that it? In any case, a little comment would be welcome.

    Added commenting regarding the VERSION_FILE's single line format.

    Line 42

    • Is "1" the only possible error code? If you're not 100% on that, I'd use IF %ERRORLEVEL% NEQ 0 instead.

    ERRORLEVEL is a >= convention. I went through and rewrote the ERRORLEVEL statements, so it should be clearer now.

    Lines 44 - 46

    • Like with lines 36-38 above, the goal of this loop isn't clear to me. You want the first token of the last line here?

    Line 51

    • I guess you know what I'm going to say about this by now! :-p

    Please see FOR command and git-describe

    Hopefully the clarified commenting helps?

    Line 68

    • What in the first 5 letters of that file version that you skip?

    Added commenting.

    Lines 69 - 77

    • Again, comments on what you're doing, please.

    Added more commenting.

    Please see FOR command and git-describe

    Line 87

    • You have to read this script carefully to know that DEFAULT is in fact "Git isn't available". Either change the name of the tag or add a comment on how you get here.

    I'm not sure just how carefully the commit message, the comment above the git section, and the variable name itself have to be read to make it any clearer...

    • Will _DEFAULT_FILEVERSION be updated regularly? If so, I would suggest putting the setting of it in an outside file (NPP-VERSION-GEN-VARS.bat) and load this at the top of this script (with a CALL statement) to avoid getting frequent modifications on the script itself (which should not change much once we'll start using it).

    I imagine the default file version will be updated with each '.0' once we hit v1.0.0 OR. The reason it is not in an external file is that a git clone of the repo does not need this value and a packed source release does not need this value. It is provided for when git is not available and the source was not obtained via a source package. Do we need another tracked file for that? IMO, no.

    Lines 91

    • Again, comments please. What in characters 1-5?

    Well, tag v1.0.0 would have v1.0. so the rest of the value could be appended.

    Line 102

    • _STAGE=3 ? What does that mean? Previously (lines 61-66), stage was set to "-alpha", "-beta" or "-rc"

    I guess I really assumed that the commit message would have been read, this has been clarified by specifying the initial value of the stage as '3' with a comment.

    Lines 111, 121 and 131

    • These lines can be factored out in WRITEVN

    Good idea to factor it out, although putting it in WRITEVN would not have worked since a release doesn't follow the same building method. A :SETPREVAL label was created to factor out that line as well as a few other pre release specific lines.

    For the rest of the document

    • Comment the string truncations / manipulations and "trick" FOR, please.

    Comments added. Not sure what 'and "trick" FOR' means.

    General comment

    • This is re-generated every time you recompile anything. Can't you cache something so it would generate it only once per branch?

    Added an untracked tmp out file containing the git describe version to allow for early exit when git is available.


    Also added are CLI usage info and a --force option to ignore the tmp outfile. I think that will be needed for automated build testing when it gets setup.

    With so many changes I look forward to the next review.

    Thell

  • Thell Fowler

    Thell Fowler November 3rd, 2009 @ 04:10 PM

    The next post is a v3 commit of the rc version generator. The main changes between this and v2 are:

    • The script has been made more generic so that it will be more useful to other projects.
    • The script also now takes three arguments instead of being hard-coded for the cache file and output header file.
    • The argument checking is a little more robust.
    • The vc project files now do not include the generated file version header in the solution explorer.
    • The vc project pre-build event now uses the project's $(IntDir) for the cache file.

    One thing I did note during my testing that I was unable to recreate was the existence of an RCa06632 file. Not sure where it came from (it was while testing the vc9 project) but it isn't on the ignore list and I don't recall seeing it before and couldn't recreate the situation that created it in the first place...

    Anyhow here it is...

  • Thell Fowler

    Thell Fowler November 3rd, 2009 @ 04:10 PM

    (from [cc548335affbce34b0420399c23548e7ddf75788]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Stage.Revision with stage values of:

    0=alpha, 1=beta, 2=release candidate, 3=release
    

    The revision value is the number of commits since the '0' tag of the current stage. So, if a topic branch is 3 commits ahead of vX.Y.Z-rc1 which is 30 commits ahead of xX.Y.Z-rc0 then the Revision value would be 33.

    If a tag's 'Z' value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified. For instance if v1.0.0 is tagged and someone commits a single commit on top of that and builds the digital values would be 1,0,3,1 and if a maint release of v1.0.1 is build it will also have a digital version of 1,0,3,1.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/cc548335affb...

  • Jocelyn Legault

    Jocelyn Legault November 3rd, 2009 @ 08:04 PM

    Line 111

    "goto :eof" can act like the end of a subroutine and "return" to the caller of a label (see http://www.robvanderwoude.com/goto.php). So if we arrived here with a call to GOTO SETUP (line 26), it's my understanding that we're going to pop back there once we reach line 111.

    IMO, you should add an ":end" label at the very end, and GOTO END instead of GOTO :EOF

    Lines 136, 154 and 169

    This parsing expect the version to have single digits version and sub version numbers. It would fail if we have any parts that are >= 10.

    Lines 187, 193, 199 and 213

    I believe these suffer from the same version parsing problem

    Lines 222, 224 and 226

    It don't see the use for an explicit terminal '\0'. The only thing I can foresee from that is a Lint warning.

    Line 230

    The end tag is never invoked and could potentially be removed.

    Line 239

    See line 111

  • Thell Fowler

    Thell Fowler November 3rd, 2009 @ 08:43 PM

    • State changed from “needs_ack” to “open”
    • Assigned user changed from “npp-community” to “Thell Fowler”

    Line 111

    "goto :eof" can act like the end of a subroutine and "return" to the caller of a label (see http://www.robvanderwoude.com/goto.php). So if we arrived here with a call to GOTO SETUP (line 26), it's my understanding that we're going to pop back there once we reach line 111. IMO, you should add an ":end" label at the very end, and GOTO END instead of GOTO :EOF

    I believe Rob is referring to using separately called scripts as subroutines. GOTO :EOF goes to the end of the file, as per cmd.exe's >help goto output states.

    Lines 136, 154, 169, 187, 193, 199, 213 and 239

    This parsing expect the version to have single digits version and sub version numbers. It would fail if we have any parts that are >= 10.

    Good catch. I'll get that fixed.

    Lines 222, 224 and 226

    It don't see the use for an explicit terminal '\0'. The only thing I can foresee from that is a Lint warning.

    The strings are terminated strings as required per MSDN article specifying the string structure

    Line 230

    The end tag is never invoked and could potentially be removed.

    Ahhh, yes. I was working on having console only output if no arguments are passed. So line 220 would be a check for that instead of an implicit delete (which should also be removed).

    I'll get started on v4. :)

  • Jocelyn Legault

    Jocelyn Legault November 3rd, 2009 @ 09:43 PM

    • State changed from “open” to “needs_ack”
    • Assigned user changed from “Thell Fowler” to “npp-community”

    Re: line 111, You're right. You need to call a label (call :SubStep) in order for goto :eof to pop you back where you were called from. It your case, you goto label, so there's no side effect.

  • Thell Fowler

    Thell Fowler November 6th, 2009 @ 10:11 PM

    (from [8169025fe449e6753b61d352e085b3a3815b92a8]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Fix.Build

    The build value is the number of commits since the '0' tag of the current release fix release stream.

    If a tag's build value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    The script can be run with --test from cmd.exe when msysgit is available to illustrate how the current settings will build the header.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/8169025fe449...

  • Thell Fowler

    Thell Fowler November 6th, 2009 @ 11:55 PM

    (from [ec62eacb32ea05966a9b8aa7616a4177cae2697a]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Fix.Build

    The build value is the number of commits since the '0' tag of the current release fix release stream.

    If a tag's build value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    The script can be run with --test from cmd.exe when msysgit is available to illustrate how the current settings will build the header.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/ec62eacb32ea...

  • Thell Fowler

    Thell Fowler November 9th, 2009 @ 02:13 PM

    Version 5 of the generator also includes the output of a hex value that can be used for version checking within the source.

  • Thell Fowler

    Thell Fowler November 9th, 2009 @ 02:13 PM

    (from [9ec9d818cae53ef33e77a4bd67fa2100372934fe]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Fix.Build in string format as well as csv and hex.

    The build value is the number of commits since the '0' tag of the current release fix release stream.

    If a tag's build value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    The script can be run with --test from cmd.exe when msysgit is available to illustrate how the current settings will build the header.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/9ec9d818cae5...

  • Thell Fowler

    Thell Fowler November 9th, 2009 @ 07:58 PM

    (from [9c096b04d6a1a83d05235b51279436e2fc4cda3e]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Fix.Build in string format as well as csv and hex.

    The build value is the number of commits since the '0' tag of the current release fix release stream.

    If a tag's build value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    The script can be run with --test from cmd.exe when msysgit is available to illustrate how the current settings will build the header.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/9c096b04d6a1...

  • Jocelyn Legault

    Jocelyn Legault November 10th, 2009 @ 08:23 PM

    • State changed from “needs_ack” to “acked”

    Version 5 reviewed and approved.
    Some suggestions for very minor point were made over IRC, but no outstanding
    problems were found.
    Quality of the code is excellent.

    [#12 state:acked]

  • Thell Fowler

    Thell Fowler November 10th, 2009 @ 08:32 PM

    Thank you! I'll get the final rendition on pu.

  • Thell Fowler

    Thell Fowler November 11th, 2009 @ 06:52 PM

    • State changed from “acked” to “needs_ack”

    (from [d07697bba11509e11fb8038a12f8d152169ce605]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Fix.Build in string format as well as csv and hex.

    The build value is the number of commits since the '0' tag of the current release fix release stream.

    If a tag's build value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    The script can be run with --test from cmd.exe when msysgit is available to illustrate how the current settings will build the header.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/d07697bba11509...

  • Thell Fowler

    Thell Fowler November 11th, 2009 @ 06:55 PM

    (from [588713dabc4d341a2d8314a36287dcacc50074dd]) Merge branch 'tf/LH-12v6/build-version-generator' into pu

    • tf/LH-12v6/build-version-generator: project files: introduce version info generator

    [#12 state:pu]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/588713dabc4d34...

  • Thell Fowler

    Thell Fowler November 11th, 2009 @ 06:57 PM

    • State changed from “needs_ack” to “proposed”

    (from [8c3789ee9fb9ac11f7fc973f82f8e881173b674c]) Merge branch 'tf/LH-12v6/build-version-generator' into pu

    • tf/LH-12v6/build-version-generator: project files: introduce version info generator

    [#12 state:proposed]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/8c3789ee9fb9ac...

  • Thell Fowler

    Thell Fowler November 13th, 2009 @ 09:18 PM

    (from [849e760aeeb84c190d500705cc807d7c9660a8e5]) Merge branch 'tf/LH-12v6/build-version-generator' into pu

    • tf/LH-12v6/build-version-generator: project files: introduce version info generator

    [#12 state:proposed]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/849e760aeeb84c...

  • Jocelyn Legault

    Jocelyn Legault November 17th, 2009 @ 09:44 PM

    I've recently sync'ed to community/pu, and I get the following error from the batch script when I compile:

    1>------ Build started: Project: notepadPlus, Configuration: Debug Win32 ------
    1>Runtime build and version generation.
    1>Build version is assumed unchanged from: 1.0.0.rc1.42.g36c53.
    1>Project : error PRJ0019: A tool returned an error code from "Runtime build and version generation."
    1>Build Time 0:00
    1>Build log was saved at "file://c:\Code\npp-community\PowerEditor\visual.net\Debug\BuildLog.htm"
    1>notepadPlus - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
    

    Repro steps

    • From the command line:
      • $ git fetch community
      • git co -b test_pu community/pu
    • From MS Visual Studio (2008)
      • Open notepadPlus.9.sln
      • Menu Build | Rebuild solution
        • Notice that everything works fine.
      • Modify any file of the notepadPlus project in a way that will not break compilation (e.g. add a whitespace or something)
      • Meun Build | Build solution
        • Notice the reported error.
  • Thell Fowler

    Thell Fowler November 17th, 2009 @ 11:25 PM

    • State changed from “proposed” to “needs_ack”

    (from [c6101a8ecdbe6ce7609ebd13fb6e9ece954e23a8]) project files: introduce version info generator

    • Modifies all VC 8 & 9 build configurations in the notepadplus project files to use a pre-build event to generate entries for resource VERSIONINFO and include gen-versioninfo.h which is built from the GIT-VS-VERSION-GEN.bat script. The gen-versioninfo.h is included in the project file and added to .gitignore.

    • The GIT-VS-VERSION-GEN.bat uses three possible sources:

      • A packaged release VERSION file.
      • Default value within the script itself
      • git-describe

    The version information generated creates a file version string with the format: Major.Minor.Fix.Build in string format as well as csv and hex.

    The build value is the number of commits since the '0' tag of the current release fix release stream.

    If a tag's build value matches the number of commits from the '0' tag of the current stage and HEAD is clean then VS_FF_PATCHED will be flagged but VS_FF_PRIVATE will not be. This allows a maint patch to be different than a commit that is a similar number of commits away from the patched build to be identified.

    Builds created while working with a dirty directory tree will have the version string amended with '-dirty'.

    The script can be run with --test from cmd.exe when msysgit is available to illustrate how the current settings will build the header.

    • VS_FF_PRIVATE, VS_FF_PATCHED, VS_FF_PRERELEASE are set accordingly when git is available, as well as Comment and Private Build strings.

    • When git is available multiple builds of the same commit exit early based on the value stored in an untracked tmp file. This feature can be skipped using the --force argument.

    [#12 state:needs_ack responsible:npp-community tagged:versioning]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/c6101a8ecdbe6c...

  • Thell Fowler

    Thell Fowler November 17th, 2009 @ 11:26 PM

    (from [dce183dc13bc9ac51659dfcb70b7e1905dbb689f]) Merge branch 'tf/LH-12v7/build-version-generator' into pu

    • tf/LH-12v7/build-version-generator: project files: introduce version info generator

    [#12 state: proposed]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/dce183dc13bc9a...

  • Thell Fowler

    Thell Fowler November 21st, 2009 @ 06:00 PM

    grrr, why would this have changed from proposed back to needs_ack? the last post states proposed

  • Thell Fowler

    Thell Fowler November 21st, 2009 @ 06:01 PM

    • State changed from “needs_ack” to “proposed”
  • Thell Fowler

    Thell Fowler November 29th, 2009 @ 06:34 AM

    • State changed from “proposed” to “resolved”

    (from [953cf21b6591b182b37610f345a501600008c0b9]) Merge branch 'tf/LH-12v7/build-version-generator'

    • tf/LH-12v7/build-version-generator: project files: introduce version info generator

    [#12 state:resolved]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/953cf21b6591b1...

  • npp-community

    npp-community December 7th, 2009 @ 09:11 PM

    (from [df290f8e9bcbe35cf1bf4c9e9e249729ee7fd7cd]) Version Generator: fix strange crash.

    • The version generator would crash on me at every two full rebuilds. While investigating, I realized that as soon as I was echoing something, the script would work as intended, making it nearly impossible to debug. It also had the side effect of fixing the problem! So by adding the smallest possible echo (ECHO.), the bug is fixed.

    [#12]

    Signed-off-by: Jocelyn Legault jocelynlegault@gmail.com
    http://github.com/npp-community/npp-community/commit/df290f8e9bcbe3...

  • Thell Fowler

    Thell Fowler December 10th, 2009 @ 08:58 PM

    • State changed from “resolved” to “needs_ack”

    Need a quick ack on this fairly trivial bug fix for path handling in the version generator scripting and calling::

    http://github.com/almostautomated/npp-community/commit/b1a3ea63ccf5...

    I think it is trivial enough to go directly to master when applied.


    version generator: handle spaces in paths

    • add quotes around the file variables in the generator script for commands that interact with the file system.
    • add quotes around the pre-build even batch file call

    [#12]

    Signed-off-by: Thell Fowler git@tbfowler.name

  • Jocelyn Legault

    Jocelyn Legault December 10th, 2009 @ 10:22 PM

    • State changed from “needs_ack” to “acked”
  • Thell Fowler

    Thell Fowler December 12th, 2009 @ 04:16 PM

    • State changed from “acked” to “proposed”
    • Milestone changed from v1.0.0-rc2 to v2.0.0

    This will sit on pu until the Npp svn integration is completed.

  • Thell Fowler

    Thell Fowler December 12th, 2009 @ 04:24 PM

    (from [b1a3ea63ccf52f87caf621b59ffca34856ff0912]) version generator: handle spaces in paths

    • add quotes around the file variables in the generator script for commands that interact with the file system.
    • add quotes around the pre-build even batch file call

    [#12]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/b1a3ea63ccf52f...

  • Thell Fowler

    Thell Fowler December 22nd, 2009 @ 03:53 PM

    (from [a74f2e1b3454cc1e0509f9c91a6da376ee12a76f]) version generator: handle spaces in paths

    • add quotes around the file variables in the generator script for commands that interact with the file system.
    • add quotes around the pre-build event batch file call

    [#12]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/a74f2e1b3454...

  • Thell Fowler

    Thell Fowler December 22nd, 2009 @ 03:53 PM

    (from [8040f81fa561c3f037820ae361a192d676318d39]) Merge branch 'tf/LH-12v9/version-generator-spaced-path-fix' into pu

    • tf/LH-12v9/version-generator-spaced-path-fix: version generator: handle spaces in paths

    [#12]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/almostautomated/npp-community/commit/8040f81fa561...

  • Thell Fowler

    Thell Fowler January 19th, 2010 @ 12:02 AM

    (from [ccbffe012a32bec526a896182e074ada19e7ef73]) Merge branch 'tf/LH-12v9/version-generator-spaced-path-fix'

    • tf/LH-12v9/version-generator-spaced-path-fix: version generator: handle spaces in paths

    [#12]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/npp-community/npp-community/commit/ccbffe012a32be...

  • Thell Fowler

    Thell Fowler January 19th, 2010 @ 12:09 AM

    • State changed from “proposed” to “resolved”
  • Thell Fowler

    Thell Fowler February 3rd, 2010 @ 07:16 AM

    (from [fd4f51ff419233f99056414486585ef8ac73f952]) version generator: handle spaces in paths

    • add quotes around the file variables in the generator script for commands that interact with the file system.
    • add quotes around the pre-build event batch file call

    [#12]

    Signed-off-by: Thell Fowler git@tbfowler.name
    http://github.com/snemarch/npp-community/commit/fd4f51ff419233f9905...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Notepad++ Community Release

Shared Ticket Bins

Referenced by

Pages