Skip to content

Commit 9752d55

Browse files
committed
chore: verify build health and remove rx samples
- Create scripts/verify_all.sh for local verification - Update CI to run tests and lint - Remove deprecated snippets/app-rx module - Fix FireMarkers unit tests - Update README with verification instructions
1 parent 1cc521e commit 9752d55

File tree

32 files changed

+116
-651
lines changed

32 files changed

+116
-651
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ jobs:
9999
./gradlew :snippets:app-utils-ktx:assembleDebug
100100
./gradlew :snippets:app-compose:assembleDebug
101101
./gradlew :snippets:app-places-ktx:assembleDebug
102-
./gradlew :snippets:app-rx:assembleDebug
103102
./gradlew :snippets:app-utils:assembleDebug
104103
105104
build-tutorials:
@@ -119,13 +118,25 @@ jobs:
119118
run: |
120119
./gradlew :tutorials:kotlin:Polygons:assembleDebug
121120
122-
test: # used as required status check
121+
test:
123122
runs-on: ubuntu-latest
123+
timeout-minutes: 60
124124
needs:
125125
- build-ApiDemos
126126
- build-WearOS
127+
- build-FireMarkers
127128
- build-Snippets
128129
- build-tutorials
129-
- build-FireMarkers
130130
steps:
131-
- run: echo "Fail if all other steps are not successful"
131+
- uses: actions/checkout@v4
132+
- name: set up Java 21
133+
uses: actions/setup-java@v4
134+
with:
135+
distribution: 'adopt'
136+
java-version: '21'
137+
138+
- name: Run Unit Tests
139+
run: ./gradlew testDebugUnitTest
140+
141+
- name: Run Lint
142+
run: ./gradlew lintDebug

FireMarkers/app/src/test/java/com/example/firemarkers/viewmodel/MarkersViewModelTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class MarkersViewModelTest {
156156
listenerCaptor.firstValue.onCancelled(error)
157157
testDispatcher.scheduler.advanceUntilIdle()
158158

159-
assertThat(errorMessage).isEqualTo("DB error on animation: Test Error")
159+
assertThat(errorMessage).isEqualTo("Database error (animation): Test Error")
160160
job.cancel()
161161
}
162162
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mock-maker-inline

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ To run the samples, you will need:
4343
1. In the welcome screen of Android Studio, select "Open an Existing project"
4444
1. Select one of the sample directories from this repository
4545

