diff --git a/common.py b/common.py index b020df0a..8fb0f2cd 100644 --- a/common.py +++ b/common.py @@ -736,7 +736,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j f.write(props) f.close() - # Insert version code and number into the manifest if necessary... + # deprecated, use forceversion/forcevercode instead if build.has_key('insertversion'): if subprocess.call(['sed','-i','s/' + build['insertversion'] + '/' + build['version'] +'/g', @@ -748,6 +748,18 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j 'AndroidManifest.xml'], cwd=root_dir) !=0: raise BuildException("Failed to amend manifest") + # Insert version code and number into the manifest if necessary... + if build.has_key('forceversion'): + if subprocess.call(['sed','-r','-i', + 's/android:versionName="[^"]+"/android:versionName="' + build['version'] + '"/g', + 'AndroidManifest.xml'], cwd=root_dir) !=0: + raise BuildException("Failed to amend manifest") + if build.has_key('forcevercode'): + if subprocess.call(['sed','-r','-i', + 's/android:versionCode="[^"]+"/android:versionCode="' + build['vercode'] + '"/g', + 'AndroidManifest.xml'], cwd=root_dir) !=0: + raise BuildException("Failed to amend manifest") + # Delete unwanted file... if build.has_key('rm'): dest = os.path.join(build_dir, build['rm'])