1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-06 11:00:13 +02:00

Added maven support to build process

This commit is contained in:
Ciaran Gultnieks 2011-04-27 10:03:43 +01:00
parent 623f06d7bc
commit b37ce633fe
2 changed files with 20 additions and 7 deletions

2
README
View File

@ -25,6 +25,7 @@ To be able to auto-build packages, you're going to need:
*The Android NDK
*Ant
*Ant Contrib Tasks (Debian package ant-contrib)
*Maven (Debian package maven2)
*JavaCC (Debian package javacc)
*VCS clients: svn, git, hg, bzr
*A keystore for holding release keys. (Safe, secure and well backed up!)
@ -194,6 +195,7 @@ configuration to the build. These are:
need to enable this.
fixapos=yes Like fixtrans, but deals with an even older issue relating
to 'unescaped apostrophes' in translation strings.
maven=yes Build with maven instead of ant
Another example, using extra parameters:

View File

@ -194,7 +194,8 @@ for app in apps:
sys.exit(1)
# Generate (or update) the ant build file, build.xml...
if thisbuild.get('update', 'yes') == 'yes':
if (thisbuild.get('update', 'yes') == 'yes' and
not thisbuild.has_key('maven')):
parms = [os.path.join(sdk_path, 'tools', 'android'),
'update', 'project', '-p', '.']
parms.append('--subprojects')
@ -419,12 +420,17 @@ for app in apps:
print output
# Build the release...
if thisbuild.has_key('antcommand'):
antcommand = thisbuild['antcommand']
if thisbuild.has_key('maven'):
p = subprocess.Popen(['mvn', 'clean', 'install',
'-Dandroid.sdk.path=' + sdk_path],
cwd=root_dir, stdout=subprocess.PIPE)
else:
antcommand = 'release'
p = subprocess.Popen(['ant', antcommand], cwd=root_dir,
stdout=subprocess.PIPE)
if thisbuild.has_key('antcommand'):
antcommand = thisbuild['antcommand']
else:
antcommand = 'release'
p = subprocess.Popen(['ant', antcommand], cwd=root_dir,
stdout=subprocess.PIPE)
output = p.communicate()[0]
if p.returncode != 0:
print output
@ -443,10 +449,15 @@ for app in apps:
# Special case (again!) for funambol...
src = ("funambol-android-sync-client-" +
thisbuild['version'] + "-unsigned.apk")
elif thisbuild.has_key('maven'):
src = re.match(r".*^\[INFO\] Installing /.*/([^/]*)\.apk",
output, re.S|re.M).group(1)
src = os.path.join(bindir, src) + '.apk'
#[INFO] Installing /home/ciaran/fdroidserver/tmp/mainline/application/target/callerid-1.0-SNAPSHOT.apk
else:
src = re.match(r".*^.*Creating (\S+) for release.*$.*", output,
re.S|re.M).group(1)
src = os.path.join(bindir, src)
src = os.path.join(bindir, src)
# By way of a sanity check, make sure the version and version
# code in our new apk match what we expect...