mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 23:42:37 +03:00
Merge branch 'master' of git://gitorious.org/f-droid/fdroidserver
This commit is contained in:
commit
17cb991fd5
6 changed files with 34 additions and 31 deletions
|
@ -30,7 +30,8 @@ execute "add-android-sdk-path" do
|
||||||
end
|
end
|
||||||
|
|
||||||
%w{android-3 android-4 android-7 android-8 android-10 android-11
|
%w{android-3 android-4 android-7 android-8 android-10 android-11
|
||||||
android-12 android-13 android-14 android-15 android-16}.each do |sdk|
|
android-12 android-13 android-14 android-15 android-16
|
||||||
|
extra-android-support}.each do |sdk|
|
||||||
|
|
||||||
script "add_sdk_#{sdk}" do
|
script "add_sdk_#{sdk}" do
|
||||||
interpreter "bash"
|
interpreter "bash"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
%w{ant ant-contrib autoconf libtool libssl libssl-dev maven javacc python git-core mercurial subversion bzr git-svn make perlmagick}.each do |pkg|
|
%w{ant ant-contrib autoconf bison libtool libssl libssl-dev maven javacc python git-core mercurial subversion bzr git-svn make perlmagick}.each do |pkg|
|
||||||
package pkg do
|
package pkg do
|
||||||
action :install
|
action :install
|
||||||
end
|
end
|
||||||
|
|
|
@ -772,15 +772,15 @@ particular, literal backslashes should not be escaped.
|
||||||
You can use $$name$$ to substitute the path to a referenced srclib - see
|
You can use $$name$$ to substitute the path to a referenced srclib - see
|
||||||
the @code{srclib} directory for details of this.
|
the @code{srclib} directory for details of this.
|
||||||
|
|
||||||
You can use $$SDK$$ and $$NDK$$ to substitute the paths to the android
|
You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
|
||||||
SDK and NDK directories respectively.
|
android SDK and NDK directories, and maven 3 executable respectively.
|
||||||
|
|
||||||
@item init=xxxx
|
@item init=xxxx
|
||||||
As for 'prebuild', but runs on the source code BEFORE any other processing
|
As for 'prebuild', but runs on the source code BEFORE any other processing
|
||||||
takes place.
|
takes place.
|
||||||
|
|
||||||
You can use $$SDK$$ and $$NDK$$ to substitute the paths to the android
|
You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
|
||||||
SDK and NDK directories respectively.
|
android SDK and NDK directories, and maven 3 executable respectively.
|
||||||
|
|
||||||
@item novcheck=yes
|
@item novcheck=yes
|
||||||
Don't check that the version name and code in the resulting apk are
|
Don't check that the version name and code in the resulting apk are
|
||||||
|
|
|
@ -259,7 +259,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, extlib_dir, tmp_dir,
|
||||||
# Prepare the source code...
|
# Prepare the source code...
|
||||||
root_dir = common.prepare_source(vcs, app, thisbuild,
|
root_dir = common.prepare_source(vcs, app, thisbuild,
|
||||||
build_dir, extlib_dir, sdk_path, ndk_path,
|
build_dir, extlib_dir, sdk_path, ndk_path,
|
||||||
javacc_path, verbose)
|
javacc_path, mvn3, verbose)
|
||||||
|
|
||||||
# Scan before building...
|
# Scan before building...
|
||||||
buildprobs = common.scan_source(build_dir, root_dir, thisbuild)
|
buildprobs = common.scan_source(build_dir, root_dir, thisbuild)
|
||||||
|
@ -467,7 +467,7 @@ def parse_commandline():
|
||||||
help="Use build server")
|
help="Use build server")
|
||||||
parser.add_option("--resetserver", action="store_true", default=False,
|
parser.add_option("--resetserver", action="store_true", default=False,
|
||||||
help="Reset and create a brand new build server, even if the existing one appears to be ok.")
|
help="Reset and create a brand new build server, even if the existing one appears to be ok.")
|
||||||
parser.add_option("--on-server", action="store_true", default=False,
|
parser.add_option("--on-server", dest="onserver", action="store_true", default=False,
|
||||||
help="Specify that we're running on the build server")
|
help="Specify that we're running on the build server")
|
||||||
parser.add_option("-f", "--force", action="store_true", default=False,
|
parser.add_option("-f", "--force", action="store_true", default=False,
|
||||||
help="Force build of disabled apps, and carries on regardless of scan problems. Only allowed in test mode.")
|
help="Force build of disabled apps, and carries on regardless of scan problems. Only allowed in test mode.")
|
||||||
|
@ -505,9 +505,8 @@ def main():
|
||||||
|
|
||||||
global options
|
global options
|
||||||
# Read configuration...
|
# Read configuration...
|
||||||
global build_server_always, mvn3
|
globals()['build_server_always'] = False
|
||||||
build_server_always = False
|
globals()['mvn3'] = "mvn3"
|
||||||
mvn3 = "mvn3"
|
|
||||||
execfile('config.py', globals())
|
execfile('config.py', globals())
|
||||||
options, args = parse_commandline()
|
options, args = parse_commandline()
|
||||||
if build_server_always:
|
if build_server_always:
|
||||||
|
@ -517,7 +516,7 @@ def main():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Get all apps...
|
# Get all apps...
|
||||||
apps = common.read_metadata(options.verbose)
|
apps = common.read_metadata(options.verbose, xref=not options.onserver)
|
||||||
|
|
||||||
log_dir = 'logs'
|
log_dir = 'logs'
|
||||||
if not os.path.isdir(log_dir):
|
if not os.path.isdir(log_dir):
|
||||||
|
|
|
@ -607,26 +607,27 @@ def write_metadata(dest, app):
|
||||||
|
|
||||||
# Read all metadata. Returns a list of 'app' objects (which are dictionaries as
|
# Read all metadata. Returns a list of 'app' objects (which are dictionaries as
|
||||||
# returned by the parse_metadata function.
|
# returned by the parse_metadata function.
|
||||||
def read_metadata(verbose=False):
|
def read_metadata(verbose=False, xref=True):
|
||||||
apps = []
|
apps = []
|
||||||
for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
|
for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
|
||||||
if verbose:
|
if verbose:
|
||||||
print "Reading " + metafile
|
print "Reading " + metafile
|
||||||
apps.append(parse_metadata(metafile, verbose=verbose))
|
apps.append(parse_metadata(metafile, verbose=verbose))
|
||||||
|
|
||||||
# Parse all descriptions at load time, just to ensure cross-referencing
|
if xref:
|
||||||
# errors are caught early rather than when they hit the build server.
|
# Parse all descriptions at load time, just to ensure cross-referencing
|
||||||
def linkres(link):
|
# errors are caught early rather than when they hit the build server.
|
||||||
|
def linkres(link):
|
||||||
|
for app in apps:
|
||||||
|
if app['id'] == link:
|
||||||
|
return ("fdroid.app:" + link, "Dummy name - don't know yet")
|
||||||
|
raise MetaDataException("Cannot resolve app id " + link)
|
||||||
for app in apps:
|
for app in apps:
|
||||||
if app['id'] == link:
|
try:
|
||||||
return ("fdroid.app:" + link, "Dummy name - don't know yet")
|
description_html(app['Description'], linkres)
|
||||||
raise MetaDataException("Cannot resolve app id " + link)
|
except Exception, e:
|
||||||
for app in apps:
|
raise MetaDataException("Problem with description of " + app['id'] +
|
||||||
try:
|
" - " + str(e))
|
||||||
description_html(app['Description'], linkres)
|
|
||||||
except Exception, e:
|
|
||||||
raise MetaDataException("Problem with description of " + app['id'] +
|
|
||||||
" - " + str(e))
|
|
||||||
|
|
||||||
return apps
|
return apps
|
||||||
|
|
||||||
|
@ -866,6 +867,7 @@ class MetaDataException(Exception):
|
||||||
# TODO: These are currently just hard-coded in this method. It will be a
|
# TODO: These are currently just hard-coded in this method. It will be a
|
||||||
# metadata-driven system eventually, but not yet.
|
# metadata-driven system eventually, but not yet.
|
||||||
def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
||||||
|
|
||||||
name, ref = spec.split('@')
|
name, ref = spec.split('@')
|
||||||
|
|
||||||
if name == 'GreenDroid':
|
if name == 'GreenDroid':
|
||||||
|
@ -1015,8 +1017,6 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
||||||
vcs = getvcs('git',
|
vcs = getvcs('git',
|
||||||
'https://code.google.com/r/andreasschildbach-bitcoinj/', sdir, sdk_path)
|
'https://code.google.com/r/andreasschildbach-bitcoinj/', sdir, sdk_path)
|
||||||
vcs.gotorevision(ref)
|
vcs.gotorevision(ref)
|
||||||
if subprocess.call([mvn3, 'install'], cwd=sdir) != 0:
|
|
||||||
raise BuildException("Maven build failed for BitcoinJWallet srclib")
|
|
||||||
return sdir
|
return sdir
|
||||||
|
|
||||||
if name == 'Color-Picker':
|
if name == 'Color-Picker':
|
||||||
|
@ -1139,10 +1139,11 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
||||||
# 'sdk_path' - the path to the Android SDK
|
# 'sdk_path' - the path to the Android SDK
|
||||||
# 'ndk_path' - the path to the Android NDK
|
# 'ndk_path' - the path to the Android NDK
|
||||||
# 'javacc_path' - the path to javacc
|
# 'javacc_path' - the path to javacc
|
||||||
|
# 'mvn3' - the path to the maven 3 executable
|
||||||
# 'verbose' - optional: verbose or not (default=False)
|
# 'verbose' - optional: verbose or not (default=False)
|
||||||
# Returns the root directory, which may be the same as 'build_dir' or may
|
# Returns the root directory, which may be the same as 'build_dir' or may
|
||||||
# be a subdirectory of it.
|
# be a subdirectory of it.
|
||||||
def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, verbose=False):
|
def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, verbose=False):
|
||||||
|
|
||||||
# Optionally, the actual app source can be in a subdirectory...
|
# Optionally, the actual app source can be in a subdirectory...
|
||||||
if build.has_key('subdir'):
|
if build.has_key('subdir'):
|
||||||
|
@ -1169,6 +1170,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
|
||||||
init = build['init']
|
init = build['init']
|
||||||
init = init.replace('$$SDK$$', sdk_path)
|
init = init.replace('$$SDK$$', sdk_path)
|
||||||
init = init.replace('$$NDK$$', ndk_path)
|
init = init.replace('$$NDK$$', ndk_path)
|
||||||
|
init = init.replace('$$MVN$$', mvn3)
|
||||||
if verbose: print "Doing init: exec '%s' in '%s'"%(init,root_dir)
|
if verbose: print "Doing init: exec '%s' in '%s'"%(init,root_dir)
|
||||||
if subprocess.call(init, cwd=root_dir, shell=True) != 0:
|
if subprocess.call(init, cwd=root_dir, shell=True) != 0:
|
||||||
raise BuildException("Error running init command")
|
raise BuildException("Error running init command")
|
||||||
|
@ -1348,6 +1350,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
|
||||||
prebuild = prebuild.replace('$$' + name + '$$', libpath)
|
prebuild = prebuild.replace('$$' + name + '$$', libpath)
|
||||||
prebuild = prebuild.replace('$$SDK$$', sdk_path)
|
prebuild = prebuild.replace('$$SDK$$', sdk_path)
|
||||||
prebuild = prebuild.replace('$$NDK$$', ndk_path)
|
prebuild = prebuild.replace('$$NDK$$', ndk_path)
|
||||||
|
prebuild = prebuild.replace('$$MVN3$$', mvn3)
|
||||||
p = subprocess.Popen(prebuild, cwd=root_dir, shell=True,
|
p = subprocess.Popen(prebuild, cwd=root_dir, shell=True,
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
out, err = p.communicate()
|
out, err = p.communicate()
|
||||||
|
|
|
@ -35,8 +35,8 @@ def main():
|
||||||
|
|
||||||
# Read configuration...
|
# Read configuration...
|
||||||
global build_server_always, mvn3
|
global build_server_always, mvn3
|
||||||
build_server_always = False
|
globals()['build_server_always'] = False
|
||||||
mvn3 = "mvn3"
|
globals()['mvn3'] = "mvn3"
|
||||||
execfile('config.py', globals())
|
execfile('config.py', globals())
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ def main():
|
||||||
|
|
||||||
# Prepare the source code...
|
# Prepare the source code...
|
||||||
root_dir = common.prepare_source(vcs, app, thisbuild,
|
root_dir = common.prepare_source(vcs, app, thisbuild,
|
||||||
build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, options.verbose)
|
build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, options.verbose)
|
||||||
|
|
||||||
# Do the scan...
|
# Do the scan...
|
||||||
buildprobs = common.scan_source(build_dir, root_dir, thisbuild)
|
buildprobs = common.scan_source(build_dir, root_dir, thisbuild)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue