From 39c2e67b807926f1f8403d9f6f99d35b81915f93 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Tue, 2 May 2017 14:26:45 +0200 Subject: [PATCH] Make GradleBuilder configurable. A dependency (future kiwix-android-custom app) may want to use the gradle builder for something else than `build` with the default options. --- dependency_utils.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dependency_utils.py b/dependency_utils.py index 9e024ca..b26cd35 100644 --- a/dependency_utils.py +++ b/dependency_utils.py @@ -308,12 +308,14 @@ class MesonBuilder(Builder): class GradleBuilder(Builder): + gradle_target = "build" + gradle_option = "-i" + def build(self): self.command('configure', self._configure) if hasattr(self, '_pre_compile_script'): self.command('pre_compile_script', self._pre_compile_script) self.command('compile', self._compile) - self.command('install', self._install) def _configure(self, context): # We don't have a lot to configure by itself @@ -323,10 +325,8 @@ class GradleBuilder(Builder): shutil.copytree(self.source_path, self.build_path) def _compile(self, context): - command = "gradle clean assemble --info" + command = "gradle {gradle_target} {gradle_option}" + command = command.format( + gradle_target=self.gradle_target, + gradle_option=self.gradle_option) self.buildEnv.run_command(command, self.build_path, context) - command = "gradle build --info" - self.buildEnv.run_command(command, self.build_path, context) - - def _install(self, context): - pass