From bfddcb546631ca4eac098572f82fc10e7d1abbdf Mon Sep 17 00:00:00 2001 From: Nathan Brizendine Date: Wed, 20 Mar 2024 11:25:06 +0100 Subject: [PATCH] Update AGP/Gradle to 8.x, remove proguard --- .github/workflows/ci.yaml | 6 +- build.gradle.kts | 1 - buildSrc/build.gradle.kts | 4 +- buildSrc/src/main/kotlin/Dependencies.kt | 12 ++- gradle/wrapper/gradle-wrapper.properties | 3 +- ruler-cli/build.gradle.kts | 6 +- .../java/com/spotify/ruler/cli/RulerCli.kt | 5 +- ruler-common/build.gradle.kts | 5 +- .../spotify/ruler/common/models/AppInfo.kt | 2 +- .../spotify/ruler/common/models/DeviceSpec.kt | 2 +- .../project-fixture/app/build.gradle | 4 +- ruler-e2e-tests/build.gradle.kts | 7 +- .../spotify/ruler/e2e/ProguardReportTest.kt | 39 --------- .../spotify/ruler/e2e/ReleaseReportTest.kt | 4 + ruler-frontend-tests/build.gradle.kts | 4 +- .../frontend/testutil/WebDriverExtension.kt | 3 +- ruler-frontend/build.gradle.kts | 14 ++++ ruler-gradle-plugin/build.gradle.kts | 4 +- .../project-fixture/app/build.gradle | 4 +- sample/app/build.gradle.kts | 8 +- sample/dynamic/build.gradle.kts | 4 + sample/lib/build.gradle.kts | 8 +- sample/proguard/.gitignore | 1 - sample/proguard/build.gradle.kts | 83 ------------------- sample/proguard/src/main/AndroidManifest.xml | 30 ------- .../ruler/sample/proguard/MainActivity.kt | 31 ------- .../src/main/res/layout/activity_main.xml | 27 ------ .../proguard/src/main/res/values/strings.xml | 19 ----- settings.gradle.kts | 1 - 29 files changed, 74 insertions(+), 267 deletions(-) delete mode 100644 ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ProguardReportTest.kt delete mode 100644 sample/proguard/.gitignore delete mode 100644 sample/proguard/build.gradle.kts delete mode 100644 sample/proguard/src/main/AndroidManifest.xml delete mode 100644 sample/proguard/src/main/kotlin/com/spotify/ruler/sample/proguard/MainActivity.kt delete mode 100644 sample/proguard/src/main/res/layout/activity_main.xml delete mode 100644 sample/proguard/src/main/res/values/strings.xml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b7ad47a8..acb32b1e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - android-gradle-plugin: [7.0.4, 7.1.3, 7.2.2, 7.3.0, 7.4.2] + android-gradle-plugin: [8.2.0] steps: - name: Checkout uses: actions/checkout@v3 @@ -23,7 +23,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: adopt - java-version: 11 + java-version: 17 cache: gradle - name: Publish plugin to local Maven repository @@ -32,7 +32,7 @@ jobs: - name: Run checks env: ANDROID_GRADLE_PLUGIN_VERSION: ${{ matrix.android-gradle-plugin }} - run: ./gradlew check --no-daemon --stacktrace "-Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m" + run: ./gradlew check --no-daemon --stacktrace "-Dorg.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=2048m" - name: Archive sample HTML report uses: actions/upload-artifact@v2 diff --git a/build.gradle.kts b/build.gradle.kts index 2af0f790..f8e71150 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,6 @@ buildscript { dependencies { classpath(Dependencies.ANDROID_GRADLE_PLUGIN) classpath(Dependencies.KOTLIN_GRADLE_PLUGIN) - classpath(Dependencies.PROGUARD_GRADLE_PLUGIN) classpath(Dependencies.KOTLINX_SERIALIZATION_GRADLE_PLUGIN) classpath(Dependencies.DETEKT_GRADLE_PLUGIN) classpath(Dependencies.NEXUS_PUBLISH_GRADLE_PLUGIN) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 0dca5a56..4d75e8d3 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -22,6 +22,6 @@ repositories { mavenCentral() } -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(11)) +kotlin { + jvmToolchain(17) } diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 142caff5..85f13753 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -19,7 +19,6 @@ object Dependencies { const val ANDROID_GRADLE_PLUGIN = "com.android.tools.build:gradle:${Versions.ANDROID_GRADLE_PLUGIN}" const val KOTLIN_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.KOTLIN}" - const val PROGUARD_GRADLE_PLUGIN = "com.guardsquare:proguard-gradle:${Versions.PROGUARD_GRADLE_PLUGIN}" const val KOTLINX_SERIALIZATION_GRADLE_PLUGIN = "org.jetbrains.kotlin:kotlin-serialization:${Versions.KOTLIN}" const val DETEKT_GRADLE_PLUGIN = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${Versions.DETEKT_GRADLE_PLUGIN}" const val NEXUS_PUBLISH_GRADLE_PLUGIN = "io.github.gradle-nexus.publish-plugin:io.github.gradle-nexus.publish-plugin.gradle.plugin:${Versions.NEXUS_PUBLISH_GRADLE_PLUGIN}" @@ -58,10 +57,9 @@ object Dependencies { const val APEX_CHARTS = "apexcharts" object Versions { - const val ANDROID_GRADLE_PLUGIN = "7.4.2" // https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google - const val KOTLIN = "1.8.20" // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib - const val PROGUARD_GRADLE_PLUGIN = "7.2.1" // https://mvnrepository.com/artifact/com.guardsquare/proguard-gradle - const val DETEKT_GRADLE_PLUGIN = "1.21.0" // https://mvnrepository.com/artifact/io.gitlab.arturbosch.detekt/detekt-gradle-plugin + const val ANDROID_GRADLE_PLUGIN = "8.2.0" // https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google + const val KOTLIN = "1.9.10" // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib + const val DETEKT_GRADLE_PLUGIN = "1.23.3" // https://mvnrepository.com/artifact/io.gitlab.arturbosch.detekt/detekt-gradle-plugin const val NEXUS_PUBLISH_GRADLE_PLUGIN = "1.1.0" // https://mvnrepository.com/artifact/io.github.gradle-nexus.publish-plugin/io.github.gradle-nexus.publish-plugin.gradle.plugin const val SHADOW_GRADLE_PLUGIN = "7.1.2" // https://plugins.gradle.org/plugin/com.github.johnrengelman.shadow @@ -83,8 +81,8 @@ object Dependencies { const val KOTLIN_REACT_ROUTER = "6.11.0-pre.545" // https://mvnrepository.com/artifact/org.jetbrains.kotlin-wrappers/kotlin-react-router-dom const val KOTLIN_JS_EXTENSIONS = "1.0.1-pre.545" // https://mvnrepository.com/artifact/org.jetbrains.kotlin-wrappers/kotlin-extensions - const val SELENIUM_WEBDRIVER = "4.11.0" // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java - const val SELENIUM_WEBDRIVER_MANAGER = "5.5.2" // https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager + const val SELENIUM_WEBDRIVER = "4.18.1" // https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java + const val SELENIUM_WEBDRIVER_MANAGER = "5.7.0" // https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager const val REACT = "18.2.0" // https://www.npmjs.com/package/react const val BOOTSTRAP = "5.2.1" // https://www.npmjs.com/package/bootstrap diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8fad3f5a..2bb7cd30 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Wed Mar 20 11:02:53 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/ruler-cli/build.gradle.kts b/ruler-cli/build.gradle.kts index cd937314..3dbc7e6d 100644 --- a/ruler-cli/build.gradle.kts +++ b/ruler-cli/build.gradle.kts @@ -30,9 +30,13 @@ extra[EXT_POM_DESCRIPTION] = "Command line interface for Ruler" java { withSourcesJar() - toolchain.languageVersion.set(JavaLanguageVersion.of(11)) } +kotlin { + jvmToolchain(17) +} + + dependencies { implementation(project(":ruler-models")) implementation(project(":ruler-common")) diff --git a/ruler-cli/src/main/java/com/spotify/ruler/cli/RulerCli.kt b/ruler-cli/src/main/java/com/spotify/ruler/cli/RulerCli.kt index ea3b1ed0..47934898 100644 --- a/ruler-cli/src/main/java/com/spotify/ruler/cli/RulerCli.kt +++ b/ruler-cli/src/main/java/com/spotify/ruler/cli/RulerCli.kt @@ -131,6 +131,7 @@ class RulerCli : CliktCommand(), BaseRulerTask { } private fun apkFiles(projectPath: String, deviceSpec: DeviceSpec?): Map> { + require((apkFile != null || bundleFile != null)) { "No APK file or bundle file provided" } return if (apkFile != null) { if (apkFile!!.extension == "apk") { logger.log(Level.INFO, "Using APK file ${apkFile?.path}") @@ -141,7 +142,7 @@ class RulerCli : CliktCommand(), BaseRulerTask { unzipFile(apkFile!!, directory) parseSplitApkDirectory(directory.toFile()) } - } else if (bundleFile != null) { + } else { with( if (aapt2Tool != null) { logger.log( @@ -161,8 +162,6 @@ class RulerCli : CliktCommand(), BaseRulerTask { } ) } - } else { - throw IllegalArgumentException("No APK file or bundle file provided") } } diff --git a/ruler-common/build.gradle.kts b/ruler-common/build.gradle.kts index a445b1c7..f7a089d9 100644 --- a/ruler-common/build.gradle.kts +++ b/ruler-common/build.gradle.kts @@ -28,7 +28,10 @@ extra[EXT_POM_DESCRIPTION] = "Common code used by the Ruler Gradle plugin & Rule java { withSourcesJar() - toolchain.languageVersion.set(JavaLanguageVersion.of(11)) +} + +kotlin { + jvmToolchain(17) } // Required for copying resources from Kotln JS (ruler-frontend) module. diff --git a/ruler-common/src/main/java/com/spotify/ruler/common/models/AppInfo.kt b/ruler-common/src/main/java/com/spotify/ruler/common/models/AppInfo.kt index 50a31961..d267d7f3 100644 --- a/ruler-common/src/main/java/com/spotify/ruler/common/models/AppInfo.kt +++ b/ruler-common/src/main/java/com/spotify/ruler/common/models/AppInfo.kt @@ -24,6 +24,6 @@ import kotlinx.serialization.Serializable as KSerializable data class AppInfo(val variantName: String, val applicationId: String, val versionName: String) : Serializable { companion object { - const val serialVersionUID = 1L + private const val serialVersionUID = 1L } } diff --git a/ruler-common/src/main/java/com/spotify/ruler/common/models/DeviceSpec.kt b/ruler-common/src/main/java/com/spotify/ruler/common/models/DeviceSpec.kt index 4fc334f6..744ca51a 100644 --- a/ruler-common/src/main/java/com/spotify/ruler/common/models/DeviceSpec.kt +++ b/ruler-common/src/main/java/com/spotify/ruler/common/models/DeviceSpec.kt @@ -26,7 +26,7 @@ import java.io.Serializable @kotlinx.serialization.Serializable(with = DeviceSpec.Serializer::class) data class DeviceSpec(val abi: String, val locale: String, val screenDensity: Int, val sdkVersion: Int) : Serializable { companion object { - const val serialVersionUID = 1L + private const val serialVersionUID = 1L } @SerialName("DeviceSpec") diff --git a/ruler-common/src/test/resources/project-fixture/app/build.gradle b/ruler-common/src/test/resources/project-fixture/app/build.gradle index 5a297e2e..5bcb64eb 100644 --- a/ruler-common/src/test/resources/project-fixture/app/build.gradle +++ b/ruler-common/src/test/resources/project-fixture/app/build.gradle @@ -20,11 +20,11 @@ plugins { } android { - compileSdk = 31 + compileSdk = 34 defaultConfig { applicationId = "com.spotify.ruler.test" minSdk = 23 - targetSdk = 31 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/ruler-e2e-tests/build.gradle.kts b/ruler-e2e-tests/build.gradle.kts index 7fc3ab9c..a49173ef 100644 --- a/ruler-e2e-tests/build.gradle.kts +++ b/ruler-e2e-tests/build.gradle.kts @@ -35,9 +35,10 @@ tasks.withType { // Make reports of the sample project available dependsOn(":sample:app:analyzeDebugBundle") dependsOn(":sample:app:analyzeReleaseBundle") - dependsOn(":sample:proguard:analyzeReleaseBundle") } -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(11)) +kotlin { + jvmToolchain(17) } + + diff --git a/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ProguardReportTest.kt b/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ProguardReportTest.kt deleted file mode 100644 index bff0180c..00000000 --- a/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ProguardReportTest.kt +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2021 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.spotify.ruler.e2e - -import com.google.common.truth.Truth.assertThat -import com.spotify.ruler.e2e.testutil.Correspondence -import com.spotify.ruler.e2e.testutil.FileMatcher -import com.spotify.ruler.e2e.testutil.parseReport -import com.spotify.ruler.models.FileType -import org.junit.jupiter.api.Test - -class ProguardReportTest { - - // Use the report generated by the sample ProGuard app for verification - private val report = parseReport("proguard", "release") - - @Test - fun `Classes are de-obfuscated correctly`() { - val lib = report.components.single { component -> component.name == ":sample:lib" } - - assertThat(lib.files).comparingElementsUsing(Correspondence.file()).contains( - FileMatcher("com.spotify.ruler.sample.lib.ClassToObfuscate", FileType.CLASS) - ) - } -} diff --git a/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ReleaseReportTest.kt b/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ReleaseReportTest.kt index baea981e..1e810b48 100644 --- a/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ReleaseReportTest.kt +++ b/ruler-e2e-tests/src/test/kotlin/com/spotify/ruler/e2e/ReleaseReportTest.kt @@ -60,6 +60,10 @@ class ReleaseReportTest { FileMatcher("/AndroidManifest.xml", FileType.OTHER, "default-team"), FileMatcher("/resources.arsc", FileType.OTHER, "default-team"), FileMatcher("/META-INF/com/android/build/gradle/app-metadata.properties", FileType.OTHER, "default-team"), + FileMatcher("androidx.appcompat.R\$styleable", FileType.CLASS, "default-team"), + FileMatcher("androidx.core.R\$styleable", FileType.CLASS, "default-team"), + FileMatcher("androidx.appcompat.resources.R\$styleable", FileType.CLASS, "default-team") + ) } diff --git a/ruler-frontend-tests/build.gradle.kts b/ruler-frontend-tests/build.gradle.kts index c856f87a..5e7114a4 100644 --- a/ruler-frontend-tests/build.gradle.kts +++ b/ruler-frontend-tests/build.gradle.kts @@ -35,6 +35,6 @@ tasks.withType { dependsOn(":ruler-frontend:browserDevelopmentWebpack") } -java { - toolchain.languageVersion.set(JavaLanguageVersion.of(11)) +kotlin { + jvmToolchain(17) } diff --git a/ruler-frontend-tests/src/test/kotlin/com/spotify/ruler/frontend/testutil/WebDriverExtension.kt b/ruler-frontend-tests/src/test/kotlin/com/spotify/ruler/frontend/testutil/WebDriverExtension.kt index ed2f4451..1eb7ecde 100644 --- a/ruler-frontend-tests/src/test/kotlin/com/spotify/ruler/frontend/testutil/WebDriverExtension.kt +++ b/ruler-frontend-tests/src/test/kotlin/com/spotify/ruler/frontend/testutil/WebDriverExtension.kt @@ -51,7 +51,8 @@ class WebDriverExtension : BeforeAllCallback, BeforeEachCallback, AfterEachCallb driver = ChromeDriver(options) // Open and use the generated development report page for testing - val reportPath = Paths.get("..", "ruler-frontend", "build", "developmentExecutable", "index.html") + val reportPath = Paths.get("..", "ruler-frontend", "build", "dist", "js", "developmentExecutable", "index.html") + require(reportPath.toFile().exists()) driver.get(reportPath.toUri().toString()) } diff --git a/ruler-frontend/build.gradle.kts b/ruler-frontend/build.gradle.kts index 9255f274..32d4184a 100644 --- a/ruler-frontend/build.gradle.kts +++ b/ruler-frontend/build.gradle.kts @@ -57,3 +57,17 @@ val browserDist by configurations.creating { artifacts { add(browserDist.name, tasks.named("browserDistribution").map { it.outputs.files.files.single() }) } + +tasks.named("browserDevelopmentRun") { + dependsOn("developmentExecutableCompileSync") +} + +tasks.named("browserDevelopmentWebpack") { + dependsOn("productionExecutableCompileSync") +} + +tasks.named("browserProductionWebpack") { + dependsOn("developmentExecutableCompileSync") +} + + diff --git a/ruler-gradle-plugin/build.gradle.kts b/ruler-gradle-plugin/build.gradle.kts index a55d72fe..caacc59c 100644 --- a/ruler-gradle-plugin/build.gradle.kts +++ b/ruler-gradle-plugin/build.gradle.kts @@ -82,8 +82,10 @@ tasks.withType { java { withSourcesJar() +} - toolchain.languageVersion.set(JavaLanguageVersion.of(11)) +kotlin { + jvmToolchain(17) } publishing { diff --git a/ruler-gradle-plugin/src/test/resources/project-fixture/app/build.gradle b/ruler-gradle-plugin/src/test/resources/project-fixture/app/build.gradle index 03cdae6f..7566e2f0 100644 --- a/ruler-gradle-plugin/src/test/resources/project-fixture/app/build.gradle +++ b/ruler-gradle-plugin/src/test/resources/project-fixture/app/build.gradle @@ -21,11 +21,11 @@ plugins { android { namespace "com.spotify.ruler.test" - compileSdk = 33 + compileSdk = 34 defaultConfig { applicationId = "com.spotify.ruler.test" minSdk = 23 - targetSdk = 33 + targetSdk = 34 versionCode = 1 versionName = "1.0" } diff --git a/sample/app/build.gradle.kts b/sample/app/build.gradle.kts index bebc869b..ba0b9a9d 100644 --- a/sample/app/build.gradle.kts +++ b/sample/app/build.gradle.kts @@ -23,12 +23,12 @@ plugins { android { namespace = "com.spotify.ruler.sample.app" - compileSdk = 33 + compileSdk = 34 defaultConfig { applicationId = "com.spotify.ruler.sample" minSdk = 21 - targetSdk = 33 + targetSdk = 34 versionCode = 1 versionName = "1.0" } @@ -67,3 +67,7 @@ tasks.named("check").configure { dependsOn("analyzeDebugBundle") dependsOn("analyzeReleaseBundle") } + +kotlin { + jvmToolchain(17) +} diff --git a/sample/dynamic/build.gradle.kts b/sample/dynamic/build.gradle.kts index b9d47345..e4a7e452 100644 --- a/sample/dynamic/build.gradle.kts +++ b/sample/dynamic/build.gradle.kts @@ -34,3 +34,7 @@ android { dependencies { implementation(project(":sample:app")) } + +kotlin { + jvmToolchain(17) +} diff --git a/sample/lib/build.gradle.kts b/sample/lib/build.gradle.kts index d74f581f..305e9bf0 100644 --- a/sample/lib/build.gradle.kts +++ b/sample/lib/build.gradle.kts @@ -22,10 +22,10 @@ plugins { android { namespace = "com.spotify.ruler.sample.lib" - compileSdk = 33 + compileSdk = 34 defaultConfig { minSdk = 21 - targetSdk = 33 + targetSdk = 34 } lint { warningsAsErrors = true @@ -35,3 +35,7 @@ android { dependencies { implementation(Dependencies.ANDROID_CONSTRAINT_LAYOUT) } + +kotlin { + jvmToolchain(17) +} diff --git a/sample/proguard/.gitignore b/sample/proguard/.gitignore deleted file mode 100644 index 42afabfd..00000000 --- a/sample/proguard/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/sample/proguard/build.gradle.kts b/sample/proguard/build.gradle.kts deleted file mode 100644 index b816c0c6..00000000 --- a/sample/proguard/build.gradle.kts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2021 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.codehaus.groovy.runtime.StringGroovyMethods - -plugins { - id("com.android.application") - id("kotlin-android") - id("com.guardsquare.proguard") - id("io.gitlab.arturbosch.detekt") - id("com.spotify.ruler") -} - -android { - namespace = "com.spotify.ruler.sample.proguard" - compileSdk = 33 - defaultConfig { - applicationId = "com.spotify.ruler.sample" - minSdk = 21 - targetSdk = 33 - versionCode = 1 - versionName = "1.0" - } - buildTypes { - release { - isMinifyEnabled = false - } - } - lint { - warningsAsErrors = true - } - packagingOptions { - resources.excludes.add("**/*.kotlin_builtins") - resources.excludes.add("kotlin-tooling-metadata.json") - } - - // Workaround until https://github.com/Guardsquare/proguard/issues/272 is fixed - androidResources { - additionalParameters("--proguard", project.buildDir.resolve("intermediates/proguard/configs/aapt_rules.pro").absolutePath) - } - applicationVariants.configureEach { - val variantName = StringGroovyMethods.capitalize(name) - tasks.named("bundle${variantName}Resources").configure { dependsOn("process${variantName}Resources") } - } -} - -dependencies { - implementation(project(":sample:lib")) -} - -proguard { - configurations { - register("release") { - defaultConfiguration("proguard-android-optimize.txt") - } - } -} - -ruler { - abi.set("arm64-v8a") - locale.set("en") - screenDensity.set(480) - sdkVersion.set(27) -} - -// Include Ruler tasks in checks -tasks.named("check").configure { - dependsOn("analyzeDebugBundle") - dependsOn("analyzeReleaseBundle") -} diff --git a/sample/proguard/src/main/AndroidManifest.xml b/sample/proguard/src/main/AndroidManifest.xml deleted file mode 100644 index d51a011a..00000000 --- a/sample/proguard/src/main/AndroidManifest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - diff --git a/sample/proguard/src/main/kotlin/com/spotify/ruler/sample/proguard/MainActivity.kt b/sample/proguard/src/main/kotlin/com/spotify/ruler/sample/proguard/MainActivity.kt deleted file mode 100644 index e8cc8de2..00000000 --- a/sample/proguard/src/main/kotlin/com/spotify/ruler/sample/proguard/MainActivity.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2021 Spotify AB - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.spotify.ruler.sample.proguard - -import android.app.Activity -import android.os.Bundle -import android.util.Log -import com.spotify.ruler.sample.lib.ClassToObfuscate - -class MainActivity : Activity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - Log.d("MainActivity", ClassToObfuscate.string()) - } -} diff --git a/sample/proguard/src/main/res/layout/activity_main.xml b/sample/proguard/src/main/res/layout/activity_main.xml deleted file mode 100644 index b5836008..00000000 --- a/sample/proguard/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - diff --git a/sample/proguard/src/main/res/values/strings.xml b/sample/proguard/src/main/res/values/strings.xml deleted file mode 100644 index 6e86fd93..00000000 --- a/sample/proguard/src/main/res/values/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - ProGuard - diff --git a/settings.gradle.kts b/settings.gradle.kts index fa58ff5c..e5d1131d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -28,7 +28,6 @@ if (!startParameter.projectProperties.containsKey("withoutSample")) { include(":sample:app") include(":sample:dynamic") include(":sample:lib") - include(":sample:proguard") } plugins {