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

Build documentation updates and a new option (novcheck

This commit is contained in:
Ciaran Gultnieks 2011-01-31 22:57:56 +00:00
parent 73cf43ca59
commit 2895250014
2 changed files with 47 additions and 36 deletions

57
README
View File

@ -126,49 +126,56 @@ configuration to the build. These are:
subdir=<path> - Specifies to build from a subdirectory of the checked out subdir=<path> - Specifies to build from a subdirectory of the checked out
source code. Normally this directory is changed to before source code. Normally this directory is changed to before
building, but there is a special case for SVN repositories building, but there is a special case for SVN repositories
where the URL is specified with a * at the end. See the where the URL is specified with a * at the end. See the
documentation for the Repo field for more information. documentation for the Repo field for more information.
bindir=<path> - Normally the build output (apk) is expected to be in the bindir=<path> - Normally the build output (apk) is expected to be in the
bin subdirectory below the ant build files. If the project bin subdirectory below the ant build files. If the project
is configured to put it elsewhere, that can be specified is configured to put it elsewhere, that can be specified
here, relative to the base of the checked out repo.. here, relative to the base of the checked out repo..
oldsdkloc=yes - The sdk location in the repo is in an old format, or the oldsdkloc=yes - The sdk location in the repo is in an old format, or the
build.xml is expecting such. The 'new' format is sdk.dir build.xml is expecting such. The 'new' format is sdk.dir
while the VERY OLD format is sdk-location. Typically, if while the VERY OLD format is sdk-location. Typically, if
you get a message along the lines of: you get a message along the lines of:
"com.android.ant.SetupTask cannot be found" "com.android.ant.SetupTask cannot be found"
when trying to build, then try enabling this option. when trying to build, then try enabling this option.
target=<target> - Specifies a particular SDK target, when the source doesn't. target=<target> - Specifies a particular SDK target, when the source doesn't.
This is likely to cause the whole build.xml to be rewritten, 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 which is fine if it's a 'standard' android file or doesn't
already exist, but not a good idea if it's heavily already exist, but not a good idea if it's heavily
customised. customised.
rm=<relpath> - Specifies the relative path of file to delete before the rm=<relpath> - Specifies the relative path of file to delete before the
build is done. The path is relative to the base of the build is done. The path is relative to the base of the
build directory - i.e. the directory that contains build directory - i.e. the directory that contains
AndroidManifest.xml. AndroidManifest.xml.
antcommand=xxx - Specify an alternate ant command (target) instead of the antcommand=xxx - Specify an alternate ant command (target) instead of the
default 'release'. default 'release'.
insertversion=x - If specified, the pattern 'x' in the AndroidManifest.xml is insertversion=x - If specified, the pattern 'x' in the AndroidManifest.xml is
replaced with the version number for the build. replaced with the version number for the build.
insertvercode=x - If specified, the pattern 'x' in the AndroidManifest.xml is insertvercode=x - If specified, the pattern 'x' in the AndroidManifest.xml is
replaced with the version code for the build. replaced with the version code for the build.
update=no By default, 'android update project' is used to generate or update=no By default, 'android update project' is used to generate or
update the build.xml file. Specifying update=no bypasses update the build.xml file. Specifying update=no bypasses
that. that.
initfun=yes Enables a selection of mad hacks to make com.funambol.android initfun=yes Enables a selection of mad hacks to make com.funambol.android
build. Probably not useful for any other application. build. Probably not useful for any other application.
buildjni=yes Enables building of native code via the ndk-build script before buildjni=yes Enables building of native code via the ndk-build script before
doing the main ant build. doing the main ant build.
submodules=yes Use if the project (git only) has submodules - causes git submodules=yes Use if the project (git only) has submodules - causes git
submodule init and update to be executed after the source is submodule init and update to be executed after the source is
cloned. cloned.
encoding=xxxx Adds a java.encoding property to local.properties with the given encoding=xxxx Adds a java.encoding property to local.properties with the given
value. Generally the value will be 'utf-8'. This is picked up by value. Generally the value will be 'utf-8'. This is picked up by
the SDK's ant rules, and forces the Java compiler to interpret the SDK's ant rules, and forces the Java compiler to interpret
source files with this encoding. If you receive warnings during source files with this encoding. If you receive warnings during
the compile about character encodings, you probably need this. the compile about character encodings, you probably need this.
prebuild=xxxx Specifies a shell command (or commands - chain with &&) to run
before the build takes place - the only proviso being that you
can't use , or = characters.
novcheck=yes Don't check that the version name and code in the resulting apk
are correct by looking at the build output - assume the metadata
is correct. This takes away a useful level of sanity checking, and
should only be used if the values can't be extracted.
Another example, using extra parameters: Another example, using extra parameters:

View File

@ -397,17 +397,21 @@ for app in apps:
p = subprocess.Popen([aapt_path,'dump','badging', p = subprocess.Popen([aapt_path,'dump','badging',
src], stdout=subprocess.PIPE) src], stdout=subprocess.PIPE)
output = p.communicate()[0] output = p.communicate()[0]
vercode = None if thisbuild.has_key('novcheck') and thisbuild['novcheck'] == "yes":
version = None vercode = thisbuild['vercode']
for line in output.splitlines(): version = thisbuild['version']
if line.startswith("package:"): else:
pat = re.compile(".*versionCode='([0-9]*)'.*") vercode = None
vercode = re.match(pat, line).group(1) version = None
pat = re.compile(".*versionName='([^']*)'.*") for line in output.splitlines():
version = re.match(pat, line).group(1) if line.startswith("package:"):
if version == None or versioncode == None: pat = re.compile(".*versionCode='([0-9]*)'.*")
print "Could not find version information in build in output" vercode = re.match(pat, line).group(1)
sys.exit(1) pat = re.compile(".*versionName='([^']*)'.*")
version = re.match(pat, line).group(1)
if version == None or versioncode == None:
print "Could not find version information in build in output"
sys.exit(1)
# Some apps (e.g. Timeriffic) have had the bonkers idea of # Some apps (e.g. Timeriffic) have had the bonkers idea of
# including the entire changelog in the version number. Remove # including the entire changelog in the version number. Remove