My suggestion to fix this: pull the try{}catch with the plist reading out of the if. This way, the default values will always be read from the plist.

Bar.java
try {
	output.reset();
	returnCode = launcher.launch().envs(envs).cmds("/usr/libexec/PlistBuddy", "-c",  "Print :CFBundleVersion", app.absolutize().child("Info.plist").getRemote()).stdout(output).pwd(projectRoot).join();
    if (returnCode == 0) {
		version = output.toString().trim();
	}
	                    
	output.reset();
	returnCode = launcher.launch().envs(envs).cmds("/usr/libexec/PlistBuddy", "-c", "Print :CFBundleShortVersionString", app.absolutize().child("Info.plist").getRemote()).stdout(output).pwd(projectRoot).join();
	if (returnCode == 0) {
		shortVersion = output.toString().trim();
	}
} 
catch(Exception ex) {
	listener.getLogger().println("Failed to get version from Info.plist: " + ex.toString());
	return false;
}

if (provideApplicationVersion) {
	if (! StringUtils.isEmpty(cfBundleVersionValue)) {
		version = cfBundleVersionValue;
	}
	else if (! StringUtils.isEmpty(cfBundleShortVersionStringValue)) {
		shortVersion = cfBundleShortVersionStringValue;
	}
	else {
		listener.getLogger().println("You have to provide a value for either the marketing or technical version. Found neither.");
		return false;
	}
}
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to