jamesmontemagno / vsts-mobile-tasks

VSTS Tasks for Mobile!
MIT License
79 stars 22 forks source link

On iOS pump version number I always get .plist file not found #11

Closed hannesganthaler85 closed 6 years ago

hannesganthaler85 commented 6 years ago

First it prints out the .plist file correctly and afterwards on the PlistBuddy command it can not find the .plist file anymore.

logs:

2018-02-15T09:14:58.5770190Z [command]/usr/libexec/PlistBuddy -c Print CFBundleVersion /Users/vsts/agent/2.127.0/work/4/s/Mobile Commerce RELEASE/Mobile_Commerce.iOS/Info.plist 2018-02-15T09:14:58.5798550Z File Doesn't Exist, Will Create: /Users/vsts/agent/2.127.0/work/4/s/Mobile 2018-02-15T09:14:58.5818890Z Invalid Arguments 2018-02-15T09:14:58.5826430Z 2018-02-15T09:14:58.6065670Z [command]/usr/libexec/PlistBuddy -c Set :CFBundleVersion 1 /Users/vsts/agent/2.127.0/work/4/s/Mobile Commerce RELEASE/Mobile_Commerce.iOS/Info.plist 2018-02-15T09:14:58.6090190Z File Doesn't Exist, Will Create: /Users/vsts/agent/2.127.0/work/4/s/Mobile 2018-02-15T09:14:58.6108770Z Invalid Arguments

jamesmontemagno commented 6 years ago

Does the info.plist file exist there?

Mobile Commerce RELEASE/Mobile_Commerce.iOS/Info.plist

Does that look correct? Did you pick it inside of VSTS?

hannesganthaler85 commented 6 years ago

Yes because it gets printed out before with your task and the print option. It is really strange that afterwards with the plist buddy command it can not find the file anymore...

jamesmontemagno commented 6 years ago

Perhaps it is because there are spaces in the folder path....

Try to remove the spaces in the path perhaps?

jamesmontemagno commented 6 years ago

Yes this is the issue, looking into a resolution here.

hannesganthaler85 commented 6 years ago

Thanks for the reply and nice that you found the problem.

James Montemagno notifications@github.com schrieb am Mo. 19. Feb. 2018 um 21:16:

Yes this is the issue, looking into a resolution here.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jamesmontemagno/vsts-mobile-tasks/issues/11#issuecomment-366793376, or mute the thread https://github.com/notifications/unsubscribe-auth/AhYx2z-FRO8UzuV3lAbl6Kd51KMr75mAks5tWda7gaJpZM4SGiJL .

hannesganthaler85 commented 6 years ago

once I wrote my own app version pump script. It is not written in a nice way but maybe it helps you.

echo "Argument 1: $1"
echo "Argument2: $2"
echo "Argument3: $3"

infoPlistPath=$BUILD_SOURCESDIRECTORY"/Mobile_Commerce.iOS/$3.plist"
echo "Infoplistpath: $infoPlistPath"
oldBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion " $infoPlistPath)
echo "oldBundleVersion: $oldBundleVersion"

oldBundleShortVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString " $infoPlistPath)
echo "oldBundleShortVersion: $oldBundleShortVersion"

PLISTBUDDY="/usr/libexec/PlistBuddy"

${PLISTBUDDY} -c "Set :CFBundleShortVersionString $1" "${infoPlistPath}";
${PLISTBUDDY} -c "Set :CFBundleVersion $2" "${infoPlistPath}";

newBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion " $infoPlistPath)
echo "newBundleVersion: $newBundleVersion"

newBundleShortVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString " $infoPlistPath)
echo "newBundleShortVersion: $newBundleShortVersion"
jamesmontemagno commented 6 years ago

Yeah, this happened in the conversion from bash to typescript to make it a cross-platform task for VSTS.

I have the fix in place and will be publishing an update to the task in the next 24 hours. I will close this once it is live.

hannesganthaler85 commented 6 years ago

Nice!

jamesmontemagno commented 6 years ago

Pushed out 0.6.1, you may have to remove and re-add the extension. Should be fixed now.