Skip to content

Commit 275d236

Browse files
authored
Merge pull request #1211 from bauerj/add-jar
Include jar files in build.gradle
2 parents 84bbbc7 + 7e2d7ca commit 275d236

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:
@@ -381,6 +382,7 @@ def make_package(args):
381382
'build.gradle',
382383
args=args,
383384
aars=aars,
385+
jars=jars,
384386
android_api=android_api,
385387
build_tools_version=build_tools_version)
386388

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ dependencies {
6767
{%- for aar in aars %}
6868
compile(name: '{{ aar }}', ext: 'aar')
6969
{%- endfor -%}
70+
{%- for jar in jars %}
71+
compile files('src/main/libs/{{ jar }}')
72+
{%- endfor -%}
7073
{%- if args.depends -%}
7174
{%- for depend in args.depends %}
7275
compile '{{ depend }}'

0 commit comments

Comments
 (0)