Details

    • Similar Issues:

      Description

      We're having an issue setting up auto-incrementing build version updates with our environment. According to the log file the plugin is doing two things incorrectly.

      The first issue is that the version is not getting put together correctly. Here are the settings we have specified:

      Assembly Version: ${BUILD_NUMBER}
      FileName: ./MyProject/Properties/AssemblyInfo.cs
      RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9])\.([0-9])"\)
      ReplacementPattern: Assembly$1Version("$2.$3.$4.%s")
      

      Based on that configuration we expected to see a version like "1.9.0.131" where 131 is the build number. However, the version is coming out as just "131". See the log message below for an example. This regex does test out with various tools as matching text such as [assembly: AssemblyVersion("1.9.0.1")] or [assembly: AssemblyFileVersion("1.9.0.1")].

      The second issue is the AssemblyInfo file is never getting updated although the log says it has updated the file. We have about 8 projects updating but the behavior is the same so I've cut the messages down to one. Here's the message from the log file that shows up for all of the files:

      
      Changing the file(s) ./MyProject/Properties/AssemblyInfo.cs to version : 131
      
      

        Attachments

          Activity

          Hide
          kettch19 Ryan Griggs added a comment -

          That solution worked for us, the versions are getting updated correctly now. Thanks for the help!

          Show
          kettch19 Ryan Griggs added a comment - That solution worked for us, the versions are getting updated correctly now. Thanks for the help!
          Hide
          kettch19 Ryan Griggs added a comment -

          Sorry I've been out of the office a few days. I'll check your suggestion tomorrow morning!

          Show
          kettch19 Ryan Griggs added a comment - Sorry I've been out of the office a few days. I'll check your suggestion tomorrow morning!
          Hide
          rachel Rachel M. added a comment -

          Please, change RegexPattern by:

          Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\)
          

          and change Filename by:

          FileName: MyProject/Properties/AssemblyInfo.cs
          

          without starting with

          ./
          Show
          rachel Rachel M. added a comment - Please, change RegexPattern by: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\) and change Filename by: FileName: MyProject/Properties/AssemblyInfo.cs without starting with ./
          Hide
          rachel Rachel M. added a comment -

          Third test

          Job configuration step
          Assembly Version: ${BUILD_NUMBER}
          FileName: ./AssemblyInfo.cs
          RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\)
          ReplacementPattern: Assembly$1Version("$2.$3.$4.%s")
          
          Console output:

          Changing the file(s) ./AssemblyInfo.cs to version : 2

          AssemblyInfo.cs (no changes)
          ...
          [assembly: AssemblyVersion("1.1.1205.1040")]
          [assembly: AssemblyFileVersion("1.1.1205.1040")]
          ...
          
          Show
          rachel Rachel M. added a comment - Third test Job configuration step Assembly Version: ${BUILD_NUMBER} FileName: ./AssemblyInfo.cs RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\) ReplacementPattern: Assembly$1Version("$2.$3.$4.%s") Console output: Changing the file(s) ./AssemblyInfo.cs to version : 2 AssemblyInfo.cs ( no changes ) ... [assembly: AssemblyVersion( "1.1.1205.1040" )] [assembly: AssemblyFileVersion( "1.1.1205.1040" )] ...
          Hide
          rachel Rachel M. added a comment -

          Environment

          • Jenkins: 2.25
          • change-assembly-version-plugin version 1.5.1
          • AssemblyInfo.cs
            ...
            [assembly: AssemblyVersion("1.1.1205.1040")]
            [assembly: AssemblyFileVersion("1.1.1205.1040")]
            ...
            

          First test

          Job configuration step
          Assembly Version: ${BUILD_NUMBER}
          FileName: AssemblyInfo.cs
          RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9])\.([0-9])"\)
          ReplacementPattern: Assembly$1Version("$2.$3.$4.%s")
          
          Console output:

          Changing the file(s) AssemblyInfo.cs to version : 1
          Updating file : /var/lib/jenkins/jobs/assembly-test-previous/workspace/AssemblyInfo.cs, Version : 1
          Updating file : /var/lib/jenkins/jobs/assembly-test-previous/workspace/AssemblyInfo.cs

          AssemblyInfo.cs (no changes)
          ...
          [assembly: AssemblyVersion("1.1.1205.1040")]
          [assembly: AssemblyFileVersion("1.1.1205.1040")]
          ...
          

          Second test

          Job configuration step
          Assembly Version: ${BUILD_NUMBER}
          FileName: AssemblyInfo.cs
          RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\)
          ReplacementPattern: Assembly$1Version("$2.$3.$4.%s")
          
          Console output:

          Changing the file(s) AssemblyInfo.cs to version : 1
          Updating file : /var/lib/jenkins/jobs/assembly-test-fixed/workspace/AssemblyInfo.cs, Version : 1
          Updating file : /var/lib/jenkins/jobs/assembly-test-fixed/workspace/AssemblyInfo.cs

          AssemblyInfo.cs (changed)
          ...
          [assembly: AssemblyVersion("1.1.1205.1")]
          [assembly: AssemblyFileVersion("1.1.1205.1")]
          ...
          
          Show
          rachel Rachel M. added a comment - Environment Jenkins: 2.25 change-assembly-version-plugin version 1.5.1 AssemblyInfo.cs ... [assembly: AssemblyVersion( "1.1.1205.1040" )] [assembly: AssemblyFileVersion( "1.1.1205.1040" )] ... First test Job configuration step Assembly Version: ${BUILD_NUMBER} FileName: AssemblyInfo.cs RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9])\.([0-9])"\) ReplacementPattern: Assembly$1Version("$2.$3.$4.%s") Console output: Changing the file(s) AssemblyInfo.cs to version : 1 Updating file : /var/lib/jenkins/jobs/assembly-test-previous/workspace/AssemblyInfo.cs, Version : 1 Updating file : /var/lib/jenkins/jobs/assembly-test-previous/workspace/AssemblyInfo.cs AssemblyInfo.cs ( no changes ) ... [assembly: AssemblyVersion( "1.1.1205.1040" )] [assembly: AssemblyFileVersion( "1.1.1205.1040" )] ... Second test Job configuration step Assembly Version: ${BUILD_NUMBER} FileName: AssemblyInfo.cs RegexPattern: Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\) ReplacementPattern: Assembly$1Version("$2.$3.$4.%s") Console output: Changing the file(s) AssemblyInfo.cs to version : 1 Updating file : /var/lib/jenkins/jobs/assembly-test-fixed/workspace/AssemblyInfo.cs, Version : 1 Updating file : /var/lib/jenkins/jobs/assembly-test-fixed/workspace/AssemblyInfo.cs AssemblyInfo.cs ( changed ) ... [assembly: AssemblyVersion( "1.1.1205.1" )] [assembly: AssemblyFileVersion( "1.1.1205.1" )] ...
          Hide
          kettch19 Ryan Griggs added a comment -

          Unfortunately that does not change the behavior. The result is the same with that regex also.

          Show
          kettch19 Ryan Griggs added a comment - Unfortunately that does not change the behavior. The result is the same with that regex also.
          Hide
          rachel Rachel M. added a comment -

          Please, change RegexPattern by:

          Assembly(\w*)Version\("([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)"\)
          
          Show
          rachel Rachel M. added a comment - Please, change RegexPattern by: Assembly(\w*)Version\( "([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)" \)

            People

            • Assignee:
              rachel Rachel M.
              Reporter:
              kettch19 Ryan Griggs
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: