Skip to content

Commit b26f311

Browse files
committed
packaging options
1 parent fe1cb05 commit b26f311

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,10 @@ def parse_args(args=None):
684684
default=[],
685685
action='append',
686686
help='add a repository for gradle')
687+
ap.add_argument('--add-packaging-option', dest='packaging_options',
688+
default=[],
689+
action='append',
690+
help='android packaging options')
687691

688692
ap.add_argument('--wakelock', dest='wakelock', action='store_true',
689693
help=('Indicate if the application needs the device '

pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ allprojects {
1313
repositories {
1414
google()
1515
jcenter()
16-
{% for repo in args.gradle_repositories -%}
16+
{%- for repo in args.gradle_repositories %}
1717
{{repo}}
1818
{%- endfor %}
1919
flatDir {
@@ -45,6 +45,14 @@ android {
4545
}
4646
{%- endif %}
4747

48+
{% if args.packaging_options -%}
49+
packagingOptions {
50+
{%- for option in args.packaging_options %}
51+
{{option}}
52+
{%- endfor %}
53+
}
54+
{%- endif %}
55+
4856
buildTypes {
4957
debug {
5058
}
@@ -58,10 +66,10 @@ android {
5866
compileOptions {
5967
sourceCompatibility JavaVersion.VERSION_1_7
6068
targetCompatibility JavaVersion.VERSION_1_7
61-
{% for compat in args.java_source_compat -%}
69+
{%- for compat in args.java_source_compat %}
6270
sourceCompatibility {{compat}}
6371
{%- endfor %}
64-
{% for compat in args.java_target_compat -%}
72+
{%- for compat in args.java_target_compat %}
6573
targetCompatibility {{compat}}
6674
{%- endfor %}
6775
}

0 commit comments

Comments
 (0)