diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py index 8eb1a6fe0e..fc8c8b43ce 100644 --- a/pythonforandroid/bootstraps/common/build/build.py +++ b/pythonforandroid/bootstraps/common/build/build.py @@ -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 = '**' diff --git a/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle b/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle index 7b6ba8390b..2b0c540f06 100644 --- a/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle +++ b/pythonforandroid/bootstraps/common/build/templates/build.tmpl.gradle @@ -85,6 +85,13 @@ android { sourceSets { main { jniLibs.srcDir 'libs' + java { + + {%- for adir, pattern in args.extra_source_dirs -%} + srcDir '{{adir}}' + {%- endfor -%} + + } } }