@@ -23,9 +23,14 @@ def build(app, title, release):
2323 os .system ('cordova plugin add cordova-plugin-screen-orientation' )
2424
2525 if release :
26- build = 'cordova build android --release -- '
27- # TODO: pass release parameters
28- # os.system(build + '--keystore={{androidBuild.keystore}} --storePassword={{androidBuild.storePassword}} --alias={{androidBuild.alias}} --password={{androidBuild.password}}')
26+ {% if androidBuild % }
27+ pt = '--packageType={{androidBuild.packageType}} ' if "{{ androidBuild.packageType }}" else ''
28+ build_cmd = 'cordova build android --release -- %s' % pt
29+ build_cert_params = '--keystore={{androidBuild.keystore}} --storePassword={{androidBuild.storePassword}} --alias={{androidBuild.alias}} --password={{androidBuild.password}}'
30+ os .system (build_cmd + build_cert_params )
31+ {% else % }
32+ print ("Failed to build release apk androidBuild property is undefined" )
33+ {% endif % }
2934 else :
3035 os .system ('cordova build android' )
3136
@@ -35,7 +40,7 @@ def build(app, title, release):
3540parser = argparse .ArgumentParser ('pureqml cordova android build tool' )
3641parser .add_argument ('--app' , '-a' , help = 'application name' , default = "app" )
3742parser .add_argument ('--title' , '-t' , help = 'application title' , default = "App" )
38- parser .add_argument ('--release' , '-r' , help = 'build release apk ' , default = False )
43+ parser .add_argument ('--release' , '-r' , help = 'generate release code (no logs) ' , action = 'store_true' , dest = 'release' )
3944args = parser .parse_args ()
4045
4146
0 commit comments