Skip to content

Include jar files in build.gradle #1211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pythonforandroid/bootstraps/sdl2/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,15 @@ def make_package(args):
shutil.copy(args.presplash or default_presplash,
'src/main/res/drawable/presplash.jpg')

jars = []
# If extra Java jars were requested, copy them into the libs directory
if args.add_jar:
for jarname in args.add_jar:
if not exists(jarname):
print('Requested jar does not exist: {}'.format(jarname))
sys.exit(-1)
shutil.copy(jarname, 'src/main/libs')

jars.append(basename(jarname))
# if extra aar were requested, copy them into the libs directory
aars = []
if args.add_aar:
Expand Down Expand Up @@ -379,6 +380,7 @@ def make_package(args):
'build.gradle',
args=args,
aars=aars,
jars=jars,
android_api=android_api,
build_tools_version=build_tools_version)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ dependencies {
{%- for aar in aars %}
compile(name: '{{ aar }}', ext: 'aar')
{%- endfor -%}
{%- for jar in jars %}
compile files('src/main/libs/{{ jar }}')
{%- endfor -%}
{%- if args.depends -%}
{%- for depend in args.depends %}
compile '{{ depend }}'
Expand Down