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

Merge branch 'metadata_output_vars' into 'master'

metadata output-lines now substitute $$VERSION$$/etc.

Closes #263

See merge request !228
This commit is contained in:
Hans-Christoph Steiner 2017-03-17 11:37:18 +00:00
commit b6d8916881
3 changed files with 11 additions and 5 deletions

View File

@ -859,7 +859,8 @@ def build_local(app, build, vcs, build_dir, output_dir, srclib_dir, extlib_dir,
re.S | re.M).group(1) re.S | re.M).group(1)
src = os.path.join(bindir, src) src = os.path.join(bindir, src)
elif omethod == 'raw': elif omethod == 'raw':
globpath = os.path.join(root_dir, build.output) output_path = common.replace_build_vars(build.output, build)
globpath = os.path.join(root_dir, output_path)
apks = glob.glob(globpath) apks = glob.glob(globpath)
if len(apks) > 1: if len(apks) > 1:
raise BuildException('Multiple apks match %s' % globpath, '\n'.join(apks)) raise BuildException('Multiple apks match %s' % globpath, '\n'.join(apks))

View File

@ -1917,15 +1917,20 @@ def set_FDroidPopen_env(build=None):
env[n] = build.ndk_path() env[n] = build.ndk_path()
def replace_build_vars(cmd, build):
cmd = cmd.replace('$$COMMIT$$', build.commit)
cmd = cmd.replace('$$VERSION$$', build.versionName)
cmd = cmd.replace('$$VERCODE$$', build.versionCode)
return cmd
def replace_config_vars(cmd, build): def replace_config_vars(cmd, build):
cmd = cmd.replace('$$SDK$$', config['sdk_path']) cmd = cmd.replace('$$SDK$$', config['sdk_path'])
cmd = cmd.replace('$$NDK$$', build.ndk_path()) cmd = cmd.replace('$$NDK$$', build.ndk_path())
cmd = cmd.replace('$$MVN3$$', config['mvn3']) cmd = cmd.replace('$$MVN3$$', config['mvn3'])
cmd = cmd.replace('$$QT$$', config['qt_sdk_path'] or '') cmd = cmd.replace('$$QT$$', config['qt_sdk_path'] or '')
if build is not None: if build is not None:
cmd = cmd.replace('$$COMMIT$$', build.commit) cmd = replace_build_vars(cmd, build)
cmd = cmd.replace('$$VERSION$$', build.versionName)
cmd = cmd.replace('$$VERCODE$$', build.versionCode)
return cmd return cmd

View File

@ -33,7 +33,7 @@ Repo:https://gitlab.com/fdroid/privileged-extension.git
Build:0.2.1,2000 Build:0.2.1,2000
commit=0.2.1 commit=0.2.1
output=app/build/distributions/FDroidPrivilegedExtensionFromBinaries-0.2.1.zip output=app/build/distributions/FDroidPrivilegedExtensionFromBinaries-$$VERSION$$.zip
build=gradle assembleUpdateZipFromBinariesDebug build=gradle assembleUpdateZipFromBinariesDebug
Auto Update Mode:Version %v Auto Update Mode:Version %v