Skip to content

Commit

Permalink
Merge pull request #324 from kived/android_new-source-dirs
Browse files Browse the repository at this point in the history
use custom source dirs for android_new
  • Loading branch information
kived committed Apr 22, 2016
2 parents fed0650 + 0740cef commit 680b2dc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion buildozer/targets/android_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''

from buildozer.targets.android import TargetAndroid
from os.path import join, expanduser
from os.path import join, expanduser, realpath


class TargetAndroidNew(TargetAndroid):
Expand All @@ -29,6 +29,18 @@ def compile_platform(self):
dist_name = self.buildozer.config.get('app', 'package.name')
requirements = ','.join(android_requirements)
options = []

source_dirs = {
'P4A_{}_DIR'.format(name[20:]): realpath(expanduser(value))
for name, value in self.buildozer.config.items('app')
if name.startswith('requirements.source.')
}
if source_dirs:
self.buildozer.environ.update(source_dirs)
self.buildozer.info('Using custom source dirs:\n {}'.format(
'\n '.join(['{} = {}'.format(k, v)
for k, v in source_dirs.items()])))

if self.buildozer.config.getbooldefault('app', 'android.copy_libs', True):
options.append("--copy-libs")
available_modules = self.buildozer.cmd(
Expand Down

0 comments on commit 680b2dc

Please sign in to comment.