There's probably multiple questions here all related. I'm trying to come up with a simple version number update scheme for our 3 mobile apps built from a single xamarin solution.
What I'm looking for is a simple way to keep all these values in sync with one another without having to go around and update them all individually.
- Windows Phone Version should get set to the AssemblyVersion or FileVersion Automatically
- IOS Version Number should be set to same. (not sure what the build number should be)
- Android Version Name should be set to same.
- Android Version Number should auto increment for each release build.
My current setup requires navigating around to 4 different places to manually sync up the version numbers.
- Global Assembly Info
I have a linked file which contains the AssemblyVersion and AssemblyFileVersion that's shared by all PCL and Platform projects in the solution with the following info.
[assembly: AssemblyVersion("2.1.1.*")]
[assembly: AssemblyFileVersion("2.1.1.0")]
- Android
Seperately under the android project, I have to manually update the version name and version number (int)
Version Name: 2.1.1
Version Number: 2
- IOS
Under the iOS Application tab, I've 2 more fields to fill in.
Version Number: 2.1.1
Build Number: 0 //Not sure if I'm using this field correctly.
- Windows Phone
On the "Packaging" tab of the WMAppManifest Property dialog, I have to supply a Version Number as well.
Version Number: 2.1.1.0
We've built a tool to synchronize versions between assemblies, Android, and iOS; I've just pushed it to our GitHub repo: https://github.com/soltechinc/soltechxf/. If you clone that repo and build UpdateVersionInfo, it should do what you're looking for.
The default version (i.e., the version you'll get if you supply none of the parameters) is 1.0.0.0.
The tool can use relative or absolute paths to the files, and my recommendation is to follow the approach it already sounds like you're using: have a single version.cs file that you include as a linked file (or in a shared project), and remove any AssemblyInfo attributes that are contained in that Version.cs file.
I should add; the tool currently assumes that you WILL be updating an iOS and an Android project along with the C# code. (I just added a post-it note to myself to make those optional.)
EDIT: Just noticed that past-Andy already noticed that and took care of it (which is a surprise; I usually yell epithets at past-Andy...). If you do not supply a path for the Android manifest or iOS Info.plist, it will skip them.