Merge pull request #85 from inclement/p4a_dir_fixes

Documented env var checking and fixed a bug in the p4a_dir check
This commit is contained in:
Alexander Taylor 2014-03-15 14:41:52 +00:00
commit 87d1462b9a
2 changed files with 18 additions and 1 deletions

View file

@ -87,3 +87,20 @@ buildozer.spec
See `buildozer/default.spec <https://raw.github.com/kivy/buildozer/master/buildozer/default.spec>`_ for an up-to-date spec file.
Default config
--------------
You can override the value of *any* buildozer.spec config token by
setting an appropriate environment variable. These are all of the
form ``$SECTION_TOKEN``, where SECTION is the config file section and
TOKEN is the config token to override. Dots are replaced by
underscores.
For example, here are some config tokens from the [app] section of the
config, along with the environment variables that would override them.
- ``title`` -> ``$APP_TITLE``
- ``package.name`` -> ``$APP_PACKAGE_NAME``
- ``android.p4a_dir`` -> ``$APP_ANDROID_P4A_DIR``

View file

@ -301,7 +301,7 @@ class TargetAndroid(Target):
cmd = self.buildozer.cmd
self.pa_dir = pa_dir = join(self.buildozer.platform_dir, 'python-for-android')
if not self.buildozer.file_exists(pa_dir):
system_p4a_dir = self.buildozer.config.getdefault('app', 'p4a_dir')
system_p4a_dir = self.buildozer.config.getdefault('app', 'android.p4a_dir')
if system_p4a_dir:
cmd('ln -s {} ./python-for-android'.format(system_p4a_dir),
cwd = self.buildozer.platform_dir)