diff --git a/build.py b/build.py index 0e4902bd..76acf0f7 100755 --- a/build.py +++ b/build.py @@ -36,13 +36,14 @@ from common import VCSException #Read configuration... execfile('config.py') - # Parse command line... parser = OptionParser() parser.add_option("-v", "--verbose", action="store_true", default=False, help="Spew out even more information than normal") parser.add_option("-p", "--package", default=None, help="Build only the specified package") +parser.add_option("-s", "--stop", action="store_true", default=False, + help="Make the build stop on exceptions") (options, args) = parser.parse_args() # Get all apps... @@ -51,6 +52,11 @@ apps = common.read_metadata(options.verbose) failed_apps = {} build_succeeded = [] +log_dir = 'logs' +if not os.path.isdir(log_dir): + print "Creating log directory" + os.makedirs(log_dir) + output_dir = 'repo' if not os.path.isdir(output_dir): print "Creating output directory" @@ -135,17 +141,17 @@ for app in apps: if thisbuild.has_key('maven'): p = subprocess.Popen(['mvn', 'clean', 'install', '-Dandroid.sdk.path=' + sdk_path], - cwd=root_dir, stdout=subprocess.PIPE) + cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) else: 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] + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output, error = p.communicate() if p.returncode != 0: - raise BuildException("Build failed for %s:%s (%s)" % (app['id'], thisbuild['version'], output.strip())) + raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip()) elif options.verbose: print output print "Build successful" @@ -267,12 +273,21 @@ for app in apps: os.remove(dest_unsigned) build_succeeded.append(app) except BuildException as be: + if options.stop: + raise print "Could not build app %s due to BuildException: %s" % (app['id'], be) + logfile = open(os.path.join(log_dir, app['id'] + '.log'), 'a+') + logfile.write(str(be)) + logfile.close failed_apps[app['id']] = be except VCSException as vcse: + if options.stop: + raise print "VCS error while building app %s: %s" % (app['id'], vcse) failed_apps[app['id']] = vcse except Exception as e: + if options.stop: + raise print "Could not build app %s due to unknown error: %s" % (app['id'], e) failed_apps[app['id']] = e @@ -280,9 +295,11 @@ for app in build_succeeded: print "success: %s" % (app['id']) for fa in failed_apps: - print "Build for app %s failed: %s" % (fa, failed_apps[fa]) + print "Build for app %s failed:\n%s" % (fa, failed_apps[fa]) print "Finished." +if len(build_succeeded) > 0: + print str(len(failed_succeeded)) + ' builds succeeded' if len(failed_apps) > 0: print str(len(failed_apps)) + ' builds failed' diff --git a/common.py b/common.py index 6d3e8e83..d54ed432 100644 --- a/common.py +++ b/common.py @@ -54,7 +54,7 @@ class vcs: self.remote = remote self.local = local - + # Refresh the local repository - i.e. get the latest code. This # works either by updating if a local copy already exists, or by # cloning from scratch if it doesn't. @@ -384,11 +384,18 @@ def read_metadata(verbose=False): return apps class BuildException(Exception): - def __init__(self, value): + def __init__(self, value, stdout = None, stderr = None): self.value = value + self.stdout = stdout + self.stderr = stderr def __str__(self): - return repr(self.value) + ret = repr(self.value) + if self.stdout: + ret = ret + "\n==== stdout begin ====\n" + str(self.stdout) + "\n==== stdout end ====" + if self.stderr: + ret = ret + "\n==== stderr begin ====\n" + str(self.stderr) + "\n==== stderr end ====" + return ret class VCSException(Exception): def __init__(self, value): diff --git a/metadata/com.andrewshu.android.reddit.txt b/metadata/com.andrewshu.android.reddit.txt index ccf46512..6d100564 100644 --- a/metadata/com.andrewshu.android.reddit.txt +++ b/metadata/com.andrewshu.android.reddit.txt @@ -23,5 +23,5 @@ Build Version:1.2.1.2,75,28c98a7,prebuild=rsync -r lib/ libs,target=android-10 Build Version:1.2.1.3,76,143892b558,prebuild=rsync -r lib/ libs,target=android-10 Build Version:1.2.1.5,78,!more dependency shuffling required and watch out for the proguard config -Market Version:1.2.1.5 -Market Version Code:78 +Market Version:1.2.2a +Market Version Code:81 diff --git a/metadata/com.bottleworks.dailymoney.txt b/metadata/com.bottleworks.dailymoney.txt index 9a359b78..77724e11 100644 --- a/metadata/com.bottleworks.dailymoney.txt +++ b/metadata/com.bottleworks.dailymoney.txt @@ -1,9 +1,10 @@ +Disabled:Non-free blob License:GPLv2 Category:Office Web Site:https://code.google.com/p/daily-money/ Source Code:https://code.google.com/p/daily-money/source/browse/ Issue Tracker:https://code.google.com/p/daily-money/issues/list -Summary:A simple & easy financial android application +Summary:Simple Finance Manager Description: Features: * Record your daily expense, income, asset and liability diff --git a/metadata/com.ghostsq.commander.txt b/metadata/com.ghostsq.commander.txt index b4becd21..2e78dcc2 100644 --- a/metadata/com.ghostsq.commander.txt +++ b/metadata/com.ghostsq.commander.txt @@ -27,5 +27,5 @@ prebuild=sed -ri 's/(debuggable)="true"/\1="false"/' AndroidManifest.xml Build Version:1.36.4,110,161,\ prebuild=sed -ri 's/(debuggable)="true"/\1="false"/' AndroidManifest.xml -Market Version:1.39.2 -Market Version Code:152 +Market Version:1.39.3 +Market Version Code:154 diff --git a/metadata/com.matburt.mobileorg.txt b/metadata/com.matburt.mobileorg.txt index 17f04615..27fb6140 100644 --- a/metadata/com.matburt.mobileorg.txt +++ b/metadata/com.matburt.mobileorg.txt @@ -14,5 +14,5 @@ Repo:https://github.com/matburt/mobileorg-android.git #Needs dropbox consumer key #Build Version:0.5.2,51,38dfe967ee99c71b12b8 -Market Version:0.6.2 -Market Version Code:62 +Market Version:0.7.1 +Market Version Code:71 diff --git a/metadata/de.shandschuh.sparserss.txt b/metadata/de.shandschuh.sparserss.txt index 1472a955..9b17fa57 100644 --- a/metadata/de.shandschuh.sparserss.txt +++ b/metadata/de.shandschuh.sparserss.txt @@ -24,5 +24,5 @@ Build Version:1.3,69,197,target=android-8 Build Version:1.3.1,70,210,target=android-10 -Market Version:1.3.1 -Market Version Code:70 +Market Version:1.3.2 +Market Version Code:71 diff --git a/metadata/edu.rit.poe.atomix.txt b/metadata/edu.rit.poe.atomix.txt index c770ce0e..4e127de8 100644 --- a/metadata/edu.rit.poe.atomix.txt +++ b/metadata/edu.rit.poe.atomix.txt @@ -12,4 +12,4 @@ obstacle. Repo Type:hg Repo:https://droid-atomix.googlecode.com/hg/ Use Built:Yes -Build Version:1.0.1,2,ea2086d1f9fe759866008f6fe5187fc1cc97bd1d,target=android-4 +Build Version:1.0.1,2,ea2086d1f9fe759866008f6fe5187fc1cc97bd1d,target=android-4,prebuild=sed -i -e "/key\.alias.*/d" -e "/key\.store.*/d" *.properties diff --git a/metadata/net.sourceforge.servestream.txt b/metadata/net.sourceforge.servestream.txt index a58594b1..125b4435 100644 --- a/metadata/net.sourceforge.servestream.txt +++ b/metadata/net.sourceforge.servestream.txt @@ -22,5 +22,5 @@ Build Version:0.2.11,46,614,prebuild=mv lib/ libs/ #Still guessing, see previous comment Build Version:0.3.1,48,659,prebuild=mv lib/ libs/ -Market Version:0.4.1 -Market Version Code:51 +Market Version:0.4.3 +Market Version Code:53 diff --git a/metadata/net.sylvek.sharemyposition.txt b/metadata/net.sylvek.sharemyposition.txt index f463af21..01a010b9 100644 --- a/metadata/net.sylvek.sharemyposition.txt +++ b/metadata/net.sylvek.sharemyposition.txt @@ -22,5 +22,5 @@ Repo:http://sharemyposition.googlecode.com/svn/trunk/ Build Version:1.0.11,16,64,subdir=ShareMyPosition-android -Market Version:1.0.11 -Market Version Code:16 +Market Version:1.1.0-beta1 +Market Version Code:18 diff --git a/metadata/net.tedstein.AndroSS.txt b/metadata/net.tedstein.AndroSS.txt index c9f77597..8e2b8411 100644 --- a/metadata/net.tedstein.AndroSS.txt +++ b/metadata/net.tedstein.AndroSS.txt @@ -20,5 +20,5 @@ Build Version:0.2.2,8,v0.2.2,buildjni=yes,target=android-8 Build Version:0.3.-1,10,v0.3.-1,buildjni=yes,target=android-8 Build Version:0.3.2,13,v0.3.2,buildjni=yes,target=android-8 -Market Version:0.4.1 -Market Version Code:15 +Market Version:0.4.2 +Market Version Code:16 diff --git a/metadata/org.coolreader.txt b/metadata/org.coolreader.txt index f515884e..9a623c2a 100644 --- a/metadata/org.coolreader.txt +++ b/metadata/org.coolreader.txt @@ -49,5 +49,5 @@ Build Version:3.0.54-5,275,cr3.0.54-5,subdir=android,rm=android/build.properties Build Version:3.0.54-9,279,cr3.0.54-9,subdir=android,rm=android/build.properties,buildjni=yes Build Version:3.0.54-33,303,cr3.0.54-33,subdir=android,rm=android/build.properties,buildjni=yes -Market Version:3.0.54-33 -Market Version Code:303 +Market Version:3.0.54-38 +Market Version Code:308 diff --git a/metadata/org.hermit.dazzle.txt b/metadata/org.hermit.dazzle.txt index cb4d87b4..704de91d 100644 --- a/metadata/org.hermit.dazzle.txt +++ b/metadata/org.hermit.dazzle.txt @@ -3,9 +3,12 @@ Category:System Web Site:https://code.google.com/p/moonblink/wiki/Dazzle Source Code:https://moonblink.googlecode.com/svn/trunk/Dazzle/ Issue Tracker:https://code.google.com/p/moonblink/issues/list -Summary:configurable switcher widget for WiFi, Bluetooth, GPS, airplane mode, and brightness controls +Summary:Configurable switcher widget Description: -Dazzle is a configurable switcher widget for Android devices; it allows you to create one or more switcher widgets, in four sizes, with your choice of controls. You can choose from WiFi, Bluetooth, GPS, airplane mode, and brightness controls; on supported devices, brightness lets you toggle between auto and manual modes. +Dazzle is a configurable switcher widget; it allows you to create one or more +switcher widgets, in four sizes, with your choice of controls. You can choose +from WiFi, Bluetooth, GPS, airplane mode, and brightness controls; on +supported devices, brightness lets you toggle between auto and manual modes. . Repo Type:svn diff --git a/metadata/org.jfedor.frozenbubble.txt b/metadata/org.jfedor.frozenbubble.txt index a1f5a8ca..b0470372 100644 --- a/metadata/org.jfedor.frozenbubble.txt +++ b/metadata/org.jfedor.frozenbubble.txt @@ -9,8 +9,8 @@ Description: A bubble shooting game. Knock the bubbles down by forming clusters of three or more bubbles. . -Market Version:1.11 -Market Version Code:12 +Market Version:1.12 +Market Version Code:13 Repo Type:svn Repo:http://frozenbubbleandroid.googlecode.com/svn/ diff --git a/metadata/org.wordpress.android.txt b/metadata/org.wordpress.android.txt index 0c9540fd..47471fe8 100644 --- a/metadata/org.wordpress.android.txt +++ b/metadata/org.wordpress.android.txt @@ -21,5 +21,5 @@ Repo:http://android.svn.wordpress.org/trunk/ Build Version:1.3.9,31,202,prebuild=mkdir libs && mv *.jar libs && sed -i "s@checkStats(accounts.size());@// MY PRIVACY > YOUR STATS@" src/org/wordpress/android/wpAndroid.java,encoding=utf-8 Build Version:1.4.1,33,228,prebuild=mkdir libs && mv *.jar libs && sed -i "s@checkStats(accounts.size());@// MY PRIVACY > YOUR STATS@" src/org/wordpress/android/wpAndroid.java,encoding=utf-8 -Market Version:2.0.1 -Market Version Code:39 +Market Version:2.0.2 +Market Version Code:40 diff --git a/metadata/org.xbmc.android.remote.txt b/metadata/org.xbmc.android.remote.txt index e178818e..16b4d901 100644 --- a/metadata/org.xbmc.android.remote.txt +++ b/metadata/org.xbmc.android.remote.txt @@ -17,5 +17,5 @@ Repo:http://android-xbmcremote.googlecode.com/svn/trunk/XBMC%20Remote Build Version:0.8.5-beta1,730,730,encoding=utf-8,prebuild=mv lib libs && mv lib-src/org/codehaus src/org/ Build Version:0.8.6-beta1,768,768,encoding=utf-8,prebuild=mv lib libs && mv lib-src/org/codehaus src/org/ -Market Version:0.8.7-beta1 -Market Version Code:807 +Market Version:0.8.8-beta1 +Market Version Code:808 diff --git a/metadata/org.yaxim.androidclient.txt b/metadata/org.yaxim.androidclient.txt index e74f65fb..3d1f78c6 100644 --- a/metadata/org.yaxim.androidclient.txt +++ b/metadata/org.yaxim.androidclient.txt @@ -19,5 +19,5 @@ Build Version:0.8.0,9,0.8.0,oldsdkloc=yes,submodules=yes,fixtrans=yes,target=and Build Version:0.8.1,10,0.8.1,oldsdkloc=yes,submodules=yes,fixtrans=yes,target=android-10 Build Version:0.8.2,11,0.8.2,oldsdkloc=yes,submodules=yes,fixtrans=yes,target=android-10 -Market Version:0.8.2 -Market Version Code:11 +Market Version:0.8.3 +Market Version Code:12 diff --git a/scanner.py b/scanner.py index 475cecdf..3291a2dc 100755 --- a/scanner.py +++ b/scanner.py @@ -93,6 +93,7 @@ for app in apps: # Scan for common known non-free blobs: usual_suspects = ['flurryagent.jar', 'paypal_mpl.jar', + 'libGoogleAnalytics.jar', 'admob-sdk-android.jar'] for r,d,f in os.walk(build_dir): for curfile in f: