Skip to content

Commit e182324

Browse files
author
paul.lebeau
committed
Updated maven release script to upload aar file to repo.
1 parent bf4e346 commit e182324

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

maven/maven-release.py

+23-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
VERSION_FILE = '../src/com/caverock/androidsvg/SVG.java'
99

1010
# Version regex
11-
VERSION_RE = '\sVERSION\s*=\s*"([\d.]+)"'
11+
VERSION_RE = '\sVERSION\s*=\s*"([\d\w.-]+)"'
1212

1313
# Source pom file
1414
ORIG_POM_FILE = 'src-pom.xml'
@@ -17,7 +17,10 @@
1717
POM_VERSION_RE = '{{VERSION}}'
1818

1919
# The jar file to be deployed
20-
JAR_FILE = '../bin/androidsvg.jar'
20+
JAR_FILE = '../bin/androidsvg_1.2.jar'
21+
22+
# The aar file to be deployed
23+
AAR_FILE = '../bin/androidsvg_1.2.aar'
2124

2225
# The dummy sources and javadoc jars
2326
SOURCES_JAR_FILE = 'androidsvg-sources.jar'
@@ -46,12 +49,13 @@ def main():
4649

4750
# Write out a new pom file with the version number set to the latest version
4851
srcPomFile = read(ORIG_POM_FILE)
49-
tempPomFile.write(re.sub(POM_VERSION_RE, libraryVersion, srcPomFile))
52+
srcPomFile = re.sub(POM_VERSION_RE, libraryVersion, srcPomFile);
53+
tempPomFile.write(srcPomFile)
5054
tempPomFile.close()
5155

5256

53-
# Sign and deploy the artifact
54-
print '\nSigning and deploying artifact...'
57+
# Sign and deploy the JAR artifact
58+
print '\nSigning and deploying JAR artifact...'
5559
basecmd = 'mvn gpg:sign-and-deploy-file'
5660
basecmd += ' -DpomFile=' + tempPomFile.name
5761
basecmd += ' -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/'
@@ -65,8 +69,20 @@ def main():
6569
os.system(cmd)
6670

6771

72+
# Sign and deploy the AAR artifact
73+
print '\n\n\nSigning and deploying AAR artifact...'
74+
75+
cmd = basecmd
76+
cmd += ' -Dfile=' + os.path.realpath(AAR_FILE)
77+
cmd += ' -Dtype=aar'
78+
cmd += ' -Dpackaging=aar'
79+
80+
print cmd
81+
os.system(cmd)
82+
83+
6884
# Sign and deploy the dummy sources
69-
print '\nSigning and deploying sources jar...'
85+
print '\n\n\nSigning and deploying sources jar...'
7086

7187
cmd = basecmd
7288
cmd += ' -Dfile=' + os.path.realpath(SOURCES_JAR_FILE)
@@ -77,7 +93,7 @@ def main():
7793

7894

7995
# Sign and deploy the dummy javadoc
80-
print '\nSigning and deploying javadoc jar...'
96+
print '\n\n\nSigning and deploying javadoc jar...'
8197

8298
cmd = basecmd
8399
cmd += ' -Dfile=' + os.path.realpath(JAVADOC_JAR_FILE)

0 commit comments

Comments
 (0)