From 81612c2f2cdf754202305c35268ee1d710a1b1e6 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 20 Aug 2018 11:16:33 +0200 Subject: [PATCH 1/2] Set the default option in the method parsing arguments, not in the builder. --- kiwixbuild/__init__.py | 6 ++++++ kiwixbuild/builder.py | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/kiwixbuild/__init__.py b/kiwixbuild/__init__.py index 41855f9..718d3f9 100644 --- a/kiwixbuild/__init__.py +++ b/kiwixbuild/__init__.py @@ -72,6 +72,12 @@ def parse_args(): if not options.ios_arch: options.ios_arch = ['armv7', 'arm64', 'i386', 'x86_64'] + if not options.target_platform: + if options.target == 'kiwix-android': + options.target_platform = 'android' + else: + options.target_platform = 'native_dyn' + return options def main(): diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index d58301a..e8442f8 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -18,11 +18,6 @@ class Builder: PlatformInfo.get_platform('neutral', self._targets) target_platform = option('target_platform') - if not target_platform: - if option('target') == 'kiwix-android': - target_platform = 'android' - else: - target_platform = 'native_dyn' platform = PlatformInfo.get_platform(target_platform, self._targets) if neutralEnv('distname') not in platform.compatible_hosts: print(('ERROR: The target platform {} cannot be build on host {}.\n' From 6f291b1c86441b3f33a05cf153f67a53f4557471 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 20 Aug 2018 11:18:01 +0200 Subject: [PATCH 2/2] Set the default platform to `android` for `kiwix-android-custom` project. Fix #206 --- kiwixbuild/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiwixbuild/__init__.py b/kiwixbuild/__init__.py index 718d3f9..a9815db 100644 --- a/kiwixbuild/__init__.py +++ b/kiwixbuild/__init__.py @@ -73,7 +73,7 @@ def parse_args(): options.ios_arch = ['armv7', 'arm64', 'i386', 'x86_64'] if not options.target_platform: - if options.target == 'kiwix-android': + if options.target in ('kiwix-android', 'kiwix-android-custom'): options.target_platform = 'android' else: options.target_platform = 'native_dyn'