diff --git a/docs/fdroid.texi b/docs/fdroid.texi index 0ec5eba5..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 @@ -836,22 +838,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 @@ -1012,12 +1009,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. @@ -1196,9 +1187,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 diff --git a/fd-commit b/fd-commit index e64486a1..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 @@ -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 diff --git a/fdroid b/fdroid index 880e2e9f..acb80049 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 97a645ec..96daeeb6 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 @@ -578,17 +578,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] = '' @@ -614,10 +603,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) logging.info("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_'))]) diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index f37ace28..4984ef22 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 5ac04d1c..ad4b7e42 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 @@ -913,8 +913,8 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= srclibpaths.append(basesrclib) - # Generate (or update) the ant build file, build.xml - if (updatemode != 'no' and build['type'] == 'ant'): + # Generate (or update) the ant build file, build.xml... + 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']: @@ -988,6 +988,18 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if flavour in ['main', 'yes', '']: flavour = None + 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 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) + # Remove forced debuggable flags logging.info("Removing debuggable flags") for path in manifest_paths(root_dir, flavour): @@ -1466,8 +1478,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 diff --git a/fdroidserver/import.py b/fdroidserver/import.py index 8d066ae7..64de7740 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 a7f791bd..db11465e 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 fccc5c2c..632a4f91 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 da6a5234..2468da9d 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 54940238..9fa473b9 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 @@ -699,7 +699,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', diff --git a/fdroidserver/publish.py b/fdroidserver/publish.py index 1d8d8dba..c6dadea5 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 ff9a17e1..d72f67f1 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