Skip to content

Commit

Permalink
Get --add-source working for dirs in Gradle builds (kivy#2156)
Browse files Browse the repository at this point in the history
* Switch to using Gradle srcDir props for extra source dirs.

* Add warning about only supporting source dir includes with gradle.

* Fixed typos in gradle source directory warning

Co-authored-by: Alexander Taylor <alexanderjohntaylor@gmail.com>
  • Loading branch information
2 people authored and brvier committed May 6, 2020
1 parent 2274cce commit cfc7a15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pythonforandroid/bootstraps/common/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ def make_package(args):
for spec in args.extra_source_dirs:
if ':' in spec:
specdir, specincludes = spec.split(':')
print('WARNING: Currently gradle builds only support including source '
'directories, so when building using gradle all files in '
'{} will be included.'.format(specdir))
else:
specdir = spec
specincludes = '**'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ android {
sourceSets {
main {
jniLibs.srcDir 'libs'
java {

{%- for adir, pattern in args.extra_source_dirs -%}
srcDir '{{adir}}'
{%- endfor -%}

}
}
}

Expand Down

0 comments on commit cfc7a15

Please sign in to comment.