Skip to content

Commit 7e2d7ca

Browse files
committed
Include jar files in build.gradle
1 parent 274affa commit 7e2d7ca

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,15 @@ def make_package(args):
261261
shutil.copy(args.presplash or default_presplash,
262262
'src/main/res/drawable/presplash.jpg')
263263

264+
jars = []
264265
# If extra Java jars were requested, copy them into the libs directory
265266
if args.add_jar:
266267
for jarname in args.add_jar:
267268
if not exists(jarname):
268269
print('Requested jar does not exist: {}'.format(jarname))
269270
sys.exit(-1)
270271
shutil.copy(jarname, 'src/main/libs')
271-
272+
jars.append(basename(jarname))
272273
# if extra aar were requested, copy them into the libs directory
273274
aars = []
274275
if args.add_aar:
@@ -379,6 +380,7 @@ def make_package(args):
379380
'build.gradle',
380381
args=args,
381382
aars=aars,
383+
jars=jars,
382384
android_api=android_api,
383385
build_tools_version=build_tools_version)
384386

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ dependencies {
6262
{%- for aar in aars %}
6363
compile(name: '{{ aar }}', ext: 'aar')
6464
{%- endfor -%}
65+
{%- for jar in jars %}
66+
compile files('src/main/libs/{{ jar }}')
67+
{%- endfor -%}
6568
{%- if args.depends -%}
6669
{%- for depend in args.depends %}
6770
compile '{{ depend }}'

0 commit comments

Comments
 (0)