Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ android.uniquePackageNames=false
android.dependency.useConstraints=true
android.r8.strictFullModeForKeepRules=false
android.r8.optimizedResourceShrinking=false
android.builtInKotlin=false
android.newDsl=false

15 changes: 7 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@

[versions]
# Base
androidCompileSdk = "36"
androidCompileSdk = "37"
androidMinSdk = "23"
androidTargetSdk = "36"
androidTargetSdk = "37"

agp = "9.1.0"
dokka = "2.1.0"
agp = "9.2.1"
dokka = "2.2.0"
gradleMavenPublishPlugin = "0.36.0"
kotlin = "2.3.10"
kotlin = "2.3.21"
kotlinxCoroutines = "1.10.2"

# Android
activitycompose = "1.13.0"
androidx-core = "1.18.0"
androidx-startup = "1.2.0"
compose-bom = "2026.03.00"
compose-bom = "2026.05.00"
constraintlayout = "2.2.1"

# Material
Expand All @@ -40,7 +40,7 @@ mockk = "1.14.9"
org-jacoco-core = "0.8.14"
jacoco-plugin = "0.2.1"
robolectric = "4.16.1"
screenshot = "0.0.1-alpha13"
screenshot = "0.0.1-alpha14"
truth = "1.4.5"

[libraries]
Expand Down Expand Up @@ -85,7 +85,6 @@ jacoco-android-plugin = { module = "com.mxalbert.gradle:jacoco-android", version
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" }
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
#mockk-android = { module = "io.mockk:mockk-android", version.ref = "mockkAndroid" }
mockk-android = { group = "io.mockk", name = "mockk-android", version.ref = "mockk" }
org-jacoco-core = { module = "org.jacoco:org.jacoco.core", version.ref = "org-jacoco-core" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
Expand Down
29 changes: 14 additions & 15 deletions maps-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin")
alias(libs.plugins.compose.compiler)
alias(libs.plugins.screenshot)
Expand Down Expand Up @@ -63,22 +62,9 @@ android {
compose = true
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-opt-in=kotlin.RequiresOptIn"
)
}
}

@Suppress("UnstableApiUsage")
experimentalProperties["android.experimental.enableScreenshotTest"] = true

screenshotTests {
imageDifferenceThreshold = 0.035f // 3.5%
}


packaging {
resources {
pickFirsts += listOf(
Expand All @@ -89,6 +75,19 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-opt-in=kotlin.RequiresOptIn"
)
}
}

screenshotTests {
imageDifferenceThreshold = 0.035f // 3.5%
}

dependencies {
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.activity.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package com.google.maps.android.compose

import android.os.Bundle
import java.util.Locale
import androidx.compose.ui.text.intl.Locale
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
Expand Down Expand Up @@ -156,7 +156,7 @@ fun GroundOverlayControls(
Text(text = "Visible", modifier = Modifier.weight(1f))
Switch(checked = isVisible, onCheckedChange = onVisibilityChange)
}
Text(text = "Transparency: ${String.format(Locale.getDefault(), "%.2f", transparency)}")
Text(text = "Transparency: ${String.format(Locale.current.platformLocale, "%.2f", transparency)}")
Slider(
value = transparency,
onValueChange = onTransparencyChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package com.google.maps.android.compose.markerexamples

import android.os.Bundle
import android.util.Log
import java.util.Locale
import androidx.compose.ui.text.intl.Locale
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
Expand Down Expand Up @@ -205,7 +205,7 @@ private fun CustomUiClustering(items: List<MyItem>) {
clusterContent = { cluster ->
CircleContent(
modifier = Modifier.size(40.dp),
text = "%,d".format(Locale.getDefault(), cluster.size),
text = "%,d".format(Locale.current.platformLocale, cluster.size),
color = Color.Blue,
)
},
Expand Down Expand Up @@ -252,7 +252,7 @@ fun CustomRendererClustering(items: List<MyItem>) {
clusterContent = { cluster ->
CircleContent(
modifier = Modifier.size(40.dp),
text = "%,d".format(Locale.getDefault(), cluster.size),
text = "%,d".format(Locale.current.platformLocale, cluster.size),
color = Color.Green,
)
},
Expand Down
21 changes: 10 additions & 11 deletions maps-compose-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("kotlin-android")
alias(libs.plugins.compose.compiler)
id("android.maps.compose.PublishingConventionPlugin")
id("org.jetbrains.dokka")
Expand Down Expand Up @@ -45,16 +44,6 @@ android {
compose = true
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn"
)
}
}

buildTypes {
getByName("debug") {
enableUnitTestCoverage = true
Expand All @@ -63,6 +52,16 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn"
)
}
}

composeCompiler {
stabilityConfigurationFiles.set(
listOf(rootProject.layout.projectDirectory.file("compose_compiler_stability_config.conf"))
Expand Down
21 changes: 10 additions & 11 deletions maps-compose-widgets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("kotlin-android")
alias (libs.plugins.compose.compiler)
id("android.maps.compose.PublishingConventionPlugin")
id("org.jetbrains.dokka")
Expand Down Expand Up @@ -53,16 +52,6 @@ android {
compose = true
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn"
)
}
}

buildTypes {
getByName("debug") {
enableUnitTestCoverage = true
Expand All @@ -71,6 +60,16 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn"
)
}
}

composeCompiler {
stabilityConfigurationFiles.set(
listOf(rootProject.layout.projectDirectory.file("compose_compiler_stability_config.conf"))
Expand Down
24 changes: 14 additions & 10 deletions maps-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("org.jetbrains.kotlin.android")
alias(libs.plugins.compose.compiler)
id("org.jetbrains.dokka")
id("android.maps.compose.PublishingConventionPlugin")
Expand Down Expand Up @@ -45,18 +44,13 @@ android {
compose = true
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn"
)
sourceSets {
getByName("main") {
java.directories.add("build/generated/source/artifactId")
kotlin.directories.add("build/generated/source/artifactId")
}
}

sourceSets["main"].java.srcDir("build/generated/source/artifactId")

buildTypes {
getByName("debug") {
enableUnitTestCoverage = true
Expand All @@ -65,6 +59,16 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
freeCompilerArgs.addAll(
"-Xexplicit-api=strict",
"-opt-in=kotlin.RequiresOptIn"
)
}
}

composeCompiler {
stabilityConfigurationFiles.set(
listOf(rootProject.layout.projectDirectory.file("compose_compiler_stability_config.conf"))
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pluginManagement {
gradlePluginPortal()
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
rootProject.name = "android-maps-compose"

include(":maps-app")
Expand Down
Loading