Created
April 28, 2012 02:45
-
-
Save dwdii/2515232 to your computer and use it in GitHub Desktop.
Mono Android Auto-Increment Manifest Version using PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param | |
( | |
[string] $ProjectPath = "C:\SourceCode\TestApps\AndroidTestIt\AndroidTestIt" | |
) | |
process | |
{ | |
# Load the bootstrap file | |
[xml] $xam = Get-Content -Path ($ProjectPath + "\Properties\AndroidManifest.xml") | |
# Get the version from Android Manifest | |
$version = Select-Xml -xml $xam -Xpath "/manifest/@android:versionName" -namespace @{android="http://schemas.android.com/apk/res/android"} | |
# Increment the version | |
[double] $iVer = $version.Node.Value | |
$version.Node.Value = ($iVer + 0.001) | |
# Save the file | |
$xam.Save($ProjectPath + "\Properties\AndroidManifest.xml") | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Round brackets for $(ProjectDir) - threw me for a while - but thanks for this useful post :-)