• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • xcode-plugin
    • None
    • OSX 10.8.1
      Jenkins 1.488
      Xcode Plugin 1.3.1

      I am using the Xcode plugin to build my iOS App. I want to configure the plugin to set the Technical version of the app to e.g. r${SVN_REVISION}.

      When I do this it doesn't work and I get the following in my console log. There is a myApp-Info.plist file in the myApp directory.

      I have had similar problems around $(SRCROOT) when I ask the plugin to create the ipa file - the command line that is executed contains $(SRCROOT) literally without the variable being evaluated.

      Started by user anonymous
      Building in workspace /Users/Shared/Jenkins/Home/workspace/iOS-myApp
      Updating svn://repository.invoqsystems.com/repository/apex/mobile/ios/trunk
      At revision 56840
      no change for svn://repository.invoqsystems.com/repository/apex/mobile/ios/trunk since the previous build
      [iOS-myApp] $ /bin/sh -xe /var/folders/_b/vh7gd76s30j_pjy0g5mdzwvm00007b/T/hudson38657611056669647.sh

      Working directory is /Users/Shared/Jenkins/Home/workspace/iOS-myApp.
      [iOS-myApp] $ /usr/bin/xcodebuild -version
      Xcode 4.5
      Build version 4G182
      Fetching marketing version number (CFBundleShortVersionString) from project.
      [iOS-myApp] $ /usr/bin/agvtool mvers -terse1
      Found marketing version (CFBundleShortVersionString): $(SRCROOT)/myApp/myApp-Info.plist
      1.0.
      Marketing version (CFBundleShortVersionString) found in project configuration: $(SRCROOT)/myApp/myApp-Info.plist
      1.0.
      Fetching technical version number (CFBundleVersion) from project.
      [iOS-myApp] $ /usr/bin/agvtool vers -terse
      No marketing version found (CFBundleVersion)
      Technical version (CFBundleVersion) found in project configuration: .
      Updating technical version (CFBundleVersion) to: r56831-b39
      [iOS-myApp] $ /usr/bin/agvtool new-version -all r56831-b39
      Setting version of project myApp to:
      r56831-b39.

      Also setting CFBundleVersion key (assuming it exists)

      Updating CFBundleVersion in Info.plist(s)...

      $(SRCROOT)/myApp/myApp-Info.plist
      Cannot find "$(SRCROOT)/myApp/myApp-Info.plist"
      Updated CFBundleVersion in "myApp.xcodeproj/../myAppUnitTests/myAppUnitTests-Info.plist" to r56831-b39

      Marketing version (CFBundleShortVersionString) used by Jenkins to produce the IPA: $(SRCROOT)/myApp/myApp-Info.plist
      1.0
      Technical version (CFBundleVersion) used by Jenkins to produce the IPA: r56831-b39

          [JENKINS-15708] Xcode Plugin not expanding $(SRCROOT) variable

          David Howell added a comment -

          Sorry - now see that this was an issue with my Xcode project and the plist.info settings

          David Howell added a comment - Sorry - now see that this was an issue with my Xcode project and the plist.info settings

          Hi,
          I am having the same issue, can you help me and tell me what was the problem here?

          Thanks very much!

          Mathias Caldas added a comment - Hi, I am having the same issue, can you help me and tell me what was the problem here? Thanks very much!

          David Howell added a comment -

          In my case I had to change the project setting for the location of the info.plist file from

          $(SRCROOT)/myProject/myApp-Info.plist

          to a relative path i.e.

          myProject/myApp-info.plist

          David Howell added a comment - In my case I had to change the project setting for the location of the info.plist file from $(SRCROOT)/myProject/myApp-Info.plist to a relative path i.e. myProject/myApp-info.plist

          Hi,

          Thanks for your answer.
          That is the way u solved the issue creating the ipa?

          Thanks!

          Mathias Caldas added a comment - Hi, Thanks for your answer. That is the way u solved the issue creating the ipa? Thanks!

          David Howell added a comment -

          I think so. Been a while but that's the only change I can see in the subversion logs.

          David Howell added a comment - I think so. Been a while but that's the only change I can see in the subversion logs.

          Nick Amundsen added a comment -

          I believe this is still an issue.

          The issue seems to be exactly as described in the title in that the Xcode Plugin is not expanding the SRCROOT variable as it should.

          While the comments above describe a workaround, providing the relative path to the info.plist is not always sufficient. It would be nice to be able to include a variable in the path of the info.plist and to have the plugin evaluate that variable to find the full path.

          Another note here is that if you are using variables in your paths, the more appropriate syntax is "${SRCROOT}" rather than "$(SRCROOT)".

          Nick Amundsen added a comment - I believe this is still an issue. The issue seems to be exactly as described in the title in that the Xcode Plugin is not expanding the SRCROOT variable as it should. While the comments above describe a workaround, providing the relative path to the info.plist is not always sufficient. It would be nice to be able to include a variable in the path of the info.plist and to have the plugin evaluate that variable to find the full path. Another note here is that if you are using variables in your paths, the more appropriate syntax is "${SRCROOT}" rather than "$(SRCROOT)".

          Frank Mueller added a comment -

          This issue seems not to be within the xcode plugin to jenkins. I have had some similar issue and started to analyze the code to see what there is happening.

          The xcode plugin executes the command

          /usr/bin/agvtool mvers -terse1
          

          in the project root and take the results as MarketingVersion.

          The Manpage tell the following:

                what-marketing-version | mvers [-terse | -terse1]
                     Prints the current marketing version of the project. For native targets, a marketing version is
                     listed for each Info.plist file found. For Jambase targets a marketing version is shown if a com-
                     mon value is found.
          
                     The marketing version is the CFBundleShortVersionString Info.plist key. This is often a totally
                     different version determined by product marketing folks.
          
                     The -terse option will limit the output to the version number only when displaying version num-
                     bers for Jambase targets.
          
                     The -terse1 option will limit the output to the first version number found, and only display the
                     version number.
          

          This issue will also happen if you are using more than one plist files. In our case the avgtool returns a whole list of plist files instead of the correct one which is used for your current target.

          In our case we could work-around this issue by setting the Marketing Version and the Technical Version within the plugin directly.

          Frank Mueller added a comment - This issue seems not to be within the xcode plugin to jenkins. I have had some similar issue and started to analyze the code to see what there is happening. The xcode plugin executes the command /usr/bin/agvtool mvers -terse1 in the project root and take the results as MarketingVersion. The Manpage tell the following: what-marketing-version | mvers [-terse | -terse1] Prints the current marketing version of the project. For native targets, a marketing version is listed for each Info.plist file found. For Jambase targets a marketing version is shown if a com- mon value is found. The marketing version is the CFBundleShortVersionString Info.plist key. This is often a totally different version determined by product marketing folks. The -terse option will limit the output to the version number only when displaying version num- bers for Jambase targets. The -terse1 option will limit the output to the first version number found, and only display the version number. This issue will also happen if you are using more than one plist files. In our case the avgtool returns a whole list of plist files instead of the correct one which is used for your current target. In our case we could work-around this issue by setting the Marketing Version and the Technical Version within the plugin directly.

            Unassigned Unassigned
            dhowell David Howell
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: