Commit 748a128
build: update dependencies to latest versions (#2387)
* build: update dependencies to latest versions
Bumps the version catalog and a handful of hardcoded snippet
dependencies to their latest releases, including major upgrades:
AGP 8.13.2 -> 9.3.1, Gradle 9.1.0 -> 9.7.0, Kotlin 2.2.0 -> 2.4.10,
KSP 2.2.20-2.0.4 -> 2.3.11 (now versioned independently of Kotlin),
Maps Compose 7.0.0/6.12.0 -> 8.4.0, Places(-ktx) and
android-maps-utils to their latest majors. Also aligns app-rx's
hardcoded play-services-maps/places versions with the rest of the
repo.
* build: bump actions/checkout to v7 and actions/setup-python to v7
Both are new majors since the last actions bump (#2377). Verified no
workflow uses pull_request_target/workflow_run (affected by
checkout v7's fork-checkout change) or setup-python's removed
pip-install input, so no other changes are needed.
* docs: sync WearOS install-snippet version comment with catalog
scripts/update_docs_versions.py enforces this in CI; the wear bump
to 1.4.0 left the inline comment stale.
* build: regenerate Gradle wrapper for 9.7.0 via official wrapper task
Ran ./gradlew wrapper --gradle-version=9.7.0 instead of hand-editing
gradle-wrapper.properties, since that also refreshes
gradle-wrapper.jar and the gradlew/gradlew.bat scripts (and picks up
new 9.x wrapper properties like retries/retryBackOffMs). Drops the
distributionSha256Sum pin as requested.
* build: migrate to AGP 9 built-in Kotlin support
AGP 9 provides Kotlin support natively and refuses to configure a
module that still applies org.jetbrains.kotlin.android alongside it.
Removes that plugin (all its declaration styles: catalog alias,
kotlin("android"), and hardcoded id(...)) from every module actually
wired into settings.gradle.kts, and drops the now-unused kotlin-android
catalog entry.
Also fixes two things AGP 9 surfaced as hard errors during
configuration, unrelated to the plugin removal itself:
- ApiDemos:java-app had a vestigial buildFeatures.compose = true with
no Kotlin sources or Compose dependencies; AGP 9 now requires the
Compose Compiler plugin whenever compose is enabled, so the dead
flag is removed instead.
- tutorials/kotlin/Polygons used the now-unsupported
proguard-android.txt default file, replaced with
proguard-android-optimize.txt.
Standalone tutorial/sample directories not wired into
settings.gradle.kts (app-rx, the java/ and duplicate kotlin/ tutorial
folders) are untouched since they aren't part of the actual build
graph or CI.
* build: bump compileSdk/targetSdk to 37
androidx.core:core-ktx 1.19.0 requires compiling against API 37+;
CI's checkDebugAarMetadata caught this. Also switches
app-utils-ktx off its hardcoded compileSdk/targetSdk = 36 onto the
catalog value, matching every other module.
* build: pin GitHub Actions to commit SHAs
The org's zizmor policy check (triggered whenever workflow files
change) requires every `uses:` reference to be pinned to a full
commit SHA rather than a floating version tag. Touching these three
files for the checkout/setup-python bump made the check actually
run for the first time in a while and it flagged all 36 `uses:`
lines in them (not just the ones changed), so pins every action
reference across build.yml, lint.yml, and generate-v3.yml, each with
a version comment. release-please.yml is untouched by this PR and
wasn't flagged, so left as-is.
* build: add explicit workflow permissions and disable credential persistence
zizmor flagged two more findings once these files started being
scanned: excessive-permissions (Medium, blocking) because none of
the three workflows declared an explicit permissions: block and so
ran with the default broad GITHUB_TOKEN scope, and artipacked (Low,
informational) because checkout steps left credentials persisted in
the git config, which get exposed to anything that later reads the
workspace (e.g. artifact uploads).
- build.yml: contents: read (checkout + build only, no writes)
- lint.yml: contents: read, security-events: write (needed for
github/codeql-action/upload-sarif)
- generate-v3.yml: contents: read (the actual PR push uses its own
SYNCED_GITHUB_TOKEN_REPO secret via peter-evans/create-pull-request,
not the default token)
- persist-credentials: false added to every actions/checkout step
across all three files; none of them do a subsequent git push with
the default token, so this is safe.
* fix: findViewById<View> instead of View? for applyInsets calls
applyInsets(container: View) takes a non-null View, but every
kotlin-app activity called it as
applyInsets(findViewById<View?>(R.id.map_container)). Kotlin's
newer compiler no longer treats an explicit nullable type argument
on a platform-typed Java generic method leniently, so this now hard
fails to compile instead of silently working. All 24 call sites
always assumed a non-null result anyway (no null check), so this
just drops the incorrect nullable type argument.
* fix: adapt app-utils-ktx snippets to android-maps-utils 5.1.1 API
The android-maps-utils bump (3.19.0 -> 5.1.1, part of the dependency
update) rewrote the library in Kotlin, which is a source-incompatible
change for these snippets:
- ClusterItem is now a Kotlin interface with val properties
(position, title, snippet, zIndex: Float?), not Java-style getter
methods. Clustering.kt and Multilayer.kt's MyItem implementations
used `override fun getPosition()` etc., which no longer overrides
anything Kotlin recognizes; converted to `override val` properties
matching the new interface, constructor-promoted where possible.
- KmlLayer/KmlContainer expose getContainers()/getPlacemarks() as
plain functions, not Kotlin properties, and KmlContainer's backing
fields are now private. Feature.getId() is likewise a function.
KML.kt used property-access syntax (layer.containers, feature.id)
for all of these; switched to explicit method calls.
- GeoJsonLayer's default style accessor is getDefaultPointStyle(),
not a defaultPointStyle property; fixed in GeoJSON.kt.
- KmlLayer/GeoJsonLayer constructors now take non-null
Context/InputStream/JSONObject instead of the old nullable
platform types. These snippet files use throwaway `= null`
placeholders for doc purposes (never actually run), so added `!!`
at each call site to match, consistent with the existing `map!!`
pattern already used nearby.
Verified each API shape against the actual v5.1.1 source on
googlemaps/android-maps-utils (the library moved to a Kotlin
rewrite there) rather than guessing.
* fix: remaining android-maps-utils 5.1.1 API breaks
Two more spots the compiler hadn't reached yet in the previous fix pass:
- GeoJsonPointStyle (Kotlin, android-maps-utils 5.1.1) exposes
isDraggable()/setDraggable(), getTitle()/setTitle(),
getSnippet()/setSnippet() as plain functions, not var properties,
so app-utils-ktx/GeoJSON.kt's `pointStyle.isDraggable = true` style
assignments don't compile; switched to explicit setter calls.
- KmlContainer.getProperty() now returns String? (nullable); KML.kt
passed it straight to Log.i's non-null second parameter, added !!
(guarded by the existing hasProperty() check just above it).
- The JSONObject-argument GeoJsonLayer constructor is now annotated
@throws(JSONException::class) in Kotlin, which surfaces in Java as
a checked exception. snippets/app-utils (Java)'s
addGeoJsonLayerJsonObject() didn't declare it; added `throws
JSONException` to match its sibling method's existing pattern.
* fix: remember MarkerState in FireMarkers to satisfy lint
AGP 9's bundled lint now flags UnrememberedMutableState as an error
(previously warning/unreported): MarkerState(...) was created fresh
every recomposition, which would also reset marker drag state.
Wraps it in remember(markerData.id) so each marker's state survives
recomposition and is invalidated by React iOnly when the marker's
identity actually changes.
* refactor(snippets): use version catalog in documentation snippets and update Places SDK
- Update dependencies in snippets (app-compose, app-utils, app-places-ktx)
to use the Gradle version catalog (libs.*), resolving UseTomlInstead lint
findings flagged by code scanning.
- Add documentation comments within region tags showing both the recommended
version catalog configuration (TOML block) and the standalone coordinate
declaration for non-catalog projects.
- Replace deprecated places-ktx dependency with core Places SDK (libs.places),
as Kotlin extensions and coroutines are built directly into the Places SDK.
- Add mapsUtils to gradle/libs.versions.toml.
- Add missing androidTest dependencies (ext.junit, espresso.idling.resource)
to ApiDemos:kotlin-app and update LatLngSubject / LatLngBoundsSubject custom
Truth subject factories for Kotlin 2.4 / Truth 1.4.5 compatibility.
- Add .kotlin/ compiler directory to .gitignore.
---------
Co-authored-by: Dale Hawkins <107309+dkhawk@users.noreply.github.com>1 parent 203112a commit 748a128
57 files changed
Lines changed: 235 additions & 221 deletions
File tree
- .github/workflows
- ApiDemos/project
- common-ui
- java-app
- kotlin-app
- src
- androidTest/java/com/example/kotlindemos/truth
- main/java/com/example/kotlindemos
- FireMarkers
- app
- src/main/java/com/example/firemarkers
- WearOS
- Wearable
- gradle
- wrapper
- snippets
- app-compose
- app-ktx
- app-places-ktx
- app-rx
- app-utils-ktx
- src/main/java/com/example/app_utils_ktx
- app-utils
- src/main/java/com/example/app_utils
- app
- tutorials/kotlin/Polygons/app
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
58 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
59 | 66 | | |
60 | 67 | | |
61 | | - | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | | - | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
77 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
78 | 87 | | |
79 | 88 | | |
80 | | - | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
86 | | - | |
| 95 | + | |
87 | 96 | | |
88 | 97 | | |
89 | 98 | | |
| |||
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
96 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | | - | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
105 | | - | |
| 116 | + | |
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| |||
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
121 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | | - | |
| 137 | + | |
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
129 | 142 | | |
130 | | - | |
| 143 | + | |
131 | 144 | | |
132 | 145 | | |
133 | 146 | | |
| |||
143 | 156 | | |
144 | 157 | | |
145 | 158 | | |
146 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
147 | 162 | | |
148 | | - | |
| 163 | + | |
149 | 164 | | |
150 | 165 | | |
151 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | | - | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | | - | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | | - | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | | - | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | | - | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | | - | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | | - | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | | - | |
| 74 | + | |
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | | - | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | | - | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | 91 | | |
86 | | - | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
92 | | - | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
98 | | - | |
| 104 | + | |
99 | 105 | | |
100 | 106 | | |
101 | 107 | | |
102 | 108 | | |
103 | 109 | | |
104 | | - | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | | - | |
| 116 | + | |
111 | 117 | | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
116 | | - | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| 96 | + | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
66 | | - | |
67 | | - | |
| 72 | + | |
| 73 | + | |
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
0 commit comments