flatDir support [Android]

This commit is contained in:
Ramesh Ravone 2017-10-07 15:10:17 +05:30
parent bd10a00240
commit a4cee286e6
No known key found for this signature in database
GPG Key ID: 90B471D9AC10312A
3 changed files with 16 additions and 0 deletions

View File

@ -72,6 +72,7 @@ env_base.AppendENVPath('PATH', os.getenv('PATH'))
env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH'))
env_base.global_defaults = global_defaults
env_base.android_maven_repos = []
env_base.android_flat_dirs = []
env_base.android_dependencies = []
env_base.android_gradle_plugins = []
env_base.android_gradle_classpath = []
@ -96,6 +97,7 @@ env_base.SetOption('implicit_cache', 1)
env_base.__class__.android_add_maven_repository = methods.android_add_maven_repository
env_base.__class__.android_add_flat_dir = methods.android_add_flat_dir
env_base.__class__.android_add_dependency = methods.android_add_dependency
env_base.__class__.android_add_java_dir = methods.android_add_java_dir
env_base.__class__.android_add_res_dir = methods.android_add_res_dir

View File

@ -1360,6 +1360,10 @@ def win32_spawn(sh, escape, cmd, args, spawnenv):
return exit_code
"""
def android_add_flat_dir(self, dir):
if (dir not in self.android_flat_dirs):
self.android_flat_dirs.append(dir)
def android_add_maven_repository(self, url):
if (url not in self.android_maven_repos):
self.android_maven_repos.append(url)

View File

@ -46,8 +46,18 @@ gradle_baseout = open_utf8(abspath + "/java/build.gradle", "w")
gradle_text = gradle_basein.read()
gradle_maven_flat_text = ""
if len(env.android_flat_dirs) > 0:
gradle_maven_flat_text += "flatDir {\n"
gradle_maven_flat_text += "\tdirs "
for x in env.android_flat_dirs:
gradle_maven_flat_text += "'" + x + "',"
gradle_maven_flat_text = gradle_maven_flat_text[:-1]
gradle_maven_flat_text += "\n\t}\n"
gradle_maven_repos_text = ""
gradle_maven_repos_text += gradle_maven_flat_text
if len(env.android_maven_repos) > 0:
gradle_maven_repos_text += ""