Skip to content

Commit

Permalink
fix: add stability configuration file to the core maps-compose projec…
Browse files Browse the repository at this point in the history
…t. The currently configured types are all the immutable data types from com.google.android.gms.maps.model that are currently used in android-maps-compose:maps-compose. These types will now be considered @stable by the compiler. Making immutable data types @stable can be a more effective measure than relying on strong skipping, as stable types can use structural equality, whereas strong skipping merely relies on referential equality, as of today. (#517)

This commit also makes compose compiler report generation available via command-line options (-PcomposeCompilerMetrics=true, -PcomposeCompilerReports=true)

Fixes #152
  • Loading branch information
bubenheimer authored Apr 16, 2024
1 parent 0599412 commit bfe95dd
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
21 changes: 21 additions & 0 deletions maps-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@ android {
jvmTarget = '1.8'
freeCompilerArgs += '-Xexplicit-api=strict'
freeCompilerArgs += '-Xopt-in=kotlin.RequiresOptIn'

freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=" +
layout.projectDirectory.file('compose_compiler.conf').asFile.absolutePath
]

if (findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_compiler"
]
}
if (findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs += [
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_compiler"
]
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions maps-compose/compose_compiler.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
com.google.android.gms.maps.model.BitmapDescriptor
com.google.android.gms.maps.model.Cap
com.google.android.gms.maps.model.LatLng
com.google.android.gms.maps.model.LatLngBounds
com.google.android.gms.maps.model.MapStyleOptions
com.google.android.gms.maps.model.PatternItem
com.google.android.gms.maps.model.PinConfig

0 comments on commit bfe95dd

Please sign in to comment.