Skip to content

Commit

Permalink
Update AGP/Gradle to 8.x, remove proguard
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan3d committed Mar 20, 2024
1 parent 1730351 commit bfddcb5
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 267 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ repositories {
mavenCentral()
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(11))
kotlin {
jvmToolchain(17)
}
12 changes: 5 additions & 7 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion ruler-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
5 changes: 2 additions & 3 deletions ruler-cli/src/main/java/com/spotify/ruler/cli/RulerCli.kt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class RulerCli : CliktCommand(), BaseRulerTask {
}

private fun apkFiles(projectPath: String, deviceSpec: DeviceSpec?): Map<String, List<File>> {
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}")
Expand All @@ -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(
Expand All @@ -161,8 +162,6 @@ class RulerCli : CliktCommand(), BaseRulerTask {
}
)
}
} else {
throw IllegalArgumentException("No APK file or bundle file provided")
}
}

Expand Down
5 changes: 4 additions & 1 deletion ruler-common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
7 changes: 4 additions & 3 deletions ruler-e2e-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ tasks.withType<Test> {
// 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)
}


This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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")

)
}

Expand Down
4 changes: 2 additions & 2 deletions ruler-frontend-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ tasks.withType<Test> {
dependsOn(":ruler-frontend:browserDevelopmentWebpack")
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(11))
kotlin {
jvmToolchain(17)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
14 changes: 14 additions & 0 deletions ruler-frontend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}


4 changes: 3 additions & 1 deletion ruler-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ tasks.withType<Test> {

java {
withSourcesJar()
}

toolchain.languageVersion.set(JavaLanguageVersion.of(11))
kotlin {
jvmToolchain(17)
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
8 changes: 6 additions & 2 deletions sample/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -67,3 +67,7 @@ tasks.named("check").configure {
dependsOn("analyzeDebugBundle")
dependsOn("analyzeReleaseBundle")
}

kotlin {
jvmToolchain(17)
}
4 changes: 4 additions & 0 deletions sample/dynamic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ android {
dependencies {
implementation(project(":sample:app"))
}

kotlin {
jvmToolchain(17)
}
8 changes: 6 additions & 2 deletions sample/lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -35,3 +35,7 @@ android {
dependencies {
implementation(Dependencies.ANDROID_CONSTRAINT_LAYOUT)
}

kotlin {
jvmToolchain(17)
}
1 change: 0 additions & 1 deletion sample/proguard/.gitignore

This file was deleted.

Loading

0 comments on commit bfddcb5

Please sign in to comment.