Skip to content

Commit 9ac6ad2

Browse files
committed
java compat levels
1 parent 7547632 commit 9ac6ad2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,16 @@ def parse_args(args=None):
672672
ap.add_argument('--android-apptheme', dest='android_apptheme',
673673
default='@android:style/Theme.NoTitleBar',
674674
help='defines which app theme should be selected for the main activity')
675+
ap.add_argument('--add-java-source-compat', dest='java_source_compat',
676+
default=[],
677+
action='append',
678+
help='add java source compatibility to gradle.build')
679+
ap.add_argument('--add-java-target-compat', dest='java_target_compat',
680+
default=[],
681+
action='append',
682+
help='add java target compatibility to gradle.build')
683+
684+
675685
ap.add_argument('--wakelock', dest='wakelock', action='store_true',
676686
help=('Indicate if the application needs the device '
677687
'to stay on'))

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ android {
5555
compileOptions {
5656
sourceCompatibility JavaVersion.VERSION_1_7
5757
targetCompatibility JavaVersion.VERSION_1_7
58+
{% for compat in args.java_source_compat -%}
59+
sourceCompatibility {{compat}}
60+
{%- endfor %}
61+
{% for compat in args.java_target_compat -%}
62+
targetCompatibility {{compat}}
63+
{%- endfor %}
5864
}
5965

6066
sourceSets {

0 commit comments

Comments
 (0)