From e61194db46fb80d21f3cfeaaae69f60c77f02358 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 12:17:56 +0900 Subject: [PATCH 1/9] Use 3.6.0 stable, 4.0.0-beta01 --- build.gradle | 5 +++-- .../plugins/artifacts/PackageAppTaskCompat.groovy | 13 ++++++++++--- .../plugins/internal/agp/AndroidGradlePlugin.groovy | 4 ++++ .../gradle/plugins/AcceptanceKtsTestSpec.groovy | 3 ++- .../gradle/plugins/AcceptanceTestBaseSpec.groovy | 2 +- .../gradle/plugins/AcceptanceTestSpec.groovy | 3 ++- src/test/resources/project/settings.gradle | 3 +++ 7 files changed, 25 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 915dbb58..70c68057 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ repositories { ext { agpVersion = '3.3.2' - unstableAgpVersion = '3.6.0-beta01' + unstableAgpVersion = '4.0.0-beta01' } sourceSets { @@ -61,7 +61,7 @@ task createClasspathManifest { dependencies { compileOnly gradleApi() compileOnly localGroovy() - compileOnly "com.android.tools.build:gradle:$agpVersion" + compileOnly "com.android.tools.build:gradle:$unstableAgpVersion" implementation 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1' implementation 'org.apache.httpcomponents:httpmime:4.2.5' @@ -73,6 +73,7 @@ dependencies { testImplementation "com.github.tomakehurst:wiremock:2.20.0" testImplementation 'org.spockframework.spock:spock-core:spock-1.2' +// testImplementation 'org.spockframework:spock-core:1.3-groovy-2.5' // for ApplyPluginSpec testRuntimeOnly "com.android.tools.build:gradle:$agpVersion" diff --git a/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy b/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy index 40ee6c80..d17f01ab 100644 --- a/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy +++ b/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy @@ -1,6 +1,5 @@ package com.deploygate.gradle.plugins.artifacts - import com.deploygate.gradle.plugins.internal.agp.AndroidGradlePlugin import groovy.transform.PackageScope import org.gradle.api.Project @@ -14,7 +13,7 @@ class PackageAppTaskCompat { @Nonnull static ApkInfo getApkInfo(@Nonnull /* PackageApplication */ packageAppTask, @Nonnull String variantName) { // outputScope is retrieved by the reflection - Collection apkNames = packageAppTask.outputScope.apkDatas*.outputFileName + Collection apkNames = getApkNames(packageAppTask) File outputDir = getOutputDirectory(packageAppTask) boolean isUniversal = apkNames.size() == 1 boolean isSigningReady = hasSigningConfig(packageAppTask) @@ -33,7 +32,7 @@ class PackageAppTaskCompat { if (AndroidGradlePlugin.isAppBundleArchiveNameChanged()) { // outputScope is retrieved by the reflection - Collection apkNames = packageAppTask.outputScope.apkDatas*.outputFileName + Collection apkNames = getApkNames(packageAppTask) aabName = ((String) apkNames[0]).replaceFirst("\\.apk\$", ".aab") } else { aabName = "${project.properties["archivesBaseName"] as String}.aab" @@ -65,4 +64,12 @@ class PackageAppTaskCompat { return packageAppTask.outputDirectory.getAsFile().get() } } + + static Collection getApkNames(packageAppTask) { + if (!AndroidGradlePlugin.isOutputDirectoryProviderSupported()) { + return packageAppTask.outputScope.apkDatas*.outputFileName + } else { + return packageAppTask.getApkNames() + } + } } \ No newline at end of file diff --git a/src/main/groovy/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePlugin.groovy b/src/main/groovy/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePlugin.groovy index 3ed7a4e1..187f85a6 100644 --- a/src/main/groovy/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePlugin.groovy +++ b/src/main/groovy/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePlugin.groovy @@ -69,6 +69,10 @@ class AndroidGradlePlugin { return getVersion().major >= 4 || getVersion().major == 3 && getVersion().minor >= 6 } + static boolean isOutputFilenameDesignChanged() { + return getVersion().major >= 4 + } + @Nonnull static String androidAssembleTaskName(@Nonnull String variantName) { return "assemble${variantName.capitalize()}" diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy index e6be0cc3..5fb781a4 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy +++ b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy @@ -16,7 +16,8 @@ class AcceptanceKtsTestSpec extends AcceptanceTestBaseSpec { new AGPEnv("3.3.2", "4.10.1"), new AGPEnv("3.4.0", "5.1.1"), new AGPEnv("3.5.1", "5.4.1"), - new AGPEnv("3.6.0-rc01", "5.6.4"), + new AGPEnv("3.6.0", "5.6.4"), + new AGPEnv("4.0.0-beta01", "6.1.1"), ] } diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy index 2f2f293e..4fa76edc 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy +++ b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy @@ -181,7 +181,7 @@ abstract class AcceptanceTestBaseSpec extends Specification { .withProjectDir(testProjectDir.root) .withPluginClasspath(testDeployGatePlugin.loadPluginClasspath()) .withGradleVersion(gradleVersion) - .withArguments("uploadDeployGateFlavor1Flavor3Debug" /*, "--stacktrace" */) + .withArguments("uploadDeployGateFlavor1Flavor3Debug" , "--stacktrace" ) and: def buildResult = runner.build() diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy index b4b9513e..b89634f2 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy +++ b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy @@ -16,7 +16,8 @@ class AcceptanceTestSpec extends AcceptanceTestBaseSpec { new AGPEnv("3.3.2", "4.10.1"), new AGPEnv("3.4.1", "5.1.1"), new AGPEnv("3.5.1", "5.4.1"), - new AGPEnv("3.6.0-rc01", "5.6.4"), + new AGPEnv("3.6.0", "5.6.4"), + new AGPEnv("4.0.0-beta01", "6.1.1"), ] } } diff --git a/src/test/resources/project/settings.gradle b/src/test/resources/project/settings.gradle index ebadca15..3205e5bf 100644 --- a/src/test/resources/project/settings.gradle +++ b/src/test/resources/project/settings.gradle @@ -7,6 +7,9 @@ pluginManagement { maven { url "https://jcenter.bintray.com" } + maven { + url "https://dl.bintray.com/kotlin/kotlin-eap" + } } resolutionStrategy { From 07c2c51de43491a209d06fbb5bddf9cf94c377cc Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 17:45:33 +0900 Subject: [PATCH 2/9] Separate acceptance tests --- .circleci/config.yml | 112 ++++++++++++++---- build.gradle | 34 ++++-- run_acceptance_tests.bash | 20 ++++ settings.gradle | 1 + .../artifacts/PackageAppTaskCompat.groovy | 2 +- .../plugins/AcceptanceKtsTestSpec.groovy | 19 +-- .../plugins/AcceptanceTestBaseSpec.groovy | 110 ++++++----------- .../gradle/plugins/AcceptanceTestSpec.groovy | 14 --- .../gradle/plugins/TestAndroidProject.groovy | 110 +++++++++++++++++ .../plugins/TestDeployGatePlugin.groovy | 13 ++ .../gradle/plugins/VersionString.groovy | 81 +++++++++++++ .../AndroidGradlePluginAcceptanceSpec.groovy | 2 + .../gradle/GradleCompatAcceptanceSpec.groovy | 4 +- 13 files changed, 383 insertions(+), 139 deletions(-) create mode 100755 run_acceptance_tests.bash create mode 100644 settings.gradle create mode 100644 src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestAndroidProject.groovy create mode 100644 src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestDeployGatePlugin.groovy create mode 100644 src/test/unrollAcceptance/com/deploygate/gradle/plugins/VersionString.groovy rename src/test/{acceptance => unrollAcceptance}/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy (96%) rename src/test/{acceptance => unrollAcceptance}/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy (95%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 151fa9c4..32293e10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,22 +47,57 @@ commands: &commands cache_version: type: string default: v3 - steps: - type: steps + prefix: + type: string steps: - restore_cache: keys: - - gradle-<< parameters.cache_version >>-{{ checksum "build.gradle" }} + - gradle-<< parameters.cache_version >>-<< parameters.prefix >>-{{ checksum "build.gradle" }} + - gradle-<< parameters.cache_version >>-<< parameters.prefix >>- - gradle-<< parameters.cache_version >>- - gradle- - - << parameters.steps >> + save_gradle_cache: + parameters: + cache_version: + type: string + default: v3 + prefix: + type: string + steps: - save_cache: paths: - - ~/.android - - ~/.gradle - - .gradle - - ~/.m2 - key: gradle-<< parameters.cache_version >>-{{ checksum "build.gradle" }} + - ~/.android + - ~/.gradle + - .gradle + - ~/.m2 + key: gradle-<< parameters.cache_version >>-<< parameters.prefix >>-{{ checksum "build.gradle" }} + acceptance_test: + parameters: + agp_version: + type: string + gradle_version: + type: string + no_aab_support: + type: boolean + default: false + no_kts_support: + type: boolean + default: false + steps: + - run: rm -fr build/reports/tests/acceptanceTest build/test-results/tests/acceptanceTest || true + - run: ./gradlew acceptanceTest + environment: + TEST_AGP_VERSION: << parameters.agp_version >> + TEST_GRADLE_VERSION: << parameters.gradle_version >> + NO_AAB_SUPPORT: << parameters.no_aab_support >> + NO_KTS_SUPPORT: << parameters.no_kts_support >> + - store_artifacts: + path: build/reports/tests/acceptanceTest + destination: reports/tests/acceptanceTest/<< paremeters.agp_version >> + when: always + - store_test_results: + path: build/test-results/tests/acceptanceTest + when: always orbs: gradle: @@ -74,8 +109,10 @@ orbs: steps: - checkout - use_gradle_cache: - steps: - - run: ./gradlew install test + prefix: unit + - ./gradlew install test + - save_gradle_cache: + prefix: unit - store_artifacts: path: build/reports/tests/test when: always @@ -89,25 +126,50 @@ orbs: - download_sdk: zip_hash: "4333796" version: v2 - - use_gradle_cache: - steps: - - run: ./gradlew acceptanceTest - - store_artifacts: - path: build/reports/tests/acceptanceTest - when: always - - store_test_results: - path: build/test-results/tests/acceptanceTest - when: always + - use_gradle_cache: + prefix: acceptance + - acceptance_test: + agp_version: '3.0.0' + gradle_version: '4.1' + no_aab_support: true + no_kts_support: true + - acceptance_test: + agp_version: '3.1.0' + gradle_version: '4.4' + no_aab_support: true + no_kts_support: true + - acceptance_test: + agp_version: '3.2.0' + gradle_version: '4.6' + no_kts_support: true + - acceptance_test: + agp_version: '3.3.2' + gradle_version: '4.10.1' + - acceptance_test: + agp_version: '3.4.1' + gradle_version: '5.1.1' + - acceptance_test: + agp_version: '3.5.1' + gradle_version: '5.4.1' + - acceptance_test: + agp_version: '3.6.0' + gradle_version: '5.6.4' + - acceptance_test: + agp_version: '4.0.0-beta01' + gradle_version: '6.1.1' + - save_gradle_cache: + prefix: acceptance + release: executor: android_java steps: - checkout - use_gradle_cache: - steps: - - deploy: - command: | - ./release.sh - curl -X POST -d "payload=$(cat .circleci/bintray.json)" $OUTGOING_WEBHOOK_URL + prefix: unit + - deploy: + command: | + ./release.sh + curl -X POST -d "payload=$(cat .circleci/bintray.json)" $OUTGOING_WEBHOOK_URL workflows_filter: release: &release diff --git a/build.gradle b/build.gradle index 70c68057..e3a70eba 100644 --- a/build.gradle +++ b/build.gradle @@ -30,18 +30,28 @@ ext { } sourceSets { - acceptanceTest { + unrollAcceptanceTest { + groovy.srcDirs += ["src/test/unrollAcceptance"] + resources.srcDirs += test.resources.srcDirs + } + pluginAcceptanceTest { groovy.srcDirs += ["src/test/acceptance"] resources.srcDirs += test.resources.srcDirs } } configurations { - acceptanceTestCompileOnly.extendsFrom testCompileOnly - acceptanceTestRuntime.extendsFrom testRuntime - acceptanceTestRuntimeOnly.extendsFrom testRuntimeOnly - acceptanceTestImplementation.extendsFrom testImplementation - acceptanceTestApi.extendsFrom testApi + unrollAcceptanceTestCompileOnly.extendsFrom testCompileOnly + unrollAcceptanceTestRuntime.extendsFrom testRuntime + unrollAcceptanceTestRuntimeOnly.extendsFrom testRuntimeOnly + unrollAcceptanceTestImplementation.extendsFrom testImplementation + unrollAcceptanceTestApi.extendsFrom testApi + + pluginAcceptanceTestCompileOnly.extendsFrom testCompileOnly + pluginAcceptanceTestRuntime.extendsFrom testRuntime + pluginAcceptanceTestRuntimeOnly.extendsFrom testRuntimeOnly + pluginAcceptanceTestImplementation.extendsFrom testImplementation + pluginAcceptanceTestApi.extendsFrom testApi } // For testing. The classpaths of this plugin must be specified @@ -80,9 +90,15 @@ dependencies { testRuntimeOnly files(createClasspathManifest) } -tasks.create("acceptanceTest", Test) { - testClassesDirs = sourceSets.acceptanceTest.output.classesDirs - classpath = sourceSets.acceptanceTest.runtimeClasspath +tasks.create("testUnrollAcceptanceTest", Test) { + testClassesDirs = sourceSets.unrollAcceptanceTest.output.classesDirs + classpath = sourceSets.unrollAcceptanceTest.runtimeClasspath + dependsOn("createClasspathManifest") +} + +tasks.create("testPluginAcceptanceTest", Test) { + testClassesDirs = sourceSets.pluginAcceptanceTest.output.classesDirs + classpath = sourceSets.pluginAcceptanceTest.runtimeClasspath dependsOn("createClasspathManifest") } diff --git a/run_acceptance_tests.bash b/run_acceptance_tests.bash new file mode 100755 index 00000000..6f2c29d4 --- /dev/null +++ b/run_acceptance_tests.bash @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# Do not use "e" +set -uxo pipefail + +./gradlew testUnrollAcceptanceTest + +while read TEST_AGP_VERSION TEST_GRADLE_VERSION NO_AAB_SUPPORT NO_KTS_SUPPORT; do + export TEST_AGP_VERSION TEST_GRADLE_VERSION NO_AAB_SUPPORT NO_KTS_SUPPORT + ./gradlew testPluginAcceptanceTest +done < <(cat< getApkNames(packageAppTask) { - if (!AndroidGradlePlugin.isOutputDirectoryProviderSupported()) { + if (!AndroidGradlePlugin.isAppBundleArchiveNameChanged()) { return packageAppTask.outputScope.apkDatas*.outputFileName } else { return packageAppTask.getApkNames() diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy index 5fb781a4..a6ec5898 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy +++ b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceKtsTestSpec.groovy @@ -1,8 +1,10 @@ package com.deploygate.gradle.plugins import org.gradle.testkit.runner.GradleRunner +import spock.lang.IgnoreIf import spock.lang.Unroll +@IgnoreIf({ Boolean.valueOf(env["NO_KTS_SUPPORT"]) }) class AcceptanceKtsTestSpec extends AcceptanceTestBaseSpec { @Override @@ -10,18 +12,6 @@ class AcceptanceKtsTestSpec extends AcceptanceTestBaseSpec { testAndroidProject.useAcceptanceKtsResourceDir() } - @Override - AGPEnv[] getTestTargetAGPEnvs() { - return [ - new AGPEnv("3.3.2", "4.10.1"), - new AGPEnv("3.4.0", "5.1.1"), - new AGPEnv("3.5.1", "5.4.1"), - new AGPEnv("3.6.0", "5.6.4"), - new AGPEnv("4.0.0-beta01", "6.1.1"), - ] - } - - @Unroll def "Backward compatibility #agpVersion"() { given: testAndroidProject.useGradleKtsForBackwardCompatibilityResource() @@ -38,8 +28,7 @@ class AcceptanceKtsTestSpec extends AcceptanceTestBaseSpec { runner.withArguments("existsTask", "-PtaskName=loginDeployGate").build() where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } } diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy index 4fa76edc..8d193b4c 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy +++ b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestBaseSpec.groovy @@ -7,8 +7,8 @@ import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.Rule import org.junit.rules.TemporaryFolder +import spock.lang.IgnoreIf import spock.lang.Specification -import spock.lang.Unroll import javax.annotation.Nonnull @@ -17,16 +17,6 @@ import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options abstract class AcceptanceTestBaseSpec extends Specification { - static class AGPEnv { - String agpVersion - String gradleVersion - - AGPEnv(String agpVersion, String gradleVersion) { - this.agpVersion = agpVersion - this.gradleVersion = gradleVersion - } - } - @Rule TemporaryFolder testProjectDir = new TemporaryFolder() @@ -43,12 +33,6 @@ abstract class AcceptanceTestBaseSpec extends Specification { abstract void useProperResource() - abstract AGPEnv[] getTestTargetAGPEnvs() - - AGPEnv[] getAppBundleTestTargetAGPEnvs() { - return testTargetAGPEnvs.findAll { isAppBundleSupport(it.agpVersion) } - } - boolean isAppBundleSupport(String agpVersion) { def version = VersionString.tryParse(agpVersion) return version.major >= 4 || version.major == 3 && version.minor > 1 @@ -73,7 +57,6 @@ abstract class AcceptanceTestBaseSpec extends Specification { ) } - @Unroll def "check tasks' existence #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -122,12 +105,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { } where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "check task children of uploadDeployGate #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -165,12 +146,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { !result.contains("uploadDeployGateAabCustomApk") where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "flavor1Flavor3Debug apk #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -181,7 +160,7 @@ abstract class AcceptanceTestBaseSpec extends Specification { .withProjectDir(testProjectDir.root) .withPluginClasspath(testDeployGatePlugin.loadPluginClasspath()) .withGradleVersion(gradleVersion) - .withArguments("uploadDeployGateFlavor1Flavor3Debug" , "--stacktrace" ) + .withArguments("uploadDeployGateFlavor1Flavor3Debug", "--stacktrace") and: def buildResult = runner.build() @@ -199,12 +178,11 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll + @IgnoreIf({ Boolean.valueOf(env["NO_AAB_SUPPORT"]) }) def "flavor1Flavor3Debug aab #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -233,12 +211,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << appBundleTestTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "flavor2Flavor3Debug apk #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -267,12 +243,11 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll + @IgnoreIf({ Boolean.valueOf(env["NO_AAB_SUPPORT"]) }) def "flavor2Flavor3Debug aab #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -301,12 +276,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << appBundleTestTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "flavor1Flavor4Debug apk #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -335,12 +308,11 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll + @IgnoreIf({ Boolean.valueOf(env["NO_AAB_SUPPORT"]) }) def "flavor1Flavor4Debug aab #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -369,12 +341,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << appBundleTestTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "flavor2Flavor4Debug apk should fail unless assembling #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -394,12 +364,11 @@ abstract class AcceptanceTestBaseSpec extends Specification { buildResult.task(":uploadDeployGateFlavor2Flavor4Debug").getOutcome() == TaskOutcome.FAILED where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll + @IgnoreIf({ Boolean.valueOf(env["NO_AAB_SUPPORT"]) }) def "flavor2Flavor4Debug aab should fail unless bundling #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -419,12 +388,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { buildResult.task(":uploadDeployGateAabFlavor2Flavor4Debug").getOutcome() == TaskOutcome.FAILED where: - agpEnv << appBundleTestTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "flavor2Flavor4Debug apk require assembling #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -463,12 +430,11 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll + @IgnoreIf({ Boolean.valueOf(env["NO_AAB_SUPPORT"]) }) def "flavor2Flavor4Debug aab require bundling #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -507,12 +473,10 @@ abstract class AcceptanceTestBaseSpec extends Specification { missingPart(request, "visibility") where: - agpEnv << appBundleTestTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll def "customApk apk #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -541,12 +505,11 @@ abstract class AcceptanceTestBaseSpec extends Specification { request.getPart("visibility").body.asString() == "custom visibility" where: - agpEnv << testTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } - @Unroll + @IgnoreIf({ Boolean.valueOf(env["NO_AAB_SUPPORT"]) }) def "customApk aab #agpVersion"() { given: testAndroidProject.gradleProperties([ @@ -575,9 +538,8 @@ abstract class AcceptanceTestBaseSpec extends Specification { request.getPart("visibility").body.asString() == "custom visibility" where: - agpEnv << appBundleTestTargetAGPEnvs - agpVersion = agpEnv.agpVersion as String - gradleVersion = agpEnv.gradleVersion as String + agpVersion = System.getenv("TEST_AGP_VERSION") + gradleVersion = System.getenv("TEST_GRADLE_VERSION") } private static boolean missingPart(LoggedRequest request, String name) { diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy index b89634f2..7d9bd998 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy +++ b/src/test/acceptance/com/deploygate/gradle/plugins/AcceptanceTestSpec.groovy @@ -6,18 +6,4 @@ class AcceptanceTestSpec extends AcceptanceTestBaseSpec { void useProperResource() { testAndroidProject.useAcceptanceResourceDir() } - - @Override - AGPEnv[] getTestTargetAGPEnvs() { - return [ - new AGPEnv("3.0.0", "4.1"), - new AGPEnv("3.1.0", "4.4"), - 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.1", "5.4.1"), - new AGPEnv("3.6.0", "5.6.4"), - new AGPEnv("4.0.0-beta01", "6.1.1"), - ] - } } diff --git a/src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestAndroidProject.groovy b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestAndroidProject.groovy new file mode 100644 index 00000000..a7f57087 --- /dev/null +++ b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestAndroidProject.groovy @@ -0,0 +1,110 @@ +package com.deploygate.gradle.plugins + +import org.junit.rules.TemporaryFolder + +import javax.annotation.Nonnull + +class TestAndroidProject { + private TemporaryFolder temporaryFolder + + TestAndroidProject(TemporaryFolder temporaryFolder) { + this.temporaryFolder = temporaryFolder + } + + void useProjectResourceDir() { + def projectDir = copyDir("project") + def localProperties = new File(projectDir, "local.properties") + + if (!localProperties.exists()) { + localProperties.createNewFile() + + def androidSdk = System.getenv("ANDROID_HOME") ?: (System.getenv("HOME") + "/Library/Android/sdk") + + localProperties << """ +sdk.dir=${androidSdk} +ndk.dir=${androidSdk}/ndk-bundle +""" + } + } + + void useAcceptanceResourceDir() { + useProjectResourceDir() + buildGradle.exists() && buildGradle.delete() + copyDir("acceptance") + } + + void useAcceptanceKtsResourceDir() { + useAcceptanceResourceDir() + useGradleKtsResource() + } + + void useGradleCompatResource() { + def classLoader = getClass().getClassLoader() + def dir = classLoader.getResource("acceptance").file as File + + buildGradle.exists() && buildGradle.delete() && buildGradle.createNewFile() + buildGradle << new File(dir, "gradle.compat.build.gradle").newInputStream() + } + + void useGradleKtsForBackwardCompatibilityResource() { + def classLoader = getClass().getClassLoader() + def dir = classLoader.getResource("acceptance-kts").file as File + + buildGradle.exists() && buildGradle.delete() + buildGradleKts.exists() && buildGradleKts.delete() && buildGradleKts.createNewFile() + buildGradleKts << new File(dir, "old-dsl.build.gradle.kts").newInputStream() + } + + private void useGradleKtsResource() { + def classLoader = getClass().getClassLoader() + def dir = classLoader.getResource("acceptance-kts").file as File + + buildGradle.exists() && buildGradle.delete() + buildGradleKts.exists() && buildGradleKts.delete() && buildGradleKts.createNewFile() + buildGradleKts << new File(dir, "build.gradle.kts").newInputStream() + } + + @Nonnull + private File copyDir(String dirName) { + def classLoader = getClass().getClassLoader() + def dir = classLoader.getResource(dirName).file as File + + dir.listFiles().each { File f -> + copy(f, temporaryFolder.root) + } + + return dir + } + + private void copy(File copyFrom, File copyTo) { + def nextCopyTo = new File(copyTo, copyFrom.name) + nextCopyTo.exists() && nextCopyTo.delete() + + if (copyFrom.isFile()) { + if (!nextCopyTo.createNewFile()) { + throw new RuntimeException("cannot make a file") + } + nextCopyTo << copyFrom.newInputStream() + } else if (copyFrom.isDirectory()) { + if (!nextCopyTo.mkdirs()) { + throw new RuntimeException("cannot make directories") + } + + copyFrom.listFiles().each { File f -> + copy(f, nextCopyTo) + } + } + } + + File getBuildGradle() { + return new File(temporaryFolder.root, "build.gradle") + } + + File getBuildGradleKts() { + return new File(temporaryFolder.root, "build.gradle.kts") + } + + void gradleProperties(Map vars) { + temporaryFolder.newFile("gradle.properties") << vars.collect { "${it.key}=${it.value}" }.join("\n") + } +} diff --git a/src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestDeployGatePlugin.groovy b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestDeployGatePlugin.groovy new file mode 100644 index 00000000..41b93c7e --- /dev/null +++ b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/TestDeployGatePlugin.groovy @@ -0,0 +1,13 @@ +package com.deploygate.gradle.plugins + +class TestDeployGatePlugin { + List loadPluginClasspath() { + def pluginClasspathResource = getClass().classLoader.getResource("plugin-classpath.txt") + + if (pluginClasspathResource == null) { + throw new IllegalStateException("Did not find plugin classpath resource, run `createClasspathManifest` gradle task.") + } + + return pluginClasspathResource.readLines().collect { new File(it) } + } +} diff --git a/src/test/unrollAcceptance/com/deploygate/gradle/plugins/VersionString.groovy b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/VersionString.groovy new file mode 100644 index 00000000..c5599bf7 --- /dev/null +++ b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/VersionString.groovy @@ -0,0 +1,81 @@ +package com.deploygate.gradle.plugins + +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +import javax.annotation.Nullable +import java.util.regex.Pattern + +class VersionString { + private static final Logger LOGGER = LoggerFactory.getLogger(this.getClass()) + private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)(?:\\.(\\d+))?\$") + + @Nullable + static VersionString tryParse(@Nullable String version) { + if (!version) { + return null + } + + LOGGER.info(version) + + def versions = version.split("-", 2) + + try { + def matcher = VERSION_PATTERN.matcher(versions[0]) + + if (!matcher.find() || matcher.groupCount() < 2) { + return null + } + + def major = matcher.group(1).toInteger() + def minor = matcher.group(2).toInteger() + def patch = 0 + + if (matcher.groupCount() >= 3) { + patch = matcher.group(3)?.toInteger() ?: 0 + } + + String addition = null + + if (versions.length == 2) { + addition = versions[1] + } + + new VersionString(major, minor, patch, addition) + } catch (NumberFormatException ignore) { + return null + } + } + + final int major + final int minor + final int patch + + @Nullable + final String addition + + VersionString(int major, int minor, int patch, @Nullable String addition) { + this.major = major + this.minor = minor + this.patch = patch + this.addition = addition + } + + @Override + String toString() { + def builder = new StringBuffer() + + builder.append(major) + builder.append(".") + builder.append(minor) + builder.append(".") + builder.append(patch) + + if (addition != null) { + builder.append("-") + builder.append(addition) + } + + return builder.toString() + } +} diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy similarity index 96% rename from src/test/acceptance/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy rename to src/test/unrollAcceptance/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy index 5da7147a..e4710422 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy +++ b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/internal/agp/AndroidGradlePluginAcceptanceSpec.groovy @@ -65,5 +65,7 @@ class AndroidGradlePluginAcceptanceSpec extends Specification { "3.3.2" | "4.10.1" "3.4.1" | "5.1.1" "3.5.0" | "5.4.1" + "3.6.0" | "5.6.4" + "4.0.0-beta01" | "6.1.1" } } diff --git a/src/test/acceptance/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy similarity index 95% rename from src/test/acceptance/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy rename to src/test/unrollAcceptance/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy index 8cf5dde3..77d821b6 100644 --- a/src/test/acceptance/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy +++ b/src/test/unrollAcceptance/com/deploygate/gradle/plugins/internal/gradle/GradleCompatAcceptanceSpec.groovy @@ -53,7 +53,9 @@ class GradleCompatAcceptanceSpec extends Specification { "4.9", "4.10.1", "5.1.1", - "5.4.1" + "5.4.1", + "5.6.4", + "6.1.1" ] } } From 285c8a429a8dcebf37cf360ff10ec4f44163d761 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 17:48:23 +0900 Subject: [PATCH 3/9] Fixed a condition to use a fallback when fetching apk names --- .../gradle/plugins/artifacts/PackageAppTaskCompat.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy b/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy index feb0ac20..b146fb4b 100644 --- a/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy +++ b/src/main/groovy/com/deploygate/gradle/plugins/artifacts/PackageAppTaskCompat.groovy @@ -66,7 +66,7 @@ class PackageAppTaskCompat { } static Collection getApkNames(packageAppTask) { - if (!AndroidGradlePlugin.isAppBundleArchiveNameChanged()) { + if (!AndroidGradlePlugin.isOutputFilenameDesignChanged()) { return packageAppTask.outputScope.apkDatas*.outputFileName } else { return packageAppTask.getApkNames() From 1a40f6a83baa1e290bdd744197637f6c8190c24b Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 17:53:24 +0900 Subject: [PATCH 4/9] Fixed invalid circleci config --- .circleci/config.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 32293e10..b583a762 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,15 +85,16 @@ commands: &commands default: false steps: - run: rm -fr build/reports/tests/acceptanceTest build/test-results/tests/acceptanceTest || true - - run: ./gradlew acceptanceTest - environment: - TEST_AGP_VERSION: << parameters.agp_version >> - TEST_GRADLE_VERSION: << parameters.gradle_version >> - NO_AAB_SUPPORT: << parameters.no_aab_support >> - NO_KTS_SUPPORT: << parameters.no_kts_support >> + - run: + command: ./gradlew testPluginAcceptanceTest + environment: + TEST_AGP_VERSION: << parameters.agp_version >> + TEST_GRADLE_VERSION: << parameters.gradle_version >> + NO_AAB_SUPPORT: << parameters.no_aab_support >> + NO_KTS_SUPPORT: << parameters.no_kts_support >> - store_artifacts: path: build/reports/tests/acceptanceTest - destination: reports/tests/acceptanceTest/<< paremeters.agp_version >> + destination: reports/tests/acceptanceTest/<< parameters.agp_version >> when: always - store_test_results: path: build/test-results/tests/acceptanceTest @@ -110,7 +111,7 @@ orbs: - checkout - use_gradle_cache: prefix: unit - - ./gradlew install test + - run: ./gradlew install test - save_gradle_cache: prefix: unit - store_artifacts: @@ -126,7 +127,7 @@ orbs: - download_sdk: zip_hash: "4333796" version: v2 - - use_gradle_cache: + - use_gradle_cache: prefix: acceptance - acceptance_test: agp_version: '3.0.0' From 1f7c600a758cf621fa1b28a408026fd0e0190e64 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 17:59:54 +0900 Subject: [PATCH 5/9] Declare environment in build.gradle --- build.gradle | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e3a70eba..fb9f84d5 100644 --- a/build.gradle +++ b/build.gradle @@ -109,7 +109,11 @@ project.tasks.withType(Test).configureEach { } environment([ - "ANDROID_HOME": System.getenv("ANDROID_HOME") + "ANDROID_HOME": System.getenv("ANDROID_HOME"), + "TEST_AGP_VERSION": System.getenv("TEST_AGP_VERSION"), + "TEST_GRADLE_VERSION": System.getenv("TEST_GRADLE_VERSION"), + "NO_AAB_SUPPORT": System.getenv("NO_AAB_SUPPORT"), + "NO_KTS_SUPPORT": System.getenv("NO_KTS_SUPPORT") ]) } From 9bc78d225f9a3e15158cd20b41d000cd752f464e Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 18:06:38 +0900 Subject: [PATCH 6/9] Fixed boolean value handling --- .circleci/config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b583a762..cfca0eed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -78,11 +78,11 @@ commands: &commands gradle_version: type: string no_aab_support: - type: boolean - default: false + type: string + default: "false" no_kts_support: - type: boolean - default: false + type: string + default: "false" steps: - run: rm -fr build/reports/tests/acceptanceTest build/test-results/tests/acceptanceTest || true - run: @@ -132,17 +132,17 @@ orbs: - acceptance_test: agp_version: '3.0.0' gradle_version: '4.1' - no_aab_support: true - no_kts_support: true + no_aab_support: "true" + no_kts_support: "true" - acceptance_test: agp_version: '3.1.0' gradle_version: '4.4' - no_aab_support: true - no_kts_support: true + no_aab_support: "true" + no_kts_support: "true" - acceptance_test: agp_version: '3.2.0' gradle_version: '4.6' - no_kts_support: true + no_kts_support: "true" - acceptance_test: agp_version: '3.3.2' gradle_version: '4.10.1' @@ -184,7 +184,7 @@ workflows: version: 2 on_commit: jobs: - - gradle/unit_tests +# - gradle/unit_tests - gradle/acceptance_tests deploy: jobs: From aefb1f3d4b2a17a2e11b3a9e87daa85d2d359851 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 19:16:25 +0900 Subject: [PATCH 7/9] Reverted temporary commented-out statements --- .circleci/config.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cfca0eed..8b6458c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,7 +84,7 @@ commands: &commands type: string default: "false" steps: - - run: rm -fr build/reports/tests/acceptanceTest build/test-results/tests/acceptanceTest || true + - run: rm -fr build/reports/tests/testPluginAcceptanceTest build/test-results/tests/testPluginAcceptanceTest || true - run: command: ./gradlew testPluginAcceptanceTest environment: @@ -93,12 +93,12 @@ commands: &commands NO_AAB_SUPPORT: << parameters.no_aab_support >> NO_KTS_SUPPORT: << parameters.no_kts_support >> - store_artifacts: - path: build/reports/tests/acceptanceTest - destination: reports/tests/acceptanceTest/<< parameters.agp_version >> - when: always + path: build/reports/tests/testPluginAcceptanceTest + destination: reports/tests/testPluginAcceptanceTest/<< parameters.agp_version >> + when: always - store_test_results: - path: build/test-results/tests/acceptanceTest - when: always + path: build/test-results/tests/testPluginAcceptanceTest + when: always orbs: gradle: @@ -129,6 +129,13 @@ orbs: version: v2 - use_gradle_cache: prefix: acceptance + - run: ./gradlew testUnrollAcceptanceTest + - store_artifacts: + path: build/reports/tests/testUnrollAcceptanceTest + when: always + - store_test_results: + path: build/test-results/tests/testUnrollAcceptanceTest + when: always - acceptance_test: agp_version: '3.0.0' gradle_version: '4.1' @@ -184,7 +191,7 @@ workflows: version: 2 on_commit: jobs: -# - gradle/unit_tests + - gradle/unit_tests - gradle/acceptance_tests deploy: jobs: From e8a0af2ed06df1929a333decc7349d6abcc58bed Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 19:50:48 +0900 Subject: [PATCH 8/9] Use api 29 image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b6458c6..f94b5562 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ executors: &executors ANDROID_HOME: /home/circleci/android android_java: docker: - - image: circleci/android:api-28 + - image: circleci/android:api-29 working_directory: ~/gradle-deploygate-plugin environment: GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false' From 235a7a5568734e10fd3a6b02ef360d28f056c282 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 27 Feb 2020 21:09:21 +0900 Subject: [PATCH 9/9] Use api 29 on acceptance tests --- .circleci/config.yml | 2 +- src/test/resources/project/build.gradle | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f94b5562..c0522edb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,7 +37,7 @@ commands: &commands rm sdk-tools.zip fi - yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;28.0.3" "platforms;android-28" "platform-tools" >/dev/null 2>&1 || if [ $? -ne '141' ]; then exit $?; fi; + yes | $ANDROID_HOME/tools/bin/sdkmanager "build-tools;29.0.2" "platforms;android-29" "platform-tools" >/dev/null 2>&1 || if [ $? -ne '141' ]; then exit $?; fi; - save_cache: paths: - ~/android diff --git a/src/test/resources/project/build.gradle b/src/test/resources/project/build.gradle index 235b972e..f3f38247 100644 --- a/src/test/resources/project/build.gradle +++ b/src/test/resources/project/build.gradle @@ -6,12 +6,12 @@ plugins { } android { - compileSdkVersion 28 - buildToolsVersion '28.0.3' + compileSdkVersion 29 + buildToolsVersion '29.0.2' defaultConfig { applicationId "com.deploygate.example" minSdkVersion 14 - targetSdkVersion 28 + targetSdkVersion 29 versionCode 1 versionName "1.0" }