-
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.
Turn off Compose resources sync when third party resources plugins ar… (
#3469) * Turn off Compose resources sync when third party resources plugins are used * Fix Gradle 7.x test kit check
- Loading branch information
1 parent
e888495
commit 44376fd
Showing
14 changed files
with
337 additions
and
1 deletion.
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
53 changes: 53 additions & 0 deletions
53
gradle-plugins/compose/src/test/test-projects/misc/iosMokoResources/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,53 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.multiplatform" | ||
id "org.jetbrains.compose" | ||
id "dev.icerock.mobile.multiplatform-resources" | ||
} | ||
|
||
kotlin { | ||
iosX64 { | ||
binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
iosArm64 { | ||
binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
iosSimulatorArm64 { | ||
binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
def commonMain = named("commonMain") { | ||
dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation("dev.icerock.moko:resources-compose:MOKO_RESOURCES_PLUGIN_VERSION_PLACEHOLDER") // for compose multiplatform | ||
} | ||
} | ||
def iosMain = create("iosMain") { | ||
dependsOn(commonMain.get()) | ||
} | ||
named("iosX64Main") { | ||
dependsOn(iosMain) | ||
} | ||
named("iosArm64Main") { | ||
dependsOn(iosMain) | ||
} | ||
named("iosSimulatorArm64Main") { | ||
dependsOn(iosMain) | ||
} | ||
} | ||
} | ||
|
||
multiplatformResources { | ||
multiplatformResourcesPackage = "org.example" | ||
} |
1 change: 1 addition & 0 deletions
1
gradle-plugins/compose/src/test/test-projects/misc/iosMokoResources/gradle.properties
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 @@ | ||
org.jetbrains.compose.experimental.uikit.enabled=true |
13 changes: 13 additions & 0 deletions
13
gradle-plugins/compose/src/test/test-projects/misc/iosMokoResources/settings.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,13 @@ | ||
pluginManagement { | ||
plugins { | ||
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER' | ||
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER' | ||
id 'dev.icerock.mobile.multiplatform-resources' version 'MOKO_RESOURCES_PLUGIN_VERSION_PLACEHOLDER' | ||
} | ||
repositories { | ||
mavenLocal() | ||
gradlePluginPortal() | ||
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" } | ||
} | ||
} | ||
rootProject.name = "iosResources" |
10 changes: 10 additions & 0 deletions
10
...plugins/compose/src/test/test-projects/misc/iosMokoResources/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.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
fun App() { | ||
MaterialTheme { | ||
Text("Hello, World!") | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
gradle-plugins/compose/src/test/test-projects/misc/iosResources/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,48 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.multiplatform" | ||
id "org.jetbrains.compose" | ||
} | ||
|
||
kotlin { | ||
iosX64 { | ||
binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
iosArm64 { | ||
binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
iosSimulatorArm64 { | ||
binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
def commonMain = named("commonMain") { | ||
dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material) | ||
implementation(compose.components.resources) | ||
} | ||
} | ||
def iosMain = create("iosMain") { | ||
dependsOn(commonMain.get()) | ||
} | ||
named("iosX64Main") { | ||
dependsOn(iosMain) | ||
} | ||
named("iosArm64Main") { | ||
dependsOn(iosMain) | ||
} | ||
named("iosSimulatorArm64Main") { | ||
dependsOn(iosMain) | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
gradle-plugins/compose/src/test/test-projects/misc/iosResources/gradle.properties
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 @@ | ||
org.jetbrains.compose.experimental.uikit.enabled=true |
12 changes: 12 additions & 0 deletions
12
gradle-plugins/compose/src/test/test-projects/misc/iosResources/settings.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,12 @@ | ||
pluginManagement { | ||
plugins { | ||
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER' | ||
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER' | ||
} | ||
repositories { | ||
mavenLocal() | ||
gradlePluginPortal() | ||
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" } | ||
} | ||
} | ||
rootProject.name = "iosResources" |
38 changes: 38 additions & 0 deletions
38
gradle-plugins/compose/src/test/test-projects/misc/iosResources/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,38 @@ | ||
import androidx.compose.animation.AnimatedVisibility | ||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
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 | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import org.jetbrains.compose.resources.ExperimentalResourceApi | ||
import org.jetbrains.compose.resources.painterResource | ||
|
||
@OptIn(ExperimentalResourceApi::class) | ||
@Composable | ||
fun App() { | ||
MaterialTheme { | ||
var greetingText by remember { mutableStateOf("Hello, World!") } | ||
var showImage by remember { mutableStateOf(false) } | ||
Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { | ||
Button(onClick = { | ||
showImage = !showImage | ||
}) { | ||
Text(greetingText) | ||
} | ||
AnimatedVisibility(showImage) { | ||
Image( | ||
painterResource("compose-multiplatform.xml"), | ||
null | ||
) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.