Skip to content

Commit a09c41f

Browse files
authored
Merge pull request #256 from komsikov/master
add aab build
2 parents 1a80b1e + 147c786 commit a09c41f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

platform/android/build.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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):
3540
parser = argparse.ArgumentParser('pureqml cordova android build tool')
3641
parser.add_argument('--app', '-a', help='application name', default="app")
3742
parser.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')
3944
args = parser.parse_args()
4045

4146

0 commit comments

Comments
 (0)