-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbumpBuild.pl
More file actions
executable file
·36 lines (25 loc) · 1.08 KB
/
bumpBuild.pl
File metadata and controls
executable file
·36 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl -w
# === REVISION 2 (Jan 25, 2011)
# use module
use strict;
use XML::Simple;
# create object
my $xml = new XML::Simple;
# read XML file
my $manifest = $xml->XMLin("AndroidManifest.xml", ForceArray=>1);
print "\n *** EXISTINGversionCode: $manifest->{'android:versionCode'} \n *** EXISTINGversionName: $manifest->{'android:versionName'}\n";
# bump version and build number(need to append ".0" since it becomes an integer)
my $vCode = $manifest->{'android:versionCode'} + 1;
#my $vName = ($manifest->{'android:versionName'} + 1) . ".0";
# print out new codes
print " *** NEWversionCode: $vCode \n\n";# *** NEWversionName: $vName\n";
# edit xml object with new values
$manifest->{'android:versionCode'}=$vCode;
#$manifest->{'android:versionName'}=$vName;
# print out new xml, adding in header line and replacing root element
my $xmlheader = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
my $newManifest = $xml->XMLout($manifest, AttrIndent=>1, RootName=>'manifest');
open (OUTFILE, '>AndroidManifest.xml');
print OUTFILE $xmlheader;
print OUTFILE $newManifest;
close (OUTFILE);