From 03cc679dc87e1924b6a30dbbf9d8985fbe98ee5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 27 Jan 2014 22:03:39 +0100 Subject: [PATCH 1/8] Forgot to actually install 1.10 via chef --- buildserver/cookbooks/gradle/recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildserver/cookbooks/gradle/recipes/default.rb b/buildserver/cookbooks/gradle/recipes/default.rb index b13e397e..137e8d8c 100644 --- a/buildserver/cookbooks/gradle/recipes/default.rb +++ b/buildserver/cookbooks/gradle/recipes/default.rb @@ -18,7 +18,7 @@ script "add-gradle-verdir" do not_if "test -d /opt/gradle/versions" end -%w{1.4 1.6 1.7 1.8 1.9}.each do |ver| +%w{1.4 1.6 1.7 1.8 1.9 1.10}.each do |ver| script "install-gradle-#{ver}" do cwd "/tmp" interpreter "bash" From dfd0ecc740ac75efda8c1cee917afd741d2da996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 27 Jan 2014 22:34:34 +0100 Subject: [PATCH 2/8] When using placed srclibs, don't fail if proj.prop doesn't exist --- fdroidserver/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 4e4322c0..954a67f6 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1497,8 +1497,10 @@ def place_srclib(root_dir, number, libpath): relpath = os.path.relpath(libpath, root_dir) proppath = os.path.join(root_dir, 'project.properties') - with open(proppath, "r") as o: - lines = o.readlines() + lines = [] + if os.path.isfile(proppath): + with open(proppath, "r") as o: + lines = o.readlines() with open(proppath, "w") as o: placed = False From 1b792c78dea67dcff05b67ec25685efc1906e026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 27 Jan 2014 23:43:28 +0100 Subject: [PATCH 3/8] Remove support for 'bindir' --- docs/fdroid.texi | 6 ------ fdroidserver/build.py | 4 ---- 2 files changed, 10 deletions(-) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 0ec5eba5..56ec8c19 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -1012,12 +1012,6 @@ to run maven inside that relative subdirectory. Space-separated list of gradle tasks to be run before the assemble task in a gradle project build. -@item bindir= -Normally the build output (apk) is expected to be in the bin -subdirectory below the ant build files. If the project is configured -to put it elsewhere, that can be specified here, relative to the base -of the checked out repo. Not yet implemented for gradle. - @item antcommand=xxx Specify an alternate ant command (target) instead of the default 'release'. It can't be given any flags, such as the path to a build.xml. diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 97e52c48..c2581f9a 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -631,10 +631,6 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), p.stdout) print "Successfully built version " + thisbuild['version'] + ' of ' + app['id'] - # Find the apk name in the output... - if 'bindir' in thisbuild: - bindir = os.path.join(build_dir, thisbuild['bindir']) - if thisbuild['type'] == 'maven': stdout_apk = '\n'.join([ line for line in p.stdout.splitlines() if any(a in line for a in ('.apk','.ap_'))]) From 778b15322cf868e68e8ab73eaf9235238e68454f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 28 Jan 2014 00:00:34 +0100 Subject: [PATCH 4/8] fd-commit support for disabled updates Also fix support for replacement builds --- fd-commit | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/fd-commit b/fd-commit index e64486a1..d80f6b5d 100755 --- a/fd-commit +++ b/fd-commit @@ -60,19 +60,31 @@ while read line; do fullname="$id" fi + onlybuild=true newbuild=false while read l; do - if [[ "$l" == "+Build:"* ]]; then + if [[ "$l" == "-Build:"* ]]; then + onlybuild=false + elif [[ "$l" == "+Build:"* ]]; then + if $newbuild; then + onlybuild=false + fi newbuild=true build=${l#*:} version=${build%%,*} build=${build#*,} vercode=${build%%,*} + elif $newbuild && $onlybuild [[ "$l" == "+"*"disable="* ]]; then + disable=true fi done < <(git diff HEAD -- "$file") - if $newbuild ; then - message="Update $fullname to $version ($vercode)" + if $newbuild && $onlybuild; then + if $disable; then + message="Don't update $fullname to $version ($vercode)" + else + message="Update $fullname to $version ($vercode)" + fi else message="$fullname:" fi From 3e789bd6b5c6af90d92b52cc52d073d8fe2262ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 28 Jan 2014 14:01:32 +0100 Subject: [PATCH 5/8] Merge compilesdk= into target=, better documentation about target= --- docs/fdroid.texi | 25 ++++++++++--------------- fdroidserver/build.py | 11 ----------- fdroidserver/common.py | 12 +++++++++++- fdroidserver/metadata.py | 2 +- 4 files changed, 22 insertions(+), 28 deletions(-) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 56ec8c19..29e94d08 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -836,22 +836,17 @@ is sdk-location. Typically, if you get a message along the lines of: try enabling this option. @item target= -Specifies a particular SDK target for compilation, overriding the -project.properties of the app and possibly sub-projects. Note that this does -not change the target SDK in the AndroidManifest.xml — the level of features -that can be included in the build. This is likely to cause the whole build.xml -to be rewritten, which is fine if it's a 'standard' android file or doesn't -already exist, but not a good idea if it's heavily customised. If you get an -error about invalid target, first try @code{init=rm -rf bin/}; otherwise this -parameter should do the trick. +Specifies a particular SDK target for compilation, overriding the value +defined in the code by upstream. This has different effects depending on what +build system used — this flag currently affects ant, maven and gradle projects +only. Note that this does not change the target SDK in the +AndroidManifest.xml, which determines the level of features that can be +included in the build. -Please note that gradle builds should be using compilesdk=. - -@item compilesdk= -Practically accomplishes the same that target= does when used in ant and maven -projects. compilesdk= is used rather than target= so as to not cause any more -confusion. It only takes effect on gradle builds in the build.gradle file, -thus using it in any other case is not wise. +In the case of an ant project, it modifies project.properties of the app and +possibly sub-projects. This is likely to cause the whole build.xml to be +rewritten, which is fine if it's a 'standard' android file or doesn't already +exist, but not a good idea if it's heavily customised. @item update=xxx By default, 'android update project' is used to generate or update the diff --git a/fdroidserver/build.py b/fdroidserver/build.py index c2581f9a..170c2c05 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -595,17 +595,6 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d flavours = thisbuild['gradle'].split(',') gradle_dir = root_dir - - if 'compilesdk' in thisbuild: - level = thisbuild["compilesdk"].split('-')[1] - subprocess.call(['sed', '-i', - 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+level+'@g', - 'build.gradle'], cwd=root_dir) - if '@' in thisbuild['gradle']: - subprocess.call(['sed', '-i', - 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+level+'@g', - 'build.gradle'], cwd=gradle_dir) - if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']: flavours[0] = '' diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 954a67f6..718e66e8 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -937,7 +937,7 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= # Generate (or update) the ant build file, build.xml... - if (updatemode != 'no' and build['type'] == 'ant'): + if updatemode != 'no' and build['type'] == 'ant': parms = [os.path.join(config['sdk_path'], 'tools', 'android'), 'update', 'project'] if 'target' in build and build['target']: @@ -1013,6 +1013,16 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if flavour in ['main', 'yes', '']: flavour = None + if 'target' in thisbuild: + n = thisbuild["target"].split('-')[1] + subprocess.call(['sed', '-i', + 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g', + 'build.gradle'], cwd=root_dir) + if '@' in thisbuild['gradle']: + subprocess.call(['sed', '-i', + 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g', + 'build.gradle'], cwd=gradle_dir) + # Remove forced debuggable flags print "Removing debuggable flags..." for path in manifest_paths(root_dir, flavour): diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 552a338e..f3108b56 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -698,7 +698,7 @@ def write_metadata(dest, app): # This defines the preferred order for the build items - as in the # manual, they're roughly in order of application. keyorder = ['disable', 'commit', 'subdir', 'submodules', 'init', - 'gradle', 'maven', 'oldsdkloc', 'target', 'compilesdk', + 'gradle', 'maven', 'oldsdkloc', 'target', 'update', 'encoding', 'forceversion', 'forcevercode', 'rm', 'fixtrans', 'fixapos', 'extlibs', 'srclibs', 'patch', 'prebuild', 'scanignore', 'scandelete', 'build', 'buildjni', From 02f314b7bd29621b2233b945eb86f144d23b1f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 28 Jan 2014 14:03:51 +0100 Subject: [PATCH 6/8] Better Vercode Operation example --- docs/fdroid.texi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 29e94d08..9452f19e 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -1185,9 +1185,10 @@ Check Mode}. @code{%c} will be replaced by the actual vercode, and the whole string will be passed to python's @code{eval} function. Especially useful with apps that we want to compile for different ABIs, but -whose vercodes don't always have trailing zeros. With @code{Vercode Operation} -set at something like @code{%c*10 + 4}, we will be able to track updates and -build three different versions of every upstream version. +whose vercodes don't always have trailing zeros. For example, with +@code{Vercode Operation} set at something like @code{%c*10 + 4}, we will be +able to track updates and build up to four different versions of every +upstream version. @node Archive Policy @section Archive Policy From 368714799736ce37c7c715b87c7ab28153951792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 28 Jan 2014 14:07:19 +0100 Subject: [PATCH 7/8] Update my own copyright notices --- docs/fdroid.texi | 4 +++- fd-commit | 2 +- fdroid | 2 +- fdroidserver/build.py | 2 +- fdroidserver/checkupdates.py | 2 +- fdroidserver/common.py | 2 +- fdroidserver/import.py | 2 +- fdroidserver/init.py | 2 +- fdroidserver/install.py | 2 +- fdroidserver/lint.py | 2 +- fdroidserver/metadata.py | 2 +- fdroidserver/publish.py | 2 +- fdroidserver/update.py | 2 +- 13 files changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 9452f19e..6cac6d4e 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -12,7 +12,9 @@ Copyright @copyright{} 2010, 2011, 2012, 2013 Ciaran Gultnieks Copyright @copyright{} 2011 Henrik Tunedal, Michael Haas, John Sullivan -Copyright @copyright{} 2013 David Black, Daniel Martí +Copyright @copyright{} 2013 David Black + +Copyright @copyright{} 2013, 2014 Daniel Martí @quotation Permission is granted to copy, distribute and/or modify this document diff --git a/fd-commit b/fd-commit index d80f6b5d..478850b6 100755 --- a/fd-commit +++ b/fd-commit @@ -3,7 +3,7 @@ # fd-commit - part of the FDroid server tools # Commits updates to apps, allowing you to edit the commit messages # -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroid b/fdroid index 02396313..69cc41e7 100755 --- a/fdroid +++ b/fdroid @@ -3,7 +3,7 @@ # # fdroid.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 170c2c05..c151c69c 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -3,7 +3,7 @@ # # build.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index d93a0646..232ae2c4 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -3,7 +3,7 @@ # # checkupdates.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 718e66e8..fd2e1abc 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -2,7 +2,7 @@ # # common.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/import.py b/fdroidserver/import.py index 3a4d3f75..e157b81d 100644 --- a/fdroidserver/import.py +++ b/fdroidserver/import.py @@ -3,7 +3,7 @@ # # import.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/init.py b/fdroidserver/init.py index dea189bd..bfa18046 100644 --- a/fdroidserver/init.py +++ b/fdroidserver/init.py @@ -3,7 +3,7 @@ # # update.py - part of the FDroid server tools # Copyright (C) 2010-2013, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # Copyright (C) 2013 Hans-Christoph Steiner # # This program is free software: you can redistribute it and/or modify diff --git a/fdroidserver/install.py b/fdroidserver/install.py index 66be0663..0cef99fa 100644 --- a/fdroidserver/install.py +++ b/fdroidserver/install.py @@ -3,7 +3,7 @@ # # verify.py - part of the FDroid server tools # Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index df8104ba..782c6f07 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # rewritemeta.py - part of the FDroid server tool -# Copyright (C) 2010-12, Ciaran Gultnieks, ciaran@ciarang.com +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index f3108b56..c31a451a 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -2,7 +2,7 @@ # # common.py - part of the FDroid server tools # Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/publish.py b/fdroidserver/publish.py index 85349fb1..a8adb951 100644 --- a/fdroidserver/publish.py +++ b/fdroidserver/publish.py @@ -3,7 +3,7 @@ # # publish.py - part of the FDroid server tools # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/fdroidserver/update.py b/fdroidserver/update.py index bf3eed32..765e6332 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -3,7 +3,7 @@ # # update.py - part of the FDroid server tools # Copyright (C) 2010-2013, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013 Daniel Martí +# Copyright (C) 2013-2014 Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by From d5859fab3212763b56df372a55930574cf7010df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 28 Jan 2014 14:14:18 +0100 Subject: [PATCH 8/8] Fix a couple gradle python mistakes --- fdroidserver/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index fd2e1abc..3bca96d3 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1013,12 +1013,14 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if flavour in ['main', 'yes', '']: flavour = None - if 'target' in thisbuild: - n = thisbuild["target"].split('-')[1] + if 'target' in build: + n = build["target"].split('-')[1] subprocess.call(['sed', '-i', 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g', 'build.gradle'], cwd=root_dir) - if '@' in thisbuild['gradle']: + if '@' in build['gradle']: + gradle_dir = os.path.join(root_dir, build['gradle'].split('@',1)[1]) + gradle_dir = os.path.normpath(gradle_dir) subprocess.call(['sed', '-i', 's@compileSdkVersion[ ]*[0-9]*@compileSdkVersion '+n+'@g', 'build.gradle'], cwd=gradle_dir)