Skip to content

Commit

Permalink
Set a separate versioning for COMPOSE_MATERIAL3_ADAPTIVE (#1500)
Browse files Browse the repository at this point in the history
Also, change the overriding mechanism, now strict name is required

## Testing
```
gradlew :mpp:publishComposeJbToMavenLocal -Pjetbrains.publication.version.COMPOSE=0.1.0 -Pjetbrains.publication.version.COMPOSE_MATERIAL3_ADAPTIVE=0.2.0 -Pjetbrains.publication.libraries=COMPOSE_MATERIAL3_ADAPTIVE
```
creates
`.m2\repository\org\jetbrains\compose\material3\adaptive\adaptive\0.2.0`
that depends on Compose 0.1.0
  • Loading branch information
igordmn authored Aug 15, 2024
1 parent 0864293 commit dc36893
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions MULTIPLATFORM.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ Compose Multiplatform core libraries can be published to local Maven with the fo

`-Pjetbrains.publication.version.CORE_BUNDLE`,
`-Pjetbrains.publication.version.COMPOSE`,
`-Pjetbrains.publication.version.COMPOSE_MATERIAL3_ADAPTIVE`,
`-Pjetbrains.publication.version.LIFECYCLE`,
`-Pjetbrains.publication.version.NAVIGATION`,
`-Pjetbrains.publication.version.SAVEDSTATE`
`-Pjetbrains.publication.version.SAVEDSTATE`,
`-Pjetbrains.publication.version.WINDOW`,

The default value for the version is `0.0.0-SNAPSHOT`

And library groups:
`-Pjetbrains.publication.libraries=CORE_BUNDLE,COMPOSE,LIFECYCLE,NAVIGATION,SAVEDSTATE,WINDOW`
`-Pjetbrains.publication.libraries=CORE_BUNDLE,COMPOSE,COMPOSE_MATERIAL3_ADAPTIVE,LIFECYCLE,NAVIGATION,SAVEDSTATE,WINDOW`

The default value includes all libraries.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract class LibraryVersionsService : BuildService<LibraryVersionsService.Para
val versions = getTable("versions")
val libsGroupsAndVersions = parameters.libsOverrideVersions.get()
versions.keySet().associateWith { versionName ->
val tagName = libsGroupsAndVersions.keys.firstOrNull { versionName.startsWith(it) }
val tagName = libsGroupsAndVersions.keys.firstOrNull { versionName == it }
val versionForTag = libsGroupsAndVersions[tagName]
val versionValue =
if (versionName.startsWith("COMPOSE") &&
Expand Down
4 changes: 2 additions & 2 deletions libraryversions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ CARDVIEW = { group = "androidx.cardview", atomicGroupVersion = "versions.CARDVIE
CAR_APP = { group = "androidx.car.app", atomicGroupVersion = "versions.CAR_APP" }
COLLECTION = { group = "androidx.collection", atomicGroupVersion = "versions.COLLECTION" }
COMPOSE_ANIMATION = { group = "org.jetbrains.compose.animation", atomicGroupVersion = "versions.COMPOSE" }
COMPOSE_COMPILER = { group = "org.jetbrains.compose.compiler", atomicGroupVersion = "versions.COMPOSE_COMPILER" }
COMPOSE_COMPILER = { group = "org.jetbrains.compose.compiler", atomicGroupVersion = "versions.COMPOSE" }
COMPOSE_DESKTOP = { group = "org.jetbrains.compose.desktop", atomicGroupVersion = "versions.COMPOSE" }
COMPOSE_FOUNDATION = { group = "org.jetbrains.compose.foundation", atomicGroupVersion = "versions.COMPOSE" }
COMPOSE_MATERIAL = { group = "org.jetbrains.compose.material", atomicGroupVersion = "versions.COMPOSE" }
COMPOSE_MATERIAL3 = { group = "org.jetbrains.compose.material3", atomicGroupVersion = "versions.COMPOSE_MATERIAL3" }
COMPOSE_MATERIAL3 = { group = "org.jetbrains.compose.material3", atomicGroupVersion = "versions.COMPOSE" }
COMPOSE_MATERIAL3_COMMON = { group = "org.jetbrains.compose.material3.common", atomicGroupVersion = "versions.COMPOSE_MATERIAL3_COMMON", overrideInclude = [ ":compose:material3:material3-common" ] }
COMPOSE_MATERIAL3_ADAPTIVE = { group = "org.jetbrains.compose.material3.adaptive", atomicGroupVersion = "versions.COMPOSE_MATERIAL3_ADAPTIVE" }
COMPOSE_RUNTIME = { group = "org.jetbrains.compose.runtime", atomicGroupVersion = "versions.COMPOSE" }
Expand Down
8 changes: 5 additions & 3 deletions mpp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ val libraryToComponents = mapOf(
ComposeComponent(":compose:material:material-icons-core"),
ComposeComponent(":compose:material:material-ripple"),
ComposeComponent(":compose:material3:material3-window-size-class"),
ComposeComponent(":compose:material3:adaptive:adaptive"),
ComposeComponent(":compose:material3:adaptive:adaptive-layout"),
ComposeComponent(":compose:material3:adaptive:adaptive-navigation"),
ComposeComponent(":compose:runtime:runtime", supportedPlatforms = ComposePlatforms.ALL),
ComposeComponent(":compose:runtime:runtime-saveable", supportedPlatforms = ComposePlatforms.ALL),
ComposeComponent(":compose:ui:ui"),
Expand Down Expand Up @@ -84,6 +81,11 @@ val libraryToComponents = mapOf(
ComposeComponent(":compose:ui:ui-unit"),
ComposeComponent(":compose:ui:ui-util"),
),
"COMPOSE_MATERIAL3_ADAPTIVE" to listOf(
ComposeComponent(":compose:material3:adaptive:adaptive"),
ComposeComponent(":compose:material3:adaptive:adaptive-layout"),
ComposeComponent(":compose:material3:adaptive:adaptive-navigation"),
),
"LIFECYCLE" to listOf(
ComposeComponent(
path = ":lifecycle:lifecycle-common",
Expand Down

0 comments on commit dc36893

Please sign in to comment.