diff --git a/examples/chat/gradle.properties b/examples/chat/gradle.properties index f4ce9a785c..6c87d8788d 100644 --- a/examples/chat/gradle.properties +++ b/examples/chat/gradle.properties @@ -2,6 +2,8 @@ kotlin.code.style=official xcodeproj=./iosApp android.useAndroidX=true org.gradle.jvmargs=-Xmx3g +org.gradle.configuration-cache=true +org.gradle.caching=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true kotlin.native.useEmbeddableCompilerJar=true diff --git a/examples/chat/gradle/wrapper/gradle-wrapper.properties b/examples/chat/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/chat/gradle/wrapper/gradle-wrapper.properties +++ b/examples/chat/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/chat/shared/build.gradle.kts b/examples/chat/shared/build.gradle.kts index 4ca6a52b6a..02a8803514 100644 --- a/examples/chat/shared/build.gradle.kts +++ b/examples/chat/shared/build.gradle.kts @@ -46,12 +46,16 @@ kotlin { } sourceSets { + all { + languageSettings { + optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") + } + } val commonMain by getting { dependencies { implementation(compose.ui) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.components.resources) implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.5.0") } @@ -97,8 +101,6 @@ android { compileSdk = 34 namespace = "org.jetbrains.chat" sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDirs("src/commonMain/resources") defaultConfig { minSdk = 26 diff --git a/examples/chat/shared/src/commonMain/resources/background.jpg b/examples/chat/shared/src/commonMain/composeResources/drawable/background.jpg similarity index 100% rename from examples/chat/shared/src/commonMain/resources/background.jpg rename to examples/chat/shared/src/commonMain/composeResources/drawable/background.jpg diff --git a/examples/chat/shared/src/commonMain/resources/stock1.jpg b/examples/chat/shared/src/commonMain/composeResources/drawable/stock1.jpg similarity index 100% rename from examples/chat/shared/src/commonMain/resources/stock1.jpg rename to examples/chat/shared/src/commonMain/composeResources/drawable/stock1.jpg diff --git a/examples/chat/shared/src/commonMain/resources/stock2.jpg b/examples/chat/shared/src/commonMain/composeResources/drawable/stock2.jpg similarity index 100% rename from examples/chat/shared/src/commonMain/resources/stock2.jpg rename to examples/chat/shared/src/commonMain/composeResources/drawable/stock2.jpg diff --git a/examples/chat/shared/src/commonMain/resources/stock3.jpg b/examples/chat/shared/src/commonMain/composeResources/drawable/stock3.jpg similarity index 100% rename from examples/chat/shared/src/commonMain/resources/stock3.jpg rename to examples/chat/shared/src/commonMain/composeResources/drawable/stock3.jpg diff --git a/examples/chat/shared/src/commonMain/resources/stock4.jpg b/examples/chat/shared/src/commonMain/composeResources/drawable/stock4.jpg similarity index 100% rename from examples/chat/shared/src/commonMain/resources/stock4.jpg rename to examples/chat/shared/src/commonMain/composeResources/drawable/stock4.jpg diff --git a/examples/chat/shared/src/commonMain/kotlin/ChatApp.kt b/examples/chat/shared/src/commonMain/kotlin/ChatApp.kt index 3cfc77889b..ebbc763287 100644 --- a/examples/chat/shared/src/commonMain/kotlin/ChatApp.kt +++ b/examples/chat/shared/src/commonMain/kotlin/ChatApp.kt @@ -18,6 +18,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.unit.sp +import chat_mpp.shared.generated.resources.* +import chat_mpp.shared.generated.resources.Res +import chat_mpp.shared.generated.resources.background import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.delay @@ -26,9 +29,9 @@ import org.jetbrains.compose.resources.painterResource val myUser = User("Me", picture = null) val friends = listOf( - User("Alex", picture = "stock1.jpg"), - User("Casey", picture = "stock2.jpg"), - User("Sam", picture = "stock3.jpg") + User("Alex", picture = Res.drawable.stock1), + User("Casey", picture = Res.drawable.stock2), + User("Sam", picture = Res.drawable.stock3) ) val friendMessages = listOf( "How's everybody doing today?", @@ -66,7 +69,7 @@ fun ChatApp(displayTextField: Boolean = true) { Theme { Surface { Box(modifier = Modifier.fillMaxSize()) { - Image(painterResource("background.jpg"), null, contentScale = ContentScale.Crop) + Image(painterResource(Res.drawable.background), null, contentScale = ContentScale.Crop) Column( modifier = Modifier.fillMaxSize() ) { diff --git a/examples/chat/shared/src/commonMain/kotlin/Data.kt b/examples/chat/shared/src/commonMain/kotlin/Data.kt index 821a70cd80..9fc6eff795 100644 --- a/examples/chat/shared/src/commonMain/kotlin/Data.kt +++ b/examples/chat/shared/src/commonMain/kotlin/Data.kt @@ -1,5 +1,7 @@ import androidx.compose.ui.graphics.Color import kotlinx.datetime.Clock +import org.jetbrains.compose.resources.DrawableResource +import org.jetbrains.compose.resources.ExperimentalResourceApi import kotlin.random.Random import kotlin.random.nextInt @@ -23,7 +25,7 @@ data class Message( data class User( val name: String, val color: Color = ColorProvider.getColor(), - val picture: String? + val picture: DrawableResource? ) object ColorProvider { diff --git a/examples/cocoapods-ios-example/gradle.properties b/examples/cocoapods-ios-example/gradle.properties index 666109effa..81c8543bad 100644 --- a/examples/cocoapods-ios-example/gradle.properties +++ b/examples/cocoapods-ios-example/gradle.properties @@ -1,5 +1,7 @@ #Gradle org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.configuration-cache=true +org.gradle.caching=true #Kotlin kotlin.code.style=official diff --git a/examples/cocoapods-ios-example/gradle/wrapper/gradle-wrapper.properties b/examples/cocoapods-ios-example/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/cocoapods-ios-example/gradle/wrapper/gradle-wrapper.properties +++ b/examples/cocoapods-ios-example/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/cocoapods-ios-example/shared/build.gradle.kts b/examples/cocoapods-ios-example/shared/build.gradle.kts index bd09f3c364..58b84a6290 100644 --- a/examples/cocoapods-ios-example/shared/build.gradle.kts +++ b/examples/cocoapods-ios-example/shared/build.gradle.kts @@ -32,7 +32,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.components.resources) } } @@ -49,11 +48,7 @@ kotlin { android { compileSdk = (findProperty("android.compileSdk") as String).toInt() namespace = "com.myapplication.common" - sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDirs("src/commonMain/resources") - defaultConfig { minSdk = (findProperty("android.minSdk") as String).toInt() } diff --git a/examples/cocoapods-ios-example/shared/src/commonMain/resources/compose-multiplatform.xml b/examples/cocoapods-ios-example/shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml similarity index 100% rename from examples/cocoapods-ios-example/shared/src/commonMain/resources/compose-multiplatform.xml rename to examples/cocoapods-ios-example/shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml diff --git a/examples/cocoapods-ios-example/shared/src/commonMain/kotlin/App.kt b/examples/cocoapods-ios-example/shared/src/commonMain/kotlin/App.kt index 0889bdd267..1b6f8fc57e 100644 --- a/examples/cocoapods-ios-example/shared/src/commonMain/kotlin/App.kt +++ b/examples/cocoapods-ios-example/shared/src/commonMain/kotlin/App.kt @@ -12,6 +12,8 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import cocoapodsiosexample.shared.generated.resources.Res +import cocoapodsiosexample.shared.generated.resources.compose_multiplatform import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.painterResource @@ -30,7 +32,7 @@ fun App() { } AnimatedVisibility(showImage) { Image( - painterResource("compose-multiplatform.xml"), + painterResource(Res.drawable.compose_multiplatform), null ) } diff --git a/examples/codeviewer/gradle.properties b/examples/codeviewer/gradle.properties index f4ce9a785c..6c87d8788d 100644 --- a/examples/codeviewer/gradle.properties +++ b/examples/codeviewer/gradle.properties @@ -2,6 +2,8 @@ kotlin.code.style=official xcodeproj=./iosApp android.useAndroidX=true org.gradle.jvmargs=-Xmx3g +org.gradle.configuration-cache=true +org.gradle.caching=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true kotlin.native.useEmbeddableCompilerJar=true diff --git a/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties b/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties +++ b/examples/codeviewer/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/codeviewer/shared/build.gradle.kts b/examples/codeviewer/shared/build.gradle.kts index c4d82d43d1..e058f68091 100644 --- a/examples/codeviewer/shared/build.gradle.kts +++ b/examples/codeviewer/shared/build.gradle.kts @@ -25,13 +25,17 @@ kotlin { } sourceSets { + all { + languageSettings { + optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") + } + } val commonMain by getting { dependencies { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) implementation(compose.materialIconsExtended) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) implementation(compose.components.resources) } } @@ -68,7 +72,6 @@ android { compileSdk = 34 namespace = "org.jetbrains.codeviewer.common" sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res", "src/commonMain/resources") defaultConfig { minSdk = 26 } diff --git a/examples/codeviewer/shared/src/androidMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt b/examples/codeviewer/shared/src/androidMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt deleted file mode 100644 index ad049b6045..0000000000 --- a/examples/codeviewer/shared/src/androidMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.jetbrains.codeviewer.platform - -import android.annotation.SuppressLint -import androidx.compose.runtime.Composable -import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight - -@SuppressLint("DiscouragedApi") -@Composable -actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font { - val context = LocalContext.current - val id = context.resources.getIdentifier(res, "font", context.packageName) - return Font(id, weight, style) -} \ No newline at end of file diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_bold.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_bold.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_bold.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_bold.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_bold_italic.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_bold_italic.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_bold_italic.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_bold_italic.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_extrabold.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_extrabold.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_extrabold.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_extrabold.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_extrabold_italic.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_extrabold_italic.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_extrabold_italic.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_extrabold_italic.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_italic.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_italic.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_italic.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_italic.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_medium.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_medium.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_medium.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_medium.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_medium_italic.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_medium_italic.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_medium_italic.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_medium_italic.ttf diff --git a/examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_regular.ttf b/examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_regular.ttf similarity index 100% rename from examples/codeviewer/shared/src/commonMain/resources/font/jetbrainsmono_regular.ttf rename to examples/codeviewer/shared/src/commonMain/composeResources/font/jetbrainsmono_regular.ttf diff --git a/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt b/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt deleted file mode 100644 index d22698e61b..0000000000 --- a/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt +++ /dev/null @@ -1,9 +0,0 @@ -package org.jetbrains.codeviewer.platform - -import androidx.compose.runtime.Composable -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight - -@Composable -expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font \ No newline at end of file diff --git a/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/common/Fonts.kt b/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/common/Fonts.kt index 70461d77e5..869b428498 100644 --- a/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/common/Fonts.kt +++ b/examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/common/Fonts.kt @@ -4,59 +4,53 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight -import org.jetbrains.codeviewer.platform.font +import codeviewer.shared.generated.resources.Res +import codeviewer.shared.generated.resources.* +import org.jetbrains.compose.resources.Font object Fonts { @Composable fun jetbrainsMono() = FontFamily( - font( - "JetBrains Mono", - "jetbrainsmono_regular", + Font( + Res.font.jetbrainsmono_regular, FontWeight.Normal, FontStyle.Normal ), - font( - "JetBrains Mono", - "jetbrainsmono_italic", + Font( + Res.font.jetbrainsmono_italic, FontWeight.Normal, FontStyle.Italic ), - font( - "JetBrains Mono", - "jetbrainsmono_bold", + Font( + Res.font.jetbrainsmono_bold, FontWeight.Bold, FontStyle.Normal ), - font( - "JetBrains Mono", - "jetbrainsmono_bold_italic", + Font( + Res.font.jetbrainsmono_bold_italic, FontWeight.Bold, FontStyle.Italic ), - font( - "JetBrains Mono", - "jetbrainsmono_extrabold", + Font( + Res.font.jetbrainsmono_extrabold, FontWeight.ExtraBold, FontStyle.Normal ), - font( - "JetBrains Mono", - "jetbrainsmono_extrabold_italic", + Font( + Res.font.jetbrainsmono_extrabold_italic, FontWeight.ExtraBold, FontStyle.Italic ), - font( - "JetBrains Mono", - "jetbrainsmono_medium", + Font( + Res.font.jetbrainsmono_medium, FontWeight.Medium, FontStyle.Normal ), - font( - "JetBrains Mono", - "jetbrainsmono_medium_italic", + Font( + Res.font.jetbrainsmono_medium_italic, FontWeight.Medium, FontStyle.Italic ) diff --git a/examples/codeviewer/shared/src/desktopMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt b/examples/codeviewer/shared/src/desktopMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt deleted file mode 100644 index fdecfe3ceb..0000000000 --- a/examples/codeviewer/shared/src/desktopMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.jetbrains.codeviewer.platform - -import androidx.compose.runtime.Composable -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight - -@Composable -actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font = - androidx.compose.ui.text.platform.Font("font/$res.ttf", weight, style) \ No newline at end of file diff --git a/examples/codeviewer/shared/src/iosMain/resources/EditorView.kt b/examples/codeviewer/shared/src/iosMain/composeResources/EditorView.kt similarity index 100% rename from examples/codeviewer/shared/src/iosMain/resources/EditorView.kt rename to examples/codeviewer/shared/src/iosMain/composeResources/EditorView.kt diff --git a/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/File.kt b/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/File.kt index 889ee767cb..2a1dee9218 100644 --- a/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/File.kt +++ b/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/File.kt @@ -2,12 +2,12 @@ package org.jetbrains.codeviewer.platform +import codeviewer.shared.generated.resources.Res import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.runBlocking import org.jetbrains.codeviewer.util.EmptyTextLines import org.jetbrains.codeviewer.util.TextLines import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.resource class VirtualFile(override val name: String, override val isDirectory: Boolean, val textLines: TextLines, override val children: List = listOf()): File { override val hasChildren: Boolean @@ -34,7 +34,7 @@ actual val HomeFolder: File get() = VirtualFile("files", VirtualFile("EditorView.kt", isDirectory = false, textLines = runBlocking { - resource("EditorView.kt").readBytes() + Res.readBytes("EditorView.kt") }.toTextLines() ) ) diff --git a/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt b/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt deleted file mode 100644 index 218bd86d48..0000000000 --- a/examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.jetbrains.codeviewer.platform - -import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight -import kotlinx.coroutines.runBlocking -import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.resource - -private val cache: MutableMap = mutableMapOf() - -@OptIn(ExperimentalResourceApi::class) -@Composable -actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font { - return cache.getOrPut(res) { - val byteArray = runBlocking { - resource("font/$res.ttf").readBytes() - } - androidx.compose.ui.text.platform.Font(res, byteArray, weight, style) - } -} \ No newline at end of file diff --git a/examples/graphics-2d/gradle.properties b/examples/graphics-2d/gradle.properties index c444bd01b8..160ad041b9 100644 --- a/examples/graphics-2d/gradle.properties +++ b/examples/graphics-2d/gradle.properties @@ -2,6 +2,8 @@ kotlin.code.style=official xcodeproj=./iosApp android.useAndroidX=true org.gradle.jvmargs=-Xmx3g +org.gradle.configuration-cache=true +org.gradle.caching=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true kotlin.native.useEmbeddableCompilerJar=true diff --git a/examples/graphics-2d/gradle/wrapper/gradle-wrapper.properties b/examples/graphics-2d/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/graphics-2d/gradle/wrapper/gradle-wrapper.properties +++ b/examples/graphics-2d/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/graphics-2d/shared/build.gradle.kts b/examples/graphics-2d/shared/build.gradle.kts index ede41c9586..42e54b01e0 100644 --- a/examples/graphics-2d/shared/build.gradle.kts +++ b/examples/graphics-2d/shared/build.gradle.kts @@ -38,13 +38,17 @@ kotlin { } sourceSets { + all { + languageSettings { + optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") + } + } commonMain.dependencies { implementation(compose.ui) implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material3) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation("org.jetbrains.compose.components:components-resources:1.6.0-dev1306") + implementation(compose.components.resources) } commonTest.dependencies { implementation(kotlin("test")) @@ -66,8 +70,6 @@ android { compileSdk = 34 namespace = "org.jetbrains.Graphics2D" sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDirs("src/commonMain/resources") defaultConfig { minSdk = 26 diff --git a/examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/clock.png b/examples/graphics-2d/shared/src/commonMain/composeResources/drawable/clock.png similarity index 100% rename from examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/clock.png rename to examples/graphics-2d/shared/src/commonMain/composeResources/drawable/clock.png diff --git a/examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/compose_community_primary.xml b/examples/graphics-2d/shared/src/commonMain/composeResources/drawable/compose_community_primary.xml similarity index 100% rename from examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/compose_community_primary.xml rename to examples/graphics-2d/shared/src/commonMain/composeResources/drawable/compose_community_primary.xml diff --git a/examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/flag.png b/examples/graphics-2d/shared/src/commonMain/composeResources/drawable/flag.png similarity index 100% rename from examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/flag.png rename to examples/graphics-2d/shared/src/commonMain/composeResources/drawable/flag.png diff --git a/examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/mine.png b/examples/graphics-2d/shared/src/commonMain/composeResources/drawable/mine.png similarity index 100% rename from examples/graphics-2d/shared/src/commonMain/resources/composeRes/images/mine.png rename to examples/graphics-2d/shared/src/commonMain/composeResources/drawable/mine.png diff --git a/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/MineSweeper.common.kt b/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/MineSweeper.common.kt index 5f4442cd59..99d3acae54 100644 --- a/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/MineSweeper.common.kt +++ b/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/MineSweeper.common.kt @@ -9,16 +9,10 @@ import androidx.compose.material3.* import androidx.compose.runtime.* import androidx.compose.ui.* import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.unit.* -import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.ImageResource -import org.jetbrains.compose.resources.painterResource +import graphics_2d.shared.generated.resources.* import kotlin.math.max -@OptIn(ExperimentalResourceApi::class) -@Composable -fun loadImage(img: ImageResource): Painter = painterResource(img) expect fun hasRightClick(): Boolean @@ -78,9 +72,9 @@ fun MineSweeper(requestWindowSize: ((width: Dp, height: Dp) -> Unit)? = null) = Row { Column { val bombsLeft = max(game.bombs - game.flagsSet, 0) - IndicatorWithIcon(ImageResource("composeRes/images/clock.png"), "Seconds", game.seconds) + IndicatorWithIcon(Res.drawable.clock, "Seconds", game.seconds) Box(modifier = Modifier.size(2.dp)) {} - IndicatorWithIcon(ImageResource("composeRes/images/mine.png"), "Bombs Left", bombsLeft) + IndicatorWithIcon(Res.drawable.mine, "Bombs Left", bombsLeft) } Column(modifier = Modifier.padding(8.dp)) { diff --git a/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/Widgets.kt b/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/Widgets.kt index 7a4ddded0f..df151d0fbb 100644 --- a/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/Widgets.kt +++ b/examples/graphics-2d/shared/src/commonMain/kotlin/minesweeper/Widgets.kt @@ -17,7 +17,9 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import org.jetbrains.compose.resources.ImageResource +import graphics_2d.shared.generated.resources.* +import org.jetbrains.compose.resources.DrawableResource +import org.jetbrains.compose.resources.painterResource @Composable fun OpenedCell(cell: Cell) { @@ -31,9 +33,9 @@ fun OpenedCell(cell: Cell) { } @Composable -fun CellWithIcon(img: ImageResource, alt: String) { +fun CellWithIcon(img: DrawableResource, alt: String) { Image( - painter = loadImage(img), + painter = painterResource(img), contentDescription = alt, modifier = Modifier.fillMaxSize().padding(Dp(4.0f)) ) @@ -41,16 +43,16 @@ fun CellWithIcon(img: ImageResource, alt: String) { @Composable fun Mine() { - CellWithIcon(ImageResource("composeRes/images/mine.png"), alt = "Bomb") + CellWithIcon(Res.drawable.mine, alt = "Bomb") } @Composable fun Flag() { - CellWithIcon(ImageResource("composeRes/images/flag.png"), alt = "Flag") + CellWithIcon(Res.drawable.flag, alt = "Flag") } @Composable -fun IndicatorWithIcon(img: ImageResource, alt: String, value: Int) { +fun IndicatorWithIcon(img: DrawableResource, alt: String, value: Int) { Box(modifier = Modifier.background(Color(0x8e, 0x6e, 0x0e))) { Row(verticalAlignment = Alignment.CenterVertically) { Box(modifier = Modifier.size(40.dp, 40.dp)) { diff --git a/examples/graphics-2d/shared/src/commonMain/kotlin/visualeffects/RotatingWords.kt b/examples/graphics-2d/shared/src/commonMain/kotlin/visualeffects/RotatingWords.kt index 8306b1da48..e896fafe85 100644 --- a/examples/graphics-2d/shared/src/commonMain/kotlin/visualeffects/RotatingWords.kt +++ b/examples/graphics-2d/shared/src/commonMain/kotlin/visualeffects/RotatingWords.kt @@ -20,11 +20,9 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.IntOffset import androidx.compose.ui.unit.dp -import org.jetbrains.compose.resources.ExperimentalResourceApi -import org.jetbrains.compose.resources.ImageResource +import graphics_2d.shared.generated.resources.* import org.jetbrains.compose.resources.painterResource -@OptIn(ExperimentalResourceApi::class) @Composable fun Words() { val duration = 5000 @@ -47,7 +45,7 @@ fun Words() { ) ) - val logoImg = painterResource(ImageResource("composeRes/images/compose_community_primary.xml")) + val logoImg = painterResource(Res.drawable.compose_community_primary) val baseLogo = DpOffset(350.dp, 270.dp) diff --git a/examples/html/compose-bird/gradle.properties b/examples/html/compose-bird/gradle.properties index b61a2e5972..52bac29b80 100644 --- a/examples/html/compose-bird/gradle.properties +++ b/examples/html/compose-bird/gradle.properties @@ -1,3 +1,5 @@ kotlin.code.style=official kotlin.version=1.9.22 compose.version=1.6.0 +org.gradle.configuration-cache=true +org.gradle.caching=true diff --git a/examples/html/compose-bird/gradle/wrapper/gradle-wrapper.properties b/examples/html/compose-bird/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/html/compose-bird/gradle/wrapper/gradle-wrapper.properties +++ b/examples/html/compose-bird/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/html/compose-in-js/gradle.properties b/examples/html/compose-in-js/gradle.properties index 7cb358ab31..b370a30cf3 100644 --- a/examples/html/compose-in-js/gradle.properties +++ b/examples/html/compose-in-js/gradle.properties @@ -2,3 +2,5 @@ kotlin.code.style=official kotlin.js.webpack.major.version=4 kotlin.version=1.9.22 compose.version=1.6.0 +org.gradle.configuration-cache=true +org.gradle.caching=true diff --git a/examples/html/compose-in-js/gradle/wrapper/gradle-wrapper.properties b/examples/html/compose-in-js/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/html/compose-in-js/gradle/wrapper/gradle-wrapper.properties +++ b/examples/html/compose-in-js/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/html/landing/gradle.properties b/examples/html/landing/gradle.properties index b61a2e5972..52bac29b80 100644 --- a/examples/html/landing/gradle.properties +++ b/examples/html/landing/gradle.properties @@ -1,3 +1,5 @@ kotlin.code.style=official kotlin.version=1.9.22 compose.version=1.6.0 +org.gradle.configuration-cache=true +org.gradle.caching=true diff --git a/examples/html/landing/gradle/wrapper/gradle-wrapper.properties b/examples/html/landing/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/html/landing/gradle/wrapper/gradle-wrapper.properties +++ b/examples/html/landing/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/html/with-react/gradle.properties b/examples/html/with-react/gradle.properties index b61a2e5972..52bac29b80 100644 --- a/examples/html/with-react/gradle.properties +++ b/examples/html/with-react/gradle.properties @@ -1,3 +1,5 @@ kotlin.code.style=official kotlin.version=1.9.22 compose.version=1.6.0 +org.gradle.configuration-cache=true +org.gradle.caching=true diff --git a/examples/html/with-react/gradle/wrapper/gradle-wrapper.properties b/examples/html/with-react/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/html/with-react/gradle/wrapper/gradle-wrapper.properties +++ b/examples/html/with-react/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/imageviewer/gradle.properties b/examples/imageviewer/gradle.properties index ca5d42305c..32254b6472 100644 --- a/examples/imageviewer/gradle.properties +++ b/examples/imageviewer/gradle.properties @@ -2,6 +2,8 @@ kotlin.code.style=official xcodeproj=iosApp android.useAndroidX=true org.gradle.jvmargs=-Xmx3g +org.gradle.configuration-cache=true +org.gradle.caching=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true kotlin.mpp.androidSourceSetLayoutVersion=2 diff --git a/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties b/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties +++ b/examples/imageviewer/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/intellij-plugin/build.gradle.kts b/examples/intellij-plugin/build.gradle.kts index bd447c8d23..226d8f08c1 100644 --- a/examples/intellij-plugin/build.gradle.kts +++ b/examples/intellij-plugin/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("org.jetbrains.intellij") version "1.15.0" + id("org.jetbrains.intellij") version "1.17.2" java kotlin("jvm") id("org.jetbrains.compose") diff --git a/examples/intellij-plugin/gradle.properties b/examples/intellij-plugin/gradle.properties index b61a2e5972..52bac29b80 100644 --- a/examples/intellij-plugin/gradle.properties +++ b/examples/intellij-plugin/gradle.properties @@ -1,3 +1,5 @@ kotlin.code.style=official kotlin.version=1.9.22 compose.version=1.6.0 +org.gradle.configuration-cache=true +org.gradle.caching=true diff --git a/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties b/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties +++ b/examples/intellij-plugin/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/interop/ios-compose-in-swiftui/gradle/wrapper/gradle-wrapper.properties b/examples/interop/ios-compose-in-swiftui/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/interop/ios-compose-in-swiftui/gradle/wrapper/gradle-wrapper.properties +++ b/examples/interop/ios-compose-in-swiftui/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/interop/ios-compose-in-swiftui/shared/build.gradle.kts b/examples/interop/ios-compose-in-swiftui/shared/build.gradle.kts index 26a5ced104..9e50c9efa2 100644 --- a/examples/interop/ios-compose-in-swiftui/shared/build.gradle.kts +++ b/examples/interop/ios-compose-in-swiftui/shared/build.gradle.kts @@ -27,8 +27,6 @@ kotlin { implementation(compose.ui) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) } } val iosMain by creating { diff --git a/examples/interop/ios-compose-in-uikit/gradle/wrapper/gradle-wrapper.properties b/examples/interop/ios-compose-in-uikit/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/interop/ios-compose-in-uikit/gradle/wrapper/gradle-wrapper.properties +++ b/examples/interop/ios-compose-in-uikit/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/interop/ios-compose-in-uikit/shared/build.gradle.kts b/examples/interop/ios-compose-in-uikit/shared/build.gradle.kts index 26a5ced104..9e50c9efa2 100644 --- a/examples/interop/ios-compose-in-uikit/shared/build.gradle.kts +++ b/examples/interop/ios-compose-in-uikit/shared/build.gradle.kts @@ -27,8 +27,6 @@ kotlin { implementation(compose.ui) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) } } val iosMain by creating { diff --git a/examples/interop/ios-swiftui-in-compose/gradle/wrapper/gradle-wrapper.properties b/examples/interop/ios-swiftui-in-compose/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/interop/ios-swiftui-in-compose/gradle/wrapper/gradle-wrapper.properties +++ b/examples/interop/ios-swiftui-in-compose/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/interop/ios-swiftui-in-compose/shared/build.gradle.kts b/examples/interop/ios-swiftui-in-compose/shared/build.gradle.kts index 26a5ced104..9e50c9efa2 100644 --- a/examples/interop/ios-swiftui-in-compose/shared/build.gradle.kts +++ b/examples/interop/ios-swiftui-in-compose/shared/build.gradle.kts @@ -27,8 +27,6 @@ kotlin { implementation(compose.ui) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) } } val iosMain by creating { diff --git a/examples/interop/ios-uikit-in-compose/gradle/wrapper/gradle-wrapper.properties b/examples/interop/ios-uikit-in-compose/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/interop/ios-uikit-in-compose/gradle/wrapper/gradle-wrapper.properties +++ b/examples/interop/ios-uikit-in-compose/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/interop/ios-uikit-in-compose/shared/build.gradle.kts b/examples/interop/ios-uikit-in-compose/shared/build.gradle.kts index 26a5ced104..9e50c9efa2 100644 --- a/examples/interop/ios-uikit-in-compose/shared/build.gradle.kts +++ b/examples/interop/ios-uikit-in-compose/shared/build.gradle.kts @@ -27,8 +27,6 @@ kotlin { implementation(compose.ui) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) } } val iosMain by creating { diff --git a/examples/issues/gradle/wrapper/gradle-wrapper.properties b/examples/issues/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/issues/gradle/wrapper/gradle-wrapper.properties +++ b/examples/issues/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/notepad/gradle.properties b/examples/notepad/gradle.properties index 98aed13c99..5227c1f440 100644 --- a/examples/notepad/gradle.properties +++ b/examples/notepad/gradle.properties @@ -2,3 +2,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 kotlin.code.style=official kotlin.version=1.9.22 compose.version=1.6.0 +org.gradle.configuration-cache=true +org.gradle.caching=true diff --git a/examples/notepad/gradle/wrapper/gradle-wrapper.properties b/examples/notepad/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/notepad/gradle/wrapper/gradle-wrapper.properties +++ b/examples/notepad/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/todoapp-lite/gradle.properties b/examples/todoapp-lite/gradle.properties index f4ce9a785c..6c87d8788d 100755 --- a/examples/todoapp-lite/gradle.properties +++ b/examples/todoapp-lite/gradle.properties @@ -2,6 +2,8 @@ kotlin.code.style=official xcodeproj=./iosApp android.useAndroidX=true org.gradle.jvmargs=-Xmx3g +org.gradle.configuration-cache=true +org.gradle.caching=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true kotlin.native.useEmbeddableCompilerJar=true diff --git a/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties b/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties +++ b/examples/todoapp-lite/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/todoapp-lite/shared/build.gradle.kts b/examples/todoapp-lite/shared/build.gradle.kts index fd401d7144..c1b5b905e6 100755 --- a/examples/todoapp-lite/shared/build.gradle.kts +++ b/examples/todoapp-lite/shared/build.gradle.kts @@ -30,8 +30,6 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) } } val androidMain by getting { @@ -66,7 +64,6 @@ android { namespace = "example.todoapp.lite.common" sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDirs("src/commonMain/resources") defaultConfig { minSdk = 26 diff --git a/examples/widgets-gallery/gradle.properties b/examples/widgets-gallery/gradle.properties index 96596e8d80..8170c07ca7 100644 --- a/examples/widgets-gallery/gradle.properties +++ b/examples/widgets-gallery/gradle.properties @@ -2,6 +2,8 @@ kotlin.code.style=official xcodeproj=./iosApp android.useAndroidX=true org.gradle.jvmargs=-Xmx3g +org.gradle.configuration-cache=true +org.gradle.caching=true org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true kotlin.native.useEmbeddableCompilerJar=true diff --git a/examples/widgets-gallery/gradle/wrapper/gradle-wrapper.properties b/examples/widgets-gallery/gradle/wrapper/gradle-wrapper.properties index 84a0b92f9a..17655d0ef2 100644 --- a/examples/widgets-gallery/gradle/wrapper/gradle-wrapper.properties +++ b/examples/widgets-gallery/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/examples/widgets-gallery/shared/build.gradle.kts b/examples/widgets-gallery/shared/build.gradle.kts index fadb5ec3a7..546fb28c75 100644 --- a/examples/widgets-gallery/shared/build.gradle.kts +++ b/examples/widgets-gallery/shared/build.gradle.kts @@ -44,8 +44,7 @@ kotlin { implementation(compose.foundation) implementation(compose.material) implementation(compose.materialIconsExtended) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation("org.jetbrains.compose.components:components-resources:${project.property("compose.version")}") + implementation(compose.components.resources) } } val androidMain by getting { @@ -80,8 +79,6 @@ android { compileSdk = 34 namespace = "org.jetbrains.compose.demo.widgets.platform" sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") - sourceSets["main"].res.srcDirs("src/androidMain/res") - sourceSets["main"].resources.srcDirs("src/commonMain/resources") defaultConfig { minSdk = 26