Bug 1118 - Choose info.plist file base off of Build Configuration
Summary: Choose info.plist file base off of Build Configuration
Status: RESOLVED DUPLICATE of bug 17180
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: Trunk
Hardware: Macintosh Mac OS
: Normal major
Target Milestone: ---
Assignee: Jeffrey Stedfast
URL:
: 1556 5545 9891 ()
Depends on:
Blocks:
 
Reported: 2011-09-28 18:16 UTC by Andrew Young
Modified: 2014-07-17 16:36 UTC (History)
10 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 17180

Description Andrew Young 2011-09-28 18:16:34 UTC
This is a feature request to be able to choose a info.plist file to use based off of a build configuration. For example, I use a completely different info.plist file when building for Dev, QA and Adhoc distribution.

Without this I have to resort to running custom before build scripts which isn't terrible but would be nice to actually have this as a feature in MonoTouch.

An added benefit to this would be that this would allow us to install Dev, QA and Adhoc builds on our devices side-by-side.
Comment 1 Mikayla Hutchinson [MSFT] 2011-09-28 18:50:02 UTC
I've been considering a couple of ways to do this, but unfortunately there have been many other priorities.

Originally I had assumed that we would migrate to MSBuild fairly soon, so this would automatically become possible by editing the MSBuild file and adding multiple files linked as Info.plist, with Condition attributes restricting them to different configurations.

However, I've since been leaning towards something like VS 2010 does this for web.config files (http://drdobbs.com/visualstudio/224201017). The configuration-based file naming and grouping under the main Info.plist would be the same, but I wouldn't go for the "transform" syntax that VS has - especially because plists aren't guaranteed to be XML. Instead I'd use a simple merge/overlay of root values during the build, which should be sufficient.
Comment 2 Alan McGovern 2011-10-19 15:58:31 UTC
*** Bug 1556 has been marked as a duplicate of this bug. ***
Comment 3 Alan McGovern 2012-04-30 07:14:03 UTC
This is pretty important for our users so bumping the priority up from enhancement. One typical usecase is a free and paid version of an app which need different bundle ids and whatnot.
Comment 4 Ruben Vermeersch 2012-04-30 08:07:57 UTC
Other use case: building multiple versions of the same app, for different clients. We have a sales app that has about a dozen different versions (for different clients), compiled from the same source base. App name is part of the usual customizations.
Comment 5 Jeffrey Stedfast 2013-01-30 11:27:38 UTC
*** Bug 5545 has been marked as a duplicate of this bug. ***
Comment 6 Jeffrey Stedfast 2013-01-30 11:28:14 UTC
*** Bug 9891 has been marked as a duplicate of this bug. ***
Comment 7 Jonas Sourlier 2013-01-31 08:02:30 UTC
As mentioned above, one possible way of achieving this is by using a "Before Build" Custom Command which copies the relevant file to
replace Info.plist, so that the right file is used for the build. For example,
our Lite build has the following pre-build command:

cp ${ProjectDir}/Info_lite.plist ${ProjectDir}/Info.plist

However, MonoDevelop seems to not re-load Info.plist from the harddisk. If
we're building the Pro version first, and then switch to the Lite
configuration, it immediately stops with the error

Project bundle ID 'ourcompany.ourapp.Pro' does not match specified provisioning
profile ...

But the bundle ID in info.plist is 'ourcompany.ourapp.Lite'. So, MonoDevelop
does not reload info.plist from the harddisk, because it "thinks" it hasn't
changed. No matter how many times we're invoking the build command, it always
complains about the bundle ID being wrong.

Our solution for this is to open info.plist in MonoDevelop, change something,
change it back, save the file, then build again.

(this bug was filed separately at 9891, but was marked duplicate of this feature request)
Comment 8 Fernando 2013-12-04 06:41:18 UTC
Hi, I am having a similar issue with bundle identifier. I have custom command that changes the bundle identifier in a "before build" step, but when it performs "Detecting signing identity..." it uses the previous one identifier it used, instead of the one the custom command set. Is there some workaround to fix this?

thanks.
Comment 9 Jeffrey Stedfast 2014-01-10 15:51:18 UTC

*** This bug has been marked as a duplicate of bug 17180 ***
Comment 10 David Lambert 2014-03-17 06:07:56 UTC
Hi,
I'm interested in the same thing. Being able to Conditionally Including Resources (http://docs.xamarin.com/guides/ios/platform_features/xamarin_studio_ios_features/) should do the trick.
Best regards,
David
Comment 11 Jeffrey Stedfast 2014-03-17 13:52:40 UTC
Yep, conditional includes will work once we complete MSBuild support (the current build system only supports a subset of MSBuild which is why Conditionally including stuff doesn't work).
Comment 12 Justyn 2014-07-17 13:49:10 UTC
I understand that this is a sought after feature and also understand that it is in the pipeline.

I know it's the 'how long is a piece of string question', but occasionally you get lucky and have an accurate answer from someone in the know-how. I was just wondering whether there was any kind of time frame for this feature release. Is MSBuild support nearing a point where this feature could slip in nicely or are we another 6 months+ away.

Also, for those who like voting, there is a suggestion on the Xamarin UserVoice that you can up vote here if you feel it helps towards this feature request:

https://xamarin.uservoice.com/forums/144858-xamarin-product-suggestions/suggestions/4352734-allow-setting-the-bundle-identifier-per-build-conf

Many thanks,
Justyn
Comment 13 Jeffrey Stedfast 2014-07-17 14:31:40 UTC
The MSBuild targets for iOS are nearing completion - they should ship as part of Xamarin.iOS for iOS 8
Comment 14 Justyn 2014-07-17 16:36:59 UTC
Thanks for that Jeffrey. Looking forward to the new features!