diff --git a/kiwixbuild/dependencies/all_dependencies.py b/kiwixbuild/dependencies/all_dependencies.py index 3d55d29..096504b 100644 --- a/kiwixbuild/dependencies/all_dependencies.py +++ b/kiwixbuild/dependencies/all_dependencies.py @@ -18,7 +18,5 @@ class AllBaseDependencies(Dependency): if (platformInfo.build != 'android' and neutralEnv('distname') != 'Darwin'): base_deps += ['ctpp2c', 'ctpp2'] - if platformInfo.build == 'android': - base_deps += ['Gradle'] return base_deps diff --git a/kiwixbuild/dependencies/gradle.py b/kiwixbuild/dependencies/gradle.py index 42ed104..e62c464 100644 --- a/kiwixbuild/dependencies/gradle.py +++ b/kiwixbuild/dependencies/gradle.py @@ -6,7 +6,8 @@ from .base import ( from kiwixbuild.utils import Remotefile, pj, copy_tree, add_execution_right class Gradle(Dependency): - name = "Gradle" + neutral = True + name = "gradle" class Source(ReleaseDownload): archive = Remotefile('gradle-4.6-bin.zip', @@ -14,14 +15,18 @@ class Gradle(Dependency): 'https://services.gradle.org/distributions/gradle-4.6-bin.zip') class Builder(BaseBuilder): + @property + def install_path(self): + return self.buildEnv.install_dir + def build(self): self.command('install', self._install) def _install(self, context): copy_tree( pj(self.source_path, "bin"), - pj(self.buildEnv.install_dir, "bin"), + pj(self.install_path, "bin"), post_copy_function = add_execution_right) copy_tree( pj(self.source_path, "lib"), - pj(self.buildEnv.install_dir, "lib")) + pj(self.install_path, "lib")) diff --git a/kiwixbuild/dependencies/kiwix_android.py b/kiwixbuild/dependencies/kiwix_android.py index fa19b09..54a03a1 100644 --- a/kiwixbuild/dependencies/kiwix_android.py +++ b/kiwixbuild/dependencies/kiwix_android.py @@ -16,7 +16,7 @@ class KiwixAndroid(Dependency): git_dir = "kiwix-android" class Builder(GradleBuilder): - dependencies = ["Gradle", "kiwix-lib"] + dependencies = ["kiwix-lib"] def build(self): if option('targets') == 'kiwix-android-custom': diff --git a/kiwixbuild/platforms/android.py b/kiwixbuild/platforms/android.py index 4c7be67..b0d650b 100644 --- a/kiwixbuild/platforms/android.py +++ b/kiwixbuild/platforms/android.py @@ -117,7 +117,7 @@ class AndroidArm(AndroidPlatformInfo): class Android(MetaPlatformInfo): name = "android" - toolchain_names = ['android-sdk'] + toolchain_names = ['android-sdk', 'gradle'] subPlatformNames = ['android_arm', 'android_arm64', 'android_mips', 'android_mips64', 'android_x86', 'android_x86_64'] compatible_hosts = ['fedora', 'debian'] @@ -128,5 +128,10 @@ class Android(MetaPlatformInfo): def sdk_builder(self): return get_target_step('android-sdk', 'neutral') + @property + def gradle_builder(self): + return get_target_step('gradle', 'neutral') + def set_env(self, env): env['ANDROID_HOME'] = self.sdk_builder.install_path + env['PATH'] = ':'.join([pj(self.gradle_builder.install_path, 'bin'), env['PATH']]) diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index f822d96..4f9fddd 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -23,7 +23,7 @@ base_deps_versions = { 'libmicrohttpd' : '0.9.46', 'gumbo' : '0.10.1', 'icu4c' : '58.2', - 'Gradle' : '4.6', + 'gradle' : '4.6', 'libaria2' : '1.33.1', 'libmagic' : '5.33', 'android-sdk' : 'r25.2.3',