Skip to content

Commit

Permalink
Misc repo infra updates (#150)
Browse files Browse the repository at this point in the history
* Gradle 8.8

* Update dependencies

* Add upcoming changes to CHANGELOG

* Modernize CI

* Empty

* Make debugging easier

* Update expected rules
  • Loading branch information
ZacSweers authored Jun 28, 2024
1 parent 6783ba6 commit a8b5d6f
Show file tree
Hide file tree
Showing 9 changed files with 414 additions and 46 deletions.
33 changes: 6 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail-fast: false # We want to see all results
matrix:
os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest']
agp: ['8.4.0', '8.5.0-alpha08']
agp: ['8.5.0', '8.6.0-alpha08']
job: ['instrumentation', 'plugin']
env:
DEP_OVERRIDE_agp: ${{ matrix.agp }}
Expand Down Expand Up @@ -68,42 +68,21 @@ jobs:
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# TODO AVD caching disabled due to https://github.com/ReactiveCircus/android-emulator-runner/issues/278
# - name: AVD cache
# uses: actions/cache@v3
# id: avd-cache
# if: matrix.job == 'instrumentation' && matrix.os == 'ubuntu-latest'
# with:
# path: |
# ~/.android/avd/*
# ~/.android/adbkey
# ~/.android/adbkey.pub
# key: avd-${{ env.API_LEVEL }}-${{ env.AVD_TARGET }}
#
# - name: Create AVD and generate snapshot for caching
# if: matrix.job == 'instrumentation' && matrix.os == 'ubuntu-latest' && steps.avd-cache.outputs.cache-hit != 'true'
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{ env.API_LEVEL }}
# force-avd-creation: false
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# disable-spellchecker: true
# target: ${{ env.AVD_TARGET }}
# channel: canary # Necessary for ATDs
# script: echo "Generated AVD snapshot for caching."
sudo udevadm trigger --name-match=kvm
- name: Run instrumentation tests
if: matrix.job == 'instrumentation' && matrix.os == 'ubuntu-latest'
id: gradle-instrumentation-fork
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.API_LEVEL }}
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
disable-spellchecker: true
disk-size: 6000M
heap-size: 600M
target: 'aosp_atd'
channel: canary # Necessary for ATDs
script: |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

**Unreleased**
--------------

- **Fix**: Support running on Windows.
- Build against Gradle `8.8`.
- Build against AGP `8.5.0`.
- Build against Kotlin `1.9.24`.

0.16.0
------

Expand Down
22 changes: 11 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[versions]
agp = "8.4.0"
androidx-test = "1.6.0-alpha07"
kotlin = "1.9.23"
agp = "8.5.0"
androidx-test = "1.6.1"
kotlin = "1.9.24"
gjf = "1.22.0"
ktfmt = "0.49"
ktfmt = "0.51"

[plugins]
agp-library = { id = "com.android.library", version.ref = "agp" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.15.0-Beta.3" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.28.0" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.29.0" }
spotless = { id = "com.diffplug.spotless", version = "6.25.0" }

[libraries]
androidx-annotation = "androidx.annotation:annotation:1.7.1"
androidx-test-orchestrator = "androidx.test:orchestrator:1.5.0-alpha04"
androidx-test-rules = { module = "androidx.test:rules", version = "1.6.0-alpha04" }
androidx-annotation = "androidx.annotation:annotation:1.8.0"
androidx-test-orchestrator = "androidx.test:orchestrator:1.5.0"
androidx-test-rules = { module = "androidx.test:rules", version = "1.6.1" }
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test" }
androidx-test-truth = "androidx.test.ext:junit:1.1.5"
androidx-test-truth = "androidx.test.ext:junit:1.2.1"
agp = { module = "com.android.tools.build:gradle", version.ref = "agp" }
desugarJdkLibs = "com.android.tools:desugar_jdk_libs:2.0.4"
javapoet = "com.squareup:javapoet:1.13.0"
junit = "junit:junit:4.13.2"
kgp = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kgp-api = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin-api", version.ref = "kotlin" }
kotlinpoet = "com.squareup:kotlinpoet:1.16.0"
kotlinpoet = "com.squareup:kotlinpoet:1.17.0"
okio = "com.squareup.okio:okio:3.9.0"
truth = "com.google.truth:truth:1.4.2"
zipflinger = { module = "com.android:zipflinger", version.ref = "agp" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion keeper-gradle-plugin/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
13 changes: 10 additions & 3 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,18 @@ if (isCi) {
tasks.withType<InferAndroidTestKeepRules>().configureEach {
doLast {
println("Checking expected rules")
val outputRules = outputProguardRules.asFile.get().readText().trim()
val expectedRules = file("expectedRules.pro").readText().trim()
val outputFile = outputProguardRules.asFile.get()
val outputRules = outputFile.readText().trim()
val expectedFile = file("expectedRules.pro")
val expectedRules = expectedFile.readText().trim()
if (outputRules != expectedRules) {
System.err.println(
"Rules don't match expected, output rules are below. Compare them with 'expectedRules.pro'"
"""
Rules don't match expected
Actual: file://$outputFile
Expected: file://$expectedFile
"""
.trimIndent()
)
assertThat(outputRules).isEqualTo(expectedRules)
}
Expand Down
Loading

0 comments on commit a8b5d6f

Please sign in to comment.