-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cache kind management with nested subprojects (#3519)
* Fix cache kind management with nested subprojects Previously, cache kind property management worked incorrectly when Compose Gradle plugin was applied to both parent and child subprojects, e.g. :compose-subproject-1:compose-subproject-2. With this example the plugin would successfully set the property for compose-subproject-1, but then for compose-subproject-2 the following snippet would fail: ``` if (project.hasProperty(targetCacheKindPropertyName)) { project.setProperty(targetCacheKindPropertyName, NONE_VALUE) } ``` because project.hasProperty would have return true (because it checks parent subproject properties too), but project.setProperty would fail, because parent project's properties are read only. Warnings were also handled incorrectly in this case, because during the configuration of compose-subproject-1 we might set `kotlin.native.cacheKind.ios*=none`, which would then cause a warning during the configuration of compose-subproject-2. To avoid incorrect warnings, we now record the snapshot of relevant properties during Compose Multiplatform build service initialization Resolves #3515 * Fix issues from code review
- Loading branch information
1 parent
5eda586
commit 350a5df
Showing
11 changed files
with
194 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
gradle-plugins/compose/src/test/test-projects/misc/nativeCacheKind/subproject/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.multiplatform" | ||
id "org.jetbrains.compose" | ||
} | ||
|
||
kotlin { | ||
iosX64 { | ||
binaries.framework { | ||
isStatic = true | ||
baseName = "shared" | ||
} | ||
} | ||
iosArm64 { | ||
binaries.framework { | ||
isStatic = true | ||
baseName = "shared" | ||
} | ||
} | ||
|
||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(compose.runtime) | ||
} | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...mpose/src/test/test-projects/misc/nativeCacheKind/subproject/src/commonMain/kotlin/App.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
|
||
@Composable | ||
fun App() { | ||
var text by remember { mutableStateOf("Hello, World!") } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...lugins/compose/src/test/test-projects/misc/nativeCacheKindWarning/subproject/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.multiplatform" | ||
id "org.jetbrains.compose" | ||
} | ||
|
||
kotlin { | ||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
macosX64() | ||
macosArm64() | ||
|
||
sourceSets { | ||
commonMain { | ||
dependencies { | ||
implementation(compose.runtime) | ||
} | ||
} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...rc/test/test-projects/misc/nativeCacheKindWarning/subproject/src/commonMain/kotlin/App.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
|
||
@Composable | ||
fun App() { | ||
var text by remember { mutableStateOf("Hello, World!") } | ||
} |