Skip to content

Commit 36825d7

Browse files
kollivierinclement
andauthored
Get --add-source working for dirs in Gradle builds (kivy#2156)
* 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>
1 parent 83dc122 commit 36825d7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ def make_package(args):
380380
for spec in args.extra_source_dirs:
381381
if ':' in spec:
382382
specdir, specincludes = spec.split(':')
383+
print('WARNING: Currently gradle builds only support including source '
384+
'directories, so when building using gradle all files in '
385+
'{} will be included.'.format(specdir))
383386
else:
384387
specdir = spec
385388
specincludes = '**'

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ android {
8585
sourceSets {
8686
main {
8787
jniLibs.srcDir 'libs'
88+
java {
89+
90+
{%- for adir, pattern in args.extra_source_dirs -%}
91+
srcDir '{{adir}}'
92+
{%- endfor -%}
93+
94+
}
8895
}
8996
}
9097

0 commit comments

Comments
 (0)