Skip to content

Commit

Permalink
Merge pull request #94 from DeployGate/add_as_36
Browse files Browse the repository at this point in the history
Support AndroidStudio rc01
  • Loading branch information
jmatsu authored Dec 23, 2019
2 parents 890ce12 + 07cbd61 commit 278e01c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repositories {

ext {
agpVersion = '3.3.2'
unstableAgpVersion = '3.6.0-beta01'
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PackageAppTaskCompat {
static ApkInfo getApkInfo(@Nonnull /* PackageApplication */ packageAppTask, @Nonnull String variantName) {
// outputScope is retrieved by the reflection
Collection<String> apkNames = packageAppTask.outputScope.apkDatas*.outputFileName
File outputDir = packageAppTask.outputDirectory
File outputDir = getOutputDirectory(packageAppTask)
boolean isUniversal = apkNames.size() == 1
boolean isSigningReady = hasSigningConfig(packageAppTask)

Expand Down Expand Up @@ -51,8 +51,18 @@ class PackageAppTaskCompat {
static boolean hasSigningConfig(packageAppTask) {
if (!AndroidGradlePlugin.isSigningConfigCollectionSupported()) {
return packageAppTask.signingConfig != null
} else {
} else if (!AndroidGradlePlugin.isSigningConfigProviderSupported()) {
return packageAppTask.signingConfig != null && !packageAppTask.signingConfig.isEmpty()
} else {
return packageAppTask.signingConfig != null && !packageAppTask.signingConfig.signingConfigFileCollection // no need to check `empty` for now
}
}

static File getOutputDirectory(packageAppTask) {
if (!AndroidGradlePlugin.isOutputDirectoryProviderSupported()) {
return packageAppTask.outputDirectory
} else {
return packageAppTask.outputDirectory.getAsFile().get()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,29 @@ class AndroidGradlePlugin {
}

static boolean isAppBundleSupported() {
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor > 1
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 2
}

static boolean isSigningConfigCollectionSupported() {
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor > 2
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 3
}

static boolean isTaskProviderBased() {
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor > 2
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 3
}

static boolean isAppBundleArchiveNameChanged() {
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 5
}

static boolean isSigningConfigProviderSupported() {
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 6
}

static boolean isOutputDirectoryProviderSupported() {
return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 6
}

@Nonnull
static String androidAssembleTaskName(@Nonnull String variantName) {
return "assemble${variantName.capitalize()}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class AcceptanceKtsTestSpec extends AcceptanceTestBaseSpec {
return [
new AGPEnv("3.3.2", "4.10.1"),
new AGPEnv("3.4.0", "5.1.1"),
new AGPEnv("3.5.0", "5.4.1"),
new AGPEnv("3.5.1", "5.4.1"),
new AGPEnv("3.6.0-rc01", "5.6.4"),
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class AcceptanceTestSpec extends AcceptanceTestBaseSpec {
new AGPEnv("3.2.0", "4.6"),
new AGPEnv("3.3.2", "4.10.1"),
new AGPEnv("3.4.1", "5.1.1"),
new AGPEnv("3.5.0", "5.4.1"),
new AGPEnv("3.5.1", "5.4.1"),
new AGPEnv("3.6.0-rc01", "5.6.4"),
]
}
}

0 comments on commit 278e01c

Please sign in to comment.