Merge pull request #185 from kived/custom-source-dirs
allow custom source folders in buildozer.spec
This commit is contained in:
commit
6f842d01ce
3 changed files with 29 additions and 1 deletions
|
@ -35,6 +35,10 @@ version.filename = %(source.dir)s/main.py
|
|||
# comma seperated e.g. requirements = sqlite3,kivy
|
||||
requirements = kivy
|
||||
|
||||
# (str) Custom source folders for requirements
|
||||
# Sets custom source for any requirements with recipes
|
||||
# requirements.source.kivy = ../../kivy
|
||||
|
||||
# (list) Garden requirements
|
||||
#garden_requirements =
|
||||
|
||||
|
|
|
@ -464,6 +464,18 @@ class TargetAndroid(Target):
|
|||
if not exists(dist_dir):
|
||||
need_compile = 1
|
||||
|
||||
# len('requirements.source.') == 20, so use name[20:]
|
||||
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:
|
||||
need_compile = 1
|
||||
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 not need_compile:
|
||||
self.buildozer.info('Distribution already compiled, pass.')
|
||||
return
|
||||
|
|
|
@ -9,7 +9,7 @@ if sys.platform != 'darwin':
|
|||
import plistlib
|
||||
from buildozer import BuildozerCommandException
|
||||
from buildozer.target import Target, no_config
|
||||
from os.path import join, basename
|
||||
from os.path import join, basename, expanduser, realpath
|
||||
from getpass import getpass
|
||||
|
||||
PHP_TEMPLATE = '''
|
||||
|
@ -128,6 +128,18 @@ class TargetIos(Target):
|
|||
if last_requirements != ios_requirements:
|
||||
need_compile = 1
|
||||
|
||||
# len('requirements.source.') == 20, so use name[20:]
|
||||
source_dirs = {'{}_DIR'.format(name[20:].upper()):
|
||||
realpath(expanduser(value))
|
||||
for name, value in self.buildozer.config.items('app')
|
||||
if name.startswith('requirements.source.')}
|
||||
if source_dirs:
|
||||
need_compile = 1
|
||||
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 not need_compile:
|
||||
self.buildozer.info('Distribution already compiled, pass.')
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue