mirror of
https://github.com/kiwix/kiwix-build.git
synced 2025-09-27 06:52:13 -04:00
Gradle is a dependency of the android platform, not of other dependencies.
This commit is contained in:
parent
6de2cc80b6
commit
9b85791705
@ -18,7 +18,5 @@ class AllBaseDependencies(Dependency):
|
|||||||
if (platformInfo.build != 'android' and
|
if (platformInfo.build != 'android' and
|
||||||
neutralEnv('distname') != 'Darwin'):
|
neutralEnv('distname') != 'Darwin'):
|
||||||
base_deps += ['ctpp2c', 'ctpp2']
|
base_deps += ['ctpp2c', 'ctpp2']
|
||||||
if platformInfo.build == 'android':
|
|
||||||
base_deps += ['Gradle']
|
|
||||||
|
|
||||||
return base_deps
|
return base_deps
|
||||||
|
@ -6,7 +6,8 @@ from .base import (
|
|||||||
from kiwixbuild.utils import Remotefile, pj, copy_tree, add_execution_right
|
from kiwixbuild.utils import Remotefile, pj, copy_tree, add_execution_right
|
||||||
|
|
||||||
class Gradle(Dependency):
|
class Gradle(Dependency):
|
||||||
name = "Gradle"
|
neutral = True
|
||||||
|
name = "gradle"
|
||||||
|
|
||||||
class Source(ReleaseDownload):
|
class Source(ReleaseDownload):
|
||||||
archive = Remotefile('gradle-4.6-bin.zip',
|
archive = Remotefile('gradle-4.6-bin.zip',
|
||||||
@ -14,14 +15,18 @@ class Gradle(Dependency):
|
|||||||
'https://services.gradle.org/distributions/gradle-4.6-bin.zip')
|
'https://services.gradle.org/distributions/gradle-4.6-bin.zip')
|
||||||
|
|
||||||
class Builder(BaseBuilder):
|
class Builder(BaseBuilder):
|
||||||
|
@property
|
||||||
|
def install_path(self):
|
||||||
|
return self.buildEnv.install_dir
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
self.command('install', self._install)
|
self.command('install', self._install)
|
||||||
|
|
||||||
def _install(self, context):
|
def _install(self, context):
|
||||||
copy_tree(
|
copy_tree(
|
||||||
pj(self.source_path, "bin"),
|
pj(self.source_path, "bin"),
|
||||||
pj(self.buildEnv.install_dir, "bin"),
|
pj(self.install_path, "bin"),
|
||||||
post_copy_function = add_execution_right)
|
post_copy_function = add_execution_right)
|
||||||
copy_tree(
|
copy_tree(
|
||||||
pj(self.source_path, "lib"),
|
pj(self.source_path, "lib"),
|
||||||
pj(self.buildEnv.install_dir, "lib"))
|
pj(self.install_path, "lib"))
|
||||||
|
@ -16,7 +16,7 @@ class KiwixAndroid(Dependency):
|
|||||||
git_dir = "kiwix-android"
|
git_dir = "kiwix-android"
|
||||||
|
|
||||||
class Builder(GradleBuilder):
|
class Builder(GradleBuilder):
|
||||||
dependencies = ["Gradle", "kiwix-lib"]
|
dependencies = ["kiwix-lib"]
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
if option('targets') == 'kiwix-android-custom':
|
if option('targets') == 'kiwix-android-custom':
|
||||||
|
@ -117,7 +117,7 @@ class AndroidArm(AndroidPlatformInfo):
|
|||||||
|
|
||||||
class Android(MetaPlatformInfo):
|
class Android(MetaPlatformInfo):
|
||||||
name = "android"
|
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']
|
subPlatformNames = ['android_arm', 'android_arm64', 'android_mips', 'android_mips64', 'android_x86', 'android_x86_64']
|
||||||
compatible_hosts = ['fedora', 'debian']
|
compatible_hosts = ['fedora', 'debian']
|
||||||
|
|
||||||
@ -128,5 +128,10 @@ class Android(MetaPlatformInfo):
|
|||||||
def sdk_builder(self):
|
def sdk_builder(self):
|
||||||
return get_target_step('android-sdk', 'neutral')
|
return get_target_step('android-sdk', 'neutral')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def gradle_builder(self):
|
||||||
|
return get_target_step('gradle', 'neutral')
|
||||||
|
|
||||||
def set_env(self, env):
|
def set_env(self, env):
|
||||||
env['ANDROID_HOME'] = self.sdk_builder.install_path
|
env['ANDROID_HOME'] = self.sdk_builder.install_path
|
||||||
|
env['PATH'] = ':'.join([pj(self.gradle_builder.install_path, 'bin'), env['PATH']])
|
||||||
|
@ -23,7 +23,7 @@ base_deps_versions = {
|
|||||||
'libmicrohttpd' : '0.9.46',
|
'libmicrohttpd' : '0.9.46',
|
||||||
'gumbo' : '0.10.1',
|
'gumbo' : '0.10.1',
|
||||||
'icu4c' : '58.2',
|
'icu4c' : '58.2',
|
||||||
'Gradle' : '4.6',
|
'gradle' : '4.6',
|
||||||
'libaria2' : '1.33.1',
|
'libaria2' : '1.33.1',
|
||||||
'libmagic' : '5.33',
|
'libmagic' : '5.33',
|
||||||
'android-sdk' : 'r25.2.3',
|
'android-sdk' : 'r25.2.3',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user