summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrevor McGuire <trevormcguire@google.com>2024-04-10 18:48:01 +0000
committerGitHub <noreply@github.com>2024-04-10 11:48:01 -0700
commit2057fa028301e0965a09b236768326a4c5bffd29 (patch)
treedb52398e0c2ec6de9323495854fd9f5941fa7ae0
parent98253eb2ef32ee8e5ce12ea18336b71b59a83e26 (diff)
downloadjetpack-camera-app-2057fa028301e0965a09b236768326a4c5bffd29.tar.gz
Bump AGP to 8.4.0-rc01 and fix GMD instrumentation tests (#167)
* Bump AGP to 8.4.0-rc01 in instrumentation tests only * Update to AGP 8.4.0-rc01 This will require using Android Studio Jellyfish * Remove unneeded proguard files Also remove explicit release buildTypes from library modules. R8 was now minifying before including them in the app which was causing classpath issues. This should now be handled at the app level. * Update emulators to those available in sdkmanager Also explicitly downloads the specific emulator images rather than the generic emulator. For API 28, only "default" is available. For API 34, "aosp_atd" is now available. * Only download emulator image for specific device * Fix workflow formatting * Fix matrix references in workflow * Use quotes around system image name * Remove 64 bit requirement for emulators Newer emulators (API 30+) will use x86_64 by default since those are the only images available. Older emulators will choose 32 bit images by default. * Change "default" to "aosp" to satisfy GMD * Use google api emulator for API 28 * Fix android-29 -> android-28 * Increase app startup timeout to 10s It seems the initial boot can take a while on emulators. Increase the timeout to account for this.
-rw-r--r--.github/workflows/PullRequestWorkflow.yaml24
-rw-r--r--app/build.gradle.kts10
-rw-r--r--app/proguard-rules.pro21
-rw-r--r--app/src/androidTest/java/com/google/jetpackcamera/UiTestUtil.kt4
-rw-r--r--benchmark/build.gradle.kts2
-rw-r--r--data/settings/build.gradle.kts12
-rw-r--r--data/settings/proguard-rules.pro21
-rw-r--r--domain/camera/build.gradle.kts10
-rw-r--r--domain/camera/consumer-rules.pro0
-rw-r--r--domain/camera/proguard-rules.pro21
-rw-r--r--feature/preview/build.gradle.kts14
-rw-r--r--feature/preview/consumer-rules.pro0
-rw-r--r--feature/preview/proguard-rules.pro21
-rw-r--r--feature/quicksettings/build.gradle.kts10
-rw-r--r--feature/quicksettings/proguard-rules.pro21
-rw-r--r--feature/settings/build.gradle.kts13
-rw-r--r--feature/settings/consumer-rules.pro0
-rw-r--r--feature/settings/proguard-rules.pro21
-rw-r--r--gradle/libs.versions.toml2
19 files changed, 21 insertions, 206 deletions
diff --git a/.github/workflows/PullRequestWorkflow.yaml b/.github/workflows/PullRequestWorkflow.yaml
index 92dfc69..20e1582 100644
--- a/.github/workflows/PullRequestWorkflow.yaml
+++ b/.github/workflows/PullRequestWorkflow.yaml
@@ -82,24 +82,20 @@ jobs:
path: "*/build/reports/tests"
android-test:
- name: Instrumentation Tests
+ name: Instrumentation Tests (${{ matrix.device.name }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
device:
- - pixel2Api28
- - pixel8Api34
+ - { name: pixel2Api28, img: 'system-images;android-28;google_apis;x86' }
+ - { name: pixel8Api34, img: 'system-images;android-34;aosp_atd;x86_64' }
steps:
- name: Checkout
uses: actions/checkout@v4
- - name: Bump to AGP 8.4 alpha
- run: |
- sed -i 's/androidGradlePlugin = .*/androidGradlePlugin = "8.4.0-alpha13"/' gradle/libs.versions.toml
-
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
@@ -113,24 +109,26 @@ jobs:
java-version: ${{ env.JDK_VERSION }}
- name: Install Emulator
- run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --install "emulator"
+ run: |
+ yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --install "${{ matrix.device.img }}"
+
- name: Accept licenses
- run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses
+ run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Run instrumentation tests
uses: gradle/gradle-build-action@v3
with:
- arguments: ${{ matrix.device }}DebugAndroidTest
+ arguments: ${{ matrix.device.name }}DebugAndroidTest
- name: Upload instrumentation test reports and logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
- name: instrumentation-test-reports-${{ matrix.device }}
+ name: instrumentation-test-reports-${{ matrix.device.name }}
path: |
- */build/reports/androidTests/**/${{ matrix.device }}
- */build/outputs/androidTest-results/**/${{ matrix.device }}
+ */build/reports/androidTests/**/${{ matrix.device.name }}
+ */build/outputs/androidTest-results/**/${{ matrix.device.name }}
spotless:
name: Spotless Check
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index fd26267..dea2a00 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -39,12 +39,9 @@ android {
}
buildTypes {
- release {
+ getByName("release") {
isMinifyEnabled = true
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
+ proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
create("benchmark") {
initWith(buildTypes.getByName("release"))
@@ -76,12 +73,11 @@ android {
create("pixel2Api28") {
device = "Pixel 2"
apiLevel = 28
- systemImageSource = "aosp"
}
create("pixel8Api34") {
device = "Pixel 8"
apiLevel = 34
- systemImageSource = "aosp"
+ systemImageSource = "aosp_atd"
}
}
}
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
deleted file mode 100644
index ff59496..0000000
--- a/app/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile \ No newline at end of file
diff --git a/app/src/androidTest/java/com/google/jetpackcamera/UiTestUtil.kt b/app/src/androidTest/java/com/google/jetpackcamera/UiTestUtil.kt
index 85ee2fb..543ab49 100644
--- a/app/src/androidTest/java/com/google/jetpackcamera/UiTestUtil.kt
+++ b/app/src/androidTest/java/com/google/jetpackcamera/UiTestUtil.kt
@@ -28,8 +28,8 @@ import com.google.jetpackcamera.settings.model.CameraAppSettings
import com.google.jetpackcamera.settings.model.LensFacing
import java.util.concurrent.atomic.AtomicReference
-const val APP_START_TIMEOUT_MILLIS = 5000L
-const val IMAGE_CAPTURE_TIMEOUT_MILLIS = 5000L
+const val APP_START_TIMEOUT_MILLIS = 10_000L
+const val IMAGE_CAPTURE_TIMEOUT_MILLIS = 5_000L
object UiTestUtil {
private fun getActivity(activityScenario: ActivityScenario<MainActivity>): MainActivity {
val activityRef: AtomicReference<MainActivity> = AtomicReference<MainActivity>()
diff --git a/benchmark/build.gradle.kts b/benchmark/build.gradle.kts
index 617294b..a94a31a 100644
--- a/benchmark/build.gradle.kts
+++ b/benchmark/build.gradle.kts
@@ -56,11 +56,11 @@ android {
}
targetProjectPath = ":app"
- experimentalProperties["android.experimental.self-instrumenting"] = true
// required for benchmark:
// self instrumentation required for the tests to be able to compile, start, or kill the app
// ensures test and app processes are separate
// see https://source.android.com/docs/core/tests/development/instr-self-e2e
+ experimentalProperties["android.experimental.self-instrumenting"] = true
}
dependencies {
diff --git a/data/settings/build.gradle.kts b/data/settings/build.gradle.kts
index e718994..2c56c18 100644
--- a/data/settings/build.gradle.kts
+++ b/data/settings/build.gradle.kts
@@ -34,15 +34,6 @@ android {
consumerProguardFiles("consumer-rules.pro")
}
- buildTypes {
- release {
- isMinifyEnabled = false
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }
- }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
@@ -57,12 +48,11 @@ android {
create("pixel2Api28") {
device = "Pixel 2"
apiLevel = 28
- systemImageSource = "aosp"
}
create("pixel8Api34") {
device = "Pixel 8"
apiLevel = 34
- systemImageSource = "aosp"
+ systemImageSource = "aosp_atd"
}
}
}
diff --git a/data/settings/proguard-rules.pro b/data/settings/proguard-rules.pro
deleted file mode 100644
index ff59496..0000000
--- a/data/settings/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile \ No newline at end of file
diff --git a/domain/camera/build.gradle.kts b/domain/camera/build.gradle.kts
index a26d9be..4eccca3 100644
--- a/domain/camera/build.gradle.kts
+++ b/domain/camera/build.gradle.kts
@@ -30,18 +30,8 @@ android {
targetSdk = 34
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles("consumer-rules.pro")
}
- buildTypes {
- release {
- isMinifyEnabled = true
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }
- }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
diff --git a/domain/camera/consumer-rules.pro b/domain/camera/consumer-rules.pro
deleted file mode 100644
index e69de29..0000000
--- a/domain/camera/consumer-rules.pro
+++ /dev/null
diff --git a/domain/camera/proguard-rules.pro b/domain/camera/proguard-rules.pro
deleted file mode 100644
index ff59496..0000000
--- a/domain/camera/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile \ No newline at end of file
diff --git a/feature/preview/build.gradle.kts b/feature/preview/build.gradle.kts
index 1362aa5..9a62287 100644
--- a/feature/preview/build.gradle.kts
+++ b/feature/preview/build.gradle.kts
@@ -30,18 +30,8 @@ android {
targetSdk = 34
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles("consumer-rules.pro")
}
- buildTypes {
- release {
- isMinifyEnabled = true
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }
- }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
@@ -60,18 +50,16 @@ android {
isReturnDefaultValues = true
isIncludeAndroidResources = true
}
-
managedDevices {
localDevices {
create("pixel2Api28") {
device = "Pixel 2"
apiLevel = 28
- systemImageSource = "aosp"
}
create("pixel8Api34") {
device = "Pixel 8"
apiLevel = 34
- systemImageSource = "aosp"
+ systemImageSource = "aosp_atd"
}
}
}
diff --git a/feature/preview/consumer-rules.pro b/feature/preview/consumer-rules.pro
deleted file mode 100644
index e69de29..0000000
--- a/feature/preview/consumer-rules.pro
+++ /dev/null
diff --git a/feature/preview/proguard-rules.pro b/feature/preview/proguard-rules.pro
deleted file mode 100644
index ff59496..0000000
--- a/feature/preview/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile \ No newline at end of file
diff --git a/feature/quicksettings/build.gradle.kts b/feature/quicksettings/build.gradle.kts
index 1b181a1..ef6aa90 100644
--- a/feature/quicksettings/build.gradle.kts
+++ b/feature/quicksettings/build.gradle.kts
@@ -29,18 +29,8 @@ android {
targetSdk = 34
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles("consumer-rules.pro")
}
- buildTypes {
- release {
- isMinifyEnabled = true
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }
- }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
diff --git a/feature/quicksettings/proguard-rules.pro b/feature/quicksettings/proguard-rules.pro
deleted file mode 100644
index ff59496..0000000
--- a/feature/quicksettings/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile \ No newline at end of file
diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts
index afa8205..e0e722e 100644
--- a/feature/settings/build.gradle.kts
+++ b/feature/settings/build.gradle.kts
@@ -30,18 +30,8 @@ android {
targetSdk = 34
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles("consumer-rules.pro")
}
- buildTypes {
- release {
- isMinifyEnabled = false
- proguardFiles(
- getDefaultProguardFile("proguard-android-optimize.txt"),
- "proguard-rules.pro"
- )
- }
- }
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
@@ -62,12 +52,11 @@ android {
create("pixel2Api28") {
device = "Pixel 2"
apiLevel = 28
- systemImageSource = "aosp"
}
create("pixel8Api34") {
device = "Pixel 8"
apiLevel = 34
- systemImageSource = "aosp"
+ systemImageSource = "aosp_atd"
}
}
}
diff --git a/feature/settings/consumer-rules.pro b/feature/settings/consumer-rules.pro
deleted file mode 100644
index e69de29..0000000
--- a/feature/settings/consumer-rules.pro
+++ /dev/null
diff --git a/feature/settings/proguard-rules.pro b/feature/settings/proguard-rules.pro
deleted file mode 100644
index ff59496..0000000
--- a/feature/settings/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# Add project specific ProGuard rules here.
-# You can control the set of applied configuration files using the
-# proguardFiles setting in build.gradle.kts.
-#
-# For more details, see
-# http://developer.android.com/guide/developing/tools/proguard.html
-
-# If your project uses WebView with JS, uncomment the following
-# and specify the fully qualified class name to the JavaScript interface
-# class:
-#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
-# public *;
-#}
-
-# Uncomment this to preserve the line number information for
-# debugging stack traces.
-#-keepattributes SourceFile,LineNumberTable
-
-# If you keep the line number information, uncomment this to
-# hide the original source file name.
-#-renamesourcefileattribute SourceFile \ No newline at end of file
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 8096d91..4577d25 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,7 +1,7 @@
[versions]
accompanistPermissions = "0.26.5-rc"
androidJunit = "1.1.5"
-androidGradlePlugin = "8.1.4"
+androidGradlePlugin = "8.4.0-rc01"
androidxActivityCompose = "1.8.2"
androidxAppCompat = "1.6.1"
androidxCore = "1.12.0"