46+
## verifying the build
47+
48+
To verify that all samples build and pass tests, run:
49+
50+
```bash
51+
./scripts/verify_all.sh
52+
```
53+
4654
Alternatively, use the `gradlew build` command to build the project directly or download an APK
4755
under [releases](https://github.com/googlemaps/android-samples/releases).
4856

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5760d82d08e6c26884debb23736ea57/redirect
3+
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/879378f84c64b2c76003b97a32968399/redirect
4+
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5760d82d08e6c26884debb23736ea57/redirect
5+
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/879378f84c64b2c76003b97a32968399/redirect
6+
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/021e528cbed860c875a9016f29ee13c1/redirect
7+
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/6141bf023dcc7a96c47cad75c59b054e/redirect
8+
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5760d82d08e6c26884debb23736ea57/redirect
9+
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/879378f84c64b2c76003b97a32968399/redirect
10+
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9b6bab41c3ef2acea6116b7821b8dc11/redirect
11+
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/a6eb06d81d82a782734ef3b616ba2684/redirect
12+
toolchainVendor=JETBRAINS
13+
toolchainVersion=21

gradle/libs.versions.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ materialIconsExtended = "1.7.8"
3737

3838
# Google Maps & Places
3939
mapsCompose = "7.0.0"
40-
mapsKtx = "5.2.2"
41-
mapsRx = "1.0.1"
40+
mapsKtx = "6.0.0"
4241
places = "5.1.1"
43-
placesRx = "1.0.1"
4442
playServicesMaps = "20.0.0"
4543
secretsGradlePlugin = "2.0.1"
4644

@@ -67,7 +65,6 @@ firebaseDatabase = "22.0.1"
6765

6866
# Third Party
6967
easypermissions = "3.0.0"
70-
rxlifecycle = "4.0.2"
7168
volley = "1.2.1"
7269

7370
[libraries]
@@ -105,10 +102,8 @@ ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", versio
105102
# Maps & Places
106103
maps-compose = { module = "com.google.maps.android:maps-compose", version.ref = "mapsCompose" }
107104
maps-ktx = { group = "com.google.maps.android", name = "maps-ktx", version.ref = "mapsKtx" }
108-
maps-rx = { module = "com.google.maps.android:maps-rx", version.ref = "mapsRx" }
109105
maps-utils-ktx = { group = "com.google.maps.android", name = "maps-utils-ktx", version.ref = "mapsKtx" }
110106
places = { group = "com.google.android.libraries.places", name = "places", version.ref = "places" }
111-
places-rx = { module = "com.google.maps.android:places-rx", version.ref = "placesRx" }
112107
play-services-maps = { group = "com.google.android.gms", name = "play-services-maps", version.ref = "playServicesMaps" }
113108

114109
# Wear OS
@@ -142,7 +137,6 @@ firebase-database = { module = "com.google.firebase:firebase-database", version.
142137

143138
# Third Party
144139
easypermissions = { group = "pub.devrel", name = "easypermissions", version.ref = "easypermissions" }
145-
rxlifecycle-android-lifecycle-kotlin = { module = "com.trello.rxlifecycle4:rxlifecycle-android-lifecycle-kotlin", version.ref = "rxlifecycle" }
146140
volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
147141

148142
[plugins]

scripts/verify_all.sh

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
# script: verify_all.sh
3+
# description: Builds and verifies all Android modules in the project.
4+
5+
set -e # Exit immediately if a command exits with a non-zero status.
6+
7+
# Colors for output
8+
GREEN='\033[0;32m'
9+
RED='\033[0;31m'
10+
NC='\033[0m' # No Color
11+
12+
echo "Starting project verification..."
13+
14+
# List of modules to check
15+
# Note: snippets has submodules, checking root snippets project might be enough if it aggregates them,
16+
# but we'll be explicit or use standard tasks.
17+
MODULES=(
18+
":ApiDemos:java-app"
19+
":ApiDemos:kotlin-app"
20+
":ApiDemos:common-ui"
21+
":FireMarkers:app"
22+
":WearOS:Wearable"
23+
":snippets:app"
24+
":snippets:app-ktx"
25+
":snippets:app-utils-ktx"
26+
":snippets:app-compose"
27+
":snippets:app-places-ktx"
28+
":snippets:app-utils"
29+
":tutorials:kotlin:Polygons"
30+
)
31+
32+
# Function to run verification for a module
33+
verify_module() {
34+
local module=$1
35+
echo "------------------------------------------------"
36+
# Determine variant-specific tasks
37+
local assembleTask=":assembleDebug"
38+
local testTask=":testDebugUnitTest"
39+
local lintTask=":lintDebug"
40+
41+
if [[ "$module" == ":snippets:app" ]]; then
42+
assembleTask=":assembleGmsDebug"
43+
testTask=":testGmsDebugUnitTest"
44+
lintTask=":lintGmsDebug"
45+
fi
46+
47+
# Run assemble, lint, and test
48+
if ./gradlew "$module$assembleTask" "$module$testTask" "$module$lintTask"; then
49+
echo -e "${GREEN}SUCCESS: $module verified.${NC}"
50+
else
51+
echo -e "${RED}FAILURE: $module failed verification.${NC}"
52+
return 1
53+
fi
54+
}
55+
56+
FAILED_MODULES=()
57+
58+
for module in "${MODULES[@]}"; do
59+
if ! verify_module "$module"; then
60+
FAILED_MODULES+=("$module")
61+
fi
62+
done
63+
64+
echo "------------------------------------------------"
65+
if [ ${#FAILED_MODULES[@]} -eq 0 ]; then
66+
echo -e "${GREEN}ALL MODULES PASSED VERIFICATION.${NC}"
67+
exit 0
68+
else
69+
echo -e "${RED}THE FOLLOWING MODULES FAILED:${NC}"
70+
for failed in "${FAILED_MODULES[@]}"; do
71+
echo -e "${RED}- $failed${NC}"
72+
done
73+
exit 1
74+
fi

settings.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ pluginManagement {
2222
gradlePluginPortal()
2323
}
2424
}
25+
plugins {
26+
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
27+
}
2528
// [END maps_android_settings_plugin_management]
2629

2730
// [START maps_android_settings_dependency_resolution_management]
@@ -64,8 +67,6 @@ include(":snippets:app-compose")
6467
project(":snippets:app-compose").projectDir = file("snippets/app-compose")
6568
include(":snippets:app-places-ktx")
6669
project(":snippets:app-places-ktx").projectDir = file("snippets/app-places-ktx")
67-
include(":snippets:app-rx")
68-
project(":snippets:app-rx").projectDir = file("snippets/app-rx")
6970
include(":snippets:app-utils")
7071
project(":snippets:app-utils").projectDir = file("snippets/app-utils")
7172

snippets/app-rx/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

snippets/app-rx/build.gradle.kts

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)