fix apk path building
This commit is contained in:
+17
-11
@@ -52,22 +52,25 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
dev {
|
base {
|
||||||
initWith release
|
|
||||||
buildConfigField 'String', 'APPCENTER_KEY', '""'
|
buildConfigField 'String', 'APPCENTER_KEY', '""'
|
||||||
}
|
}
|
||||||
beta {
|
debug {
|
||||||
initWith release
|
initWith base
|
||||||
buildConfigField 'String', 'APPCENTER_KEY', '""'
|
minifyEnabled false
|
||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
buildConfigField 'String', 'APPCENTER_KEY', '""'
|
initWith base
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFile 'proguard-rules.pro'
|
proguardFile 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
debug {
|
dev {
|
||||||
buildConfigField 'String', 'APPCENTER_KEY', '""'
|
initWith debug
|
||||||
minifyEnabled false
|
//etc
|
||||||
|
}
|
||||||
|
beta {
|
||||||
|
initWith release
|
||||||
|
//etc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,13 +101,16 @@ task generateBuildTasks() {
|
|||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
def buildType = output.name.toString().capitalize()
|
def buildType = output.name.toString().capitalize()
|
||||||
|
if(buildType=="Base")return
|
||||||
task "exportDex$buildType"() {
|
task "exportDex$buildType"() {
|
||||||
dependsOn('assemble' + buildType)
|
dependsOn('assemble' + buildType)
|
||||||
doLast {
|
doLast {
|
||||||
try {
|
try {
|
||||||
def suffix=buildType.toLowerCase()
|
def suffix=buildType.toLowerCase()
|
||||||
def zip=new ZipFile(new File(projectDir,"/build/outputs/apk/$suffix/app-$suffix${suffix!="debug"?"-unsigned.apk":".apk"}"))
|
String apkPath=projectDir.getAbsolutePath()+"/build/outputs/apk/$suffix/app-$suffix"
|
||||||
|
def apk=new File(apkPath+"-unsigned.apk")
|
||||||
|
if(!apk.exists())apk=new File(apkPath+".apk")
|
||||||
|
def zip=new ZipFile(apk)
|
||||||
def entries=zip.entries()
|
def entries=zip.entries()
|
||||||
def dexCounter=dexes
|
def dexCounter=dexes
|
||||||
while(entries.hasMoreElements())
|
while(entries.hasMoreElements())
|
||||||
|
|||||||
Reference in New Issue
Block a user