Merge pull request #828 from player-03/output-apk

Make Gradle use the right APK filename.
This commit is contained in:
Joshua Granick
2016-10-17 12:43:58 -07:00
committed by GitHub
2 changed files with 14 additions and 7 deletions

View File

@@ -179,20 +179,17 @@ class AndroidPlatform extends PlatformTarget {
public override function install ():Void {
var build = "debug";
var build = "-debug";
if (project.certificate != null) {
build = "release";
build = "-release";
}
var apkPath = FileSystem.fullPath (targetDirectory) + "/bin/app/build/outputs/apk/";
var apkSuffix = "-" + build + ".apk";
var apkPath = FileSystem.fullPath (targetDirectory) + "/bin/app/build/outputs/apk/" + project.app.file + build + ".apk";
File.copy (apkPath + "app" + apkSuffix, apkPath + project.app.file + apkSuffix);
deviceID = AndroidHelper.install (project, apkPath + project.app.file + apkSuffix, deviceID);
deviceID = AndroidHelper.install (project, apkPath, deviceID);
}

View File

@@ -48,6 +48,16 @@ android {
signingConfig signingConfigs.release
}
}
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
output.outputFile = new File(outputFile.parent, "::APP_FILE::-" + variant.buildType.name + ".apk")
}
}
}
}
dependencies {