1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-02 17:20:25 +02:00

Merge branch 'master' into logging

Conflicts:
	fdroidserver/common.py
This commit is contained in:
Daniel Martí 2014-01-28 14:14:59 +01:00
commit 2f93ba9bd6
13 changed files with 63 additions and 60 deletions

View File

@ -12,7 +12,9 @@ Copyright @copyright{} 2010, 2011, 2012, 2013 Ciaran Gultnieks
Copyright @copyright{} 2011 Henrik Tunedal, Michael Haas, John Sullivan 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 @quotation
Permission is granted to copy, distribute and/or modify this document 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. try enabling this option.
@item target=<target> @item target=<target>
Specifies a particular SDK target for compilation, overriding the Specifies a particular SDK target for compilation, overriding the value
project.properties of the app and possibly sub-projects. Note that this does defined in the code by upstream. This has different effects depending on what
not change the target SDK in the AndroidManifest.xml — the level of features build system used — this flag currently affects ant, maven and gradle projects
that can be included in the build. This is likely to cause the whole build.xml only. Note that this does not change the target SDK in the
to be rewritten, which is fine if it's a 'standard' android file or doesn't AndroidManifest.xml, which determines the level of features that can be
already exist, but not a good idea if it's heavily customised. If you get an included in the build.
error about invalid target, first try @code{init=rm -rf bin/}; otherwise this
parameter should do the trick.
Please note that gradle builds should be using compilesdk=. 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
@item compilesdk=<level> rewritten, which is fine if it's a 'standard' android file or doesn't already
Practically accomplishes the same that target= does when used in ant and maven exist, but not a good idea if it's heavily customised.
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.
@item update=xxx @item update=xxx
By default, 'android update project' is used to generate or update the 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 Space-separated list of gradle tasks to be run before the assemble task
in a gradle project build. in a gradle project build.
@item bindir=<path>
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 @item antcommand=xxx
Specify an alternate ant command (target) instead of the default 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. '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. string will be passed to python's @code{eval} function.
Especially useful with apps that we want to compile for different ABIs, but 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} whose vercodes don't always have trailing zeros. For example, with
set at something like @code{%c*10 + 4}, we will be able to track updates and @code{Vercode Operation} set at something like @code{%c*10 + 4}, we will be
build three different versions of every upstream version. able to track updates and build up to four different versions of every
upstream version.
@node Archive Policy @node Archive Policy
@section Archive Policy @section Archive Policy

View File

@ -3,7 +3,7 @@
# fd-commit - part of the FDroid server tools # fd-commit - part of the FDroid server tools
# Commits updates to apps, allowing you to edit the commit messages # Commits updates to apps, allowing you to edit the commit messages
# #
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
@ -60,19 +60,31 @@ while read line; do
fullname="$id" fullname="$id"
fi fi
onlybuild=true
newbuild=false newbuild=false
while read l; do 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 newbuild=true
build=${l#*:} build=${l#*:}
version=${build%%,*} version=${build%%,*}
build=${build#*,} build=${build#*,}
vercode=${build%%,*} vercode=${build%%,*}
elif $newbuild && $onlybuild [[ "$l" == "+"*"disable="* ]]; then
disable=true
fi fi
done < <(git diff HEAD -- "$file") done < <(git diff HEAD -- "$file")
if $newbuild ; then if $newbuild && $onlybuild; then
message="Update $fullname to $version ($vercode)" if $disable; then
message="Don't update $fullname to $version ($vercode)"
else
message="Update $fullname to $version ($vercode)"
fi
else else
message="$fullname:" message="$fullname:"
fi fi

2
fdroid
View File

@ -3,7 +3,7 @@
# #
# fdroid.py - part of the FDroid server tools # fdroid.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by

View File

@ -3,7 +3,7 @@
# #
# build.py - part of the FDroid server tools # build.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # 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(',') flavours = thisbuild['gradle'].split(',')
gradle_dir = root_dir 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', '']: if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']:
flavours[0] = '' 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) raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), p.stdout)
logging.info("Successfully built version " + thisbuild['version'] + ' of ' + app['id']) 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': if thisbuild['type'] == 'maven':
stdout_apk = '\n'.join([ stdout_apk = '\n'.join([
line for line in p.stdout.splitlines() if any(a in line for a in ('.apk','.ap_'))]) line for line in p.stdout.splitlines() if any(a in line for a in ('.apk','.ap_'))])

View File

@ -3,7 +3,7 @@
# #
# checkupdates.py - part of the FDroid server tools # checkupdates.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by

View File

@ -2,7 +2,7 @@
# #
# common.py - part of the FDroid server tools # common.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # 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) srclibpaths.append(basesrclib)
# Generate (or update) the ant build file, build.xml # 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'), parms = [os.path.join(config['sdk_path'], 'tools', 'android'),
'update', 'project'] 'update', 'project']
if 'target' in build and build['target']: 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', '']: if flavour in ['main', 'yes', '']:
flavour = None 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 # Remove forced debuggable flags
logging.info("Removing debuggable flags") logging.info("Removing debuggable flags")
for path in manifest_paths(root_dir, flavour): 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) relpath = os.path.relpath(libpath, root_dir)
proppath = os.path.join(root_dir, 'project.properties') proppath = os.path.join(root_dir, 'project.properties')
with open(proppath, "r") as o: lines = []
lines = o.readlines() if os.path.isfile(proppath):
with open(proppath, "r") as o:
lines = o.readlines()
with open(proppath, "w") as o: with open(proppath, "w") as o:
placed = False placed = False

View File

@ -3,7 +3,7 @@
# #
# import.py - part of the FDroid server tools # import.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by

View File

@ -3,7 +3,7 @@
# #
# update.py - part of the FDroid server tools # update.py - part of the FDroid server tools
# Copyright (C) 2010-2013, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-2013, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# Copyright (C) 2013 Hans-Christoph Steiner <hans@eds.org> # Copyright (C) 2013 Hans-Christoph Steiner <hans@eds.org>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify

View File

@ -3,7 +3,7 @@
# #
# verify.py - part of the FDroid server tools # verify.py - part of the FDroid server tools
# Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by

View File

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# rewritemeta.py - part of the FDroid server tool # rewritemeta.py - part of the FDroid server tool
# Copyright (C) 2010-12, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by

View File

@ -2,7 +2,7 @@
# #
# common.py - part of the FDroid server tools # common.py - part of the FDroid server tools
# Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # 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 # This defines the preferred order for the build items - as in the
# manual, they're roughly in order of application. # manual, they're roughly in order of application.
keyorder = ['disable', 'commit', 'subdir', 'submodules', 'init', keyorder = ['disable', 'commit', 'subdir', 'submodules', 'init',
'gradle', 'maven', 'oldsdkloc', 'target', 'compilesdk', 'gradle', 'maven', 'oldsdkloc', 'target',
'update', 'encoding', 'forceversion', 'forcevercode', 'rm', 'update', 'encoding', 'forceversion', 'forcevercode', 'rm',
'fixtrans', 'fixapos', 'extlibs', 'srclibs', 'patch', 'fixtrans', 'fixapos', 'extlibs', 'srclibs', 'patch',
'prebuild', 'scanignore', 'scandelete', 'build', 'buildjni', 'prebuild', 'scanignore', 'scandelete', 'build', 'buildjni',

View File

@ -3,7 +3,7 @@
# #
# publish.py - part of the FDroid server tools # publish.py - part of the FDroid server tools
# Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-13, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by

View File

@ -3,7 +3,7 @@
# #
# update.py - part of the FDroid server tools # update.py - part of the FDroid server tools
# Copyright (C) 2010-2013, Ciaran Gultnieks, ciaran@ciarang.com # Copyright (C) 2010-2013, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc> # Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by