Add support for Gradle build directory (resolve #802)

This commit is contained in:
Joshua Granick
2017-06-05 15:34:20 -07:00
parent e524c8c0ba
commit d736579bfe
2 changed files with 21 additions and 2 deletions

View File

@@ -191,7 +191,19 @@ class AndroidPlatform extends PlatformTarget {
}
var apkPath = FileSystem.fullPath (targetDirectory) + "/bin/app/build/outputs/apk/" + project.app.file + build + ".apk";
var outputDirectory = null;
if (project.config.exists ("android.gradle-build-directory")) {
outputDirectory = PathHelper.combine (project.config.getString ("android.gradle-build-directory"), project.app.file + "/app/outputs/apk");
} else {
outputDirectory = PathHelper.combine (FileSystem.fullPath (targetDirectory), "bin/app/build/outputs/apk");
}
var apkPath = PathHelper.combine (outputDirectory, project.app.file + build + ".apk");
deviceID = AndroidHelper.install (project, apkPath, deviceID);
@@ -315,6 +327,12 @@ class AndroidPlatform extends PlatformTarget {
context.ANDROID_GRADLE_PLUGIN = project.config.getString ("android.gradle-plugin", "2.1.0");
context.ANDROID_LIBRARY_PROJECTS = [];
if (project.config.exists ("android.gradle-build-directory")) {
context.ANDROID_GRADLE_BUILD_DIRECTORY = project.config.getString ("android.gradle-build-directory");
}
if (!project.environment.exists ("ANDROID_SDK") || !project.environment.exists ("ANDROID_NDK_ROOT")) {
var command = "lime";

View File

@@ -19,7 +19,8 @@ allprojects {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}::if ANDROID_GRADLE_BUILD_DIRECTORY::
buildDir = "::ANDROID_GRADLE_BUILD_DIRECTORY::/::APP_FILE::/${project.name}"::end::
}
task clean(type: Delete) {