File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
pythonforandroid/bootstraps/common/build Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ options (this list may not be exhaustive):
92
92
run. See :ref: `arbitrary_scripts_services `.
93
93
- ``--add-source ``: Add a source directory to the app's Java code.
94
94
- ``--no-compile-pyo ``: Do not optimise .py files to .pyo.
95
+ - ``--enable-androidx ``: Enable AndroidX support library.
95
96
96
97
97
98
webview
Original file line number Diff line number Diff line change @@ -343,6 +343,9 @@ def make_package(args):
343
343
join (res_dir , 'drawable/icon.png' )
344
344
)
345
345
346
+ if args .enable_androidx :
347
+ shutil .copy ('templates/gradle.properties' , 'gradle.properties' )
348
+
346
349
if get_bootstrap_name () != "service_only" :
347
350
lottie_splashscreen = join (res_dir , 'raw/splashscreen.json' )
348
351
if args .presplash_lottie :
@@ -706,6 +709,10 @@ def parse_args_and_make_package(args=None):
706
709
'topics/manifest/'
707
710
'activity-element.html' ))
708
711
712
+ ap .add_argument ('--enable-androidx' , dest = 'enable_androidx' ,
713
+ action = 'store_true' ,
714
+ help = ('Enable the AndroidX support library, '
715
+ 'requires api = 28 or greater' ))
709
716
ap .add_argument ('--android-entrypoint' , dest = 'android_entrypoint' ,
710
717
default = DEFAULT_PYTHON_ACTIVITY_JAVA_CLASS ,
711
718
help = 'Defines which java class will be used for startup, usually a subclass of PythonActivity' )
Original file line number Diff line number Diff line change @@ -76,8 +76,13 @@ android {
76
76
}
77
77
78
78
compileOptions {
79
+ {% if args. enable_androidx % }
80
+ sourceCompatibility JavaVersion . VERSION_1_8
81
+ targetCompatibility JavaVersion . VERSION_1_8
82
+ {% else % }
79
83
sourceCompatibility JavaVersion . VERSION_1_7
80
84
targetCompatibility JavaVersion . VERSION_1_7
85
+ {% endif % }
81
86
{%- for option in args. compile_options % }
82
87
{{option}}
83
88
{%- endfor % }
Original file line number Diff line number Diff line change
1
+ android.useAndroidX =true
2
+ android.enableJetifier =true
You can’t perform that action at this time.
0 commit comments