1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01: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{} 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=<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=<level>
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=<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
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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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

2
fdroid
View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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_'))])

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
# Copyright (C) 2013 Hans-Christoph Steiner <hans@eds.org>
#
# 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
# 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
# it under the terms of the GNU Affero General Public License as published by

View File

@ -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í <mvdan@mvdan.cc>
#
# 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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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',

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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

View File

@ -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í <mvdan@mvdan.cc>
# Copyright (C) 2013-2014 Daniel Martí <mvdan@mvdan.cc>
#
# 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