diff --git a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb index 9ecb0af8..2f3f6e6c 100644 --- a/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb +++ b/buildserver/cookbooks/fdroidbuild-general/recipes/default.rb @@ -13,3 +13,25 @@ if node['kernel']['machine'] == "x86_64" end end +script "install-gradle" do + cwd "/tmp" + interpreter "bash" + code " + unzip /vagrant/cache/gradle-1.7-bin.zip + mv gradle-1.7 /opt/gradle + " + not_if "test -d /opt/gradle" +end + +execute "add-gradle-home" do + user user + command "echo \"export GRADLE_HOME=/opt/gradle\" >> /home/#{user}/.bashrc" + not_if "grep GRADLE_HOME /home/#{user}/.bashrc" +end +execute "add-gradle-bin" do + user user + command "echo \"export PATH=$PATH:/opt/gradle/bin\" >> /home/#{user}/.bashrc" + not_if "grep gradle/bin /home/#{user}/.bashrc" +end + + diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index 20f51b80..0cb435ac 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -145,7 +145,13 @@ def check_repomanifest(app, sdk_path, branch=None): if not os.path.isdir(build_dir): return (None, "Subdir '" + app['builds'][-1]['subdir'] + "'is not a valid directory") - version, vercode, package = common.parse_androidmanifest(build_dir) + if os.path.exists(os.path.join(build_dir, 'AndroidManifest.xml')): + version, vercode, package = common.parse_androidmanifest(build_dir) + elif os.path.exists(os.path.join(build_dir, 'src', 'main', 'AndroidManifest.xml')): + # Alternate location for simple gradle locations... + version, vercode, package = common.parse_androidmanifest(os.path.join(build_dir, 'src', 'main')) + else: + return (None, "AndroidManifest.xml not found") if not package: return (None, "Couldn't find package ID") if package != app['id']: diff --git a/makebuildserver.py b/makebuildserver.py index a1c44011..07c65fa9 100755 --- a/makebuildserver.py +++ b/makebuildserver.py @@ -49,22 +49,38 @@ if not os.path.exists(cachedir): os.mkdir(cachedir) cachefiles = [ ('android-sdk_r21.0.1-linux.tgz', - 'http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz')] + 'http://dl.google.com/android/android-sdk_r21.0.1-linux.tgz', + None), + ('gradle-1.7-bin.zip', + 'http://services.gradle.org/distributions/gradle-1.7-bin.zip', + '360c97d51621b5a1ecf66748c718594e5f790ae4fbc1499543e0c006033c9d30')] if arch64: cachefiles.extend([ ('android-ndk-r8e-linux-x86_64.tar.bz2', - 'http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2')]) + 'http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86_64.tar.bz2', + None)]) else: cachefiles.extend([ ('android-ndk-r8e-linux-x86.tar.bz2', - 'http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2')]) + 'http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2', + None)]) wanted = [] -for f, src in cachefiles: +for f, src, shasum in cachefiles: if not os.path.exists(os.path.join(cachedir, f)): print "Downloading " + f + " to cache" if subprocess.call(['wget', src], cwd=cachedir) != 0: print "...download of " + f + " failed." sys.exit(1) + if shasum: + p = subprocess.Popen(['shasum', '-a', '256', os.path.join(cachedir, f)], + stdout=subprocess.PIPE) + v = p.communicate()[0].split(' ')[0] + if v != shasum: + print "Invalid shasum of '" + v + "' detected for " + f + sys.exit(1) + else: + print "...shasum verified for " + f + wanted.append(f)