Skip to content

Commit

Permalink
Fixed custom namespace for apks
Browse files Browse the repository at this point in the history
  • Loading branch information
jmatsu committed Sep 26, 2018
1 parent 211668f commit 78965e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example-for-dev/app/build.gradle
Expand Up @@ -43,7 +43,7 @@ deploygate {
apks {
custom {
noAssemble = true
sourceFile = file("${project.projectDir}/app/build/outputs/apk/debug/app-debug.apk")
sourceFile = file("${project.projectDir}/build/outputs/apk/p1//debug/app-p1-debug.apk")
}
}
}
12 changes: 9 additions & 3 deletions src/main/groovy/com/deploygate/gradle/plugins/DeployGate.groovy
Expand Up @@ -37,9 +37,16 @@ class DeployGate implements Plugin<Project> {

private static Set<String> setupExtension(Project project) {
NamedDomainObjectContainer<DeployTarget> targets = project.container(DeployTarget)

def declaredVariantNames = new HashSet<>()

targets.all {
declaredVariantNames.add(name)
}

project.extensions.add('deploygate', new DeployGateExtension(targets))

return targets.collect { it.name }.toSet()
return declaredVariantNames
}

def createDeployGateTasks(Project project, Set<String> declaredVariantNames) {
Expand All @@ -48,7 +55,7 @@ class DeployGate implements Plugin<Project> {

createMultipleUploadApkTask(project, declaredVariantNames)

def names = new HashSet(declaredVariantNames)
def names = new HashSet<String>(declaredVariantNames)

// @see ApplicationVariantFactory#createVariantData
// variant is for applicationFlavors
Expand All @@ -65,7 +72,6 @@ class DeployGate implements Plugin<Project> {
}

names.collect { ApkInfoCompat.blank(it) }.each { apkInfo ->

createUploadApkTask(project, apkInfo)
}
}
Expand Down

0 comments on commit 78965e6

Please sign in to comment.