diff --git a/components/AnimatedImage/demo/build.gradle.kts b/components/AnimatedImage/demo/build.gradle.kts index 36fd16e697..6c36cc912b 100644 --- a/components/AnimatedImage/demo/build.gradle.kts +++ b/components/AnimatedImage/demo/build.gradle.kts @@ -1,15 +1,17 @@ -import org.jetbrains.compose.compose -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { kotlin("multiplatform") id("org.jetbrains.compose") } kotlin { - jvm {} + jvm() sourceSets { - named("jvmMain") { + all { + languageSettings { + optIn("kotlin.RequiresOptIn") + } + } + val jvmMain by getting { dependencies { implementation(compose.desktop.currentOs) implementation(project(":AnimatedImage:library")) @@ -22,8 +24,4 @@ compose.desktop { application { mainClass = "org.jetbrains.compose.animatedimage.demo.MainKt" } -} - -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" } \ No newline at end of file diff --git a/components/AnimatedImage/library/build.gradle.kts b/components/AnimatedImage/library/build.gradle.kts index 58524776df..a9e34b5cec 100644 --- a/components/AnimatedImage/library/build.gradle.kts +++ b/components/AnimatedImage/library/build.gradle.kts @@ -1,6 +1,3 @@ -import org.jetbrains.compose.compose -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { kotlin("multiplatform") id("org.jetbrains.compose") @@ -9,25 +6,22 @@ plugins { kotlin { jvm("desktop") - sourceSets { - named("commonMain") { + all { + languageSettings { + optIn("kotlin.RequiresOptIn") + } + } + val commonMain by getting { dependencies { api(compose.runtime) api(compose.foundation) api(project(":resources:library")) - } } - named("desktopMain") {} } } -// TODO it seems that argument isn't applied to the common sourceSet. Figure out why -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" -} - configureMavenPublication( groupId = "org.jetbrains.compose.components", artifactId = "components-animatedimage", diff --git a/components/SplitPane/demo/build.gradle.kts b/components/SplitPane/demo/build.gradle.kts index 7244dff140..8ef6caaa6b 100644 --- a/components/SplitPane/demo/build.gradle.kts +++ b/components/SplitPane/demo/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.compose.compose -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("multiplatform") @@ -7,9 +6,15 @@ plugins { } kotlin { - jvm {} + jvm() sourceSets { - named("jvmMain") { + all { + languageSettings { + optIn("kotlin.RequiresOptIn") + } + } + + val jvmMain by getting { dependencies { implementation(compose.desktop.currentOs) implementation(project(":SplitPane:library")) @@ -22,8 +27,4 @@ compose.desktop { application { mainClass = "org.jetbrains.compose.splitpane.demo.MainKt" } -} - -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" } \ No newline at end of file diff --git a/components/SplitPane/library/build.gradle.kts b/components/SplitPane/library/build.gradle.kts index a5eccf755d..4b3891c1ff 100644 --- a/components/SplitPane/library/build.gradle.kts +++ b/components/SplitPane/library/build.gradle.kts @@ -1,6 +1,3 @@ -import org.jetbrains.compose.compose -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { kotlin("multiplatform") id("org.jetbrains.compose") @@ -11,21 +8,21 @@ kotlin { jvm("desktop") sourceSets { - named("commonMain") { + all { + languageSettings { + optIn("kotlin.RequiresOptIn") + } + } + + val commonMain by getting { dependencies { api(compose.runtime) api(compose.foundation) } } - named("desktopMain") {} } } -// TODO it seems that argument isn't applied to the common sourceSet. Figure out why -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" -} - configureMavenPublication( groupId = "org.jetbrains.compose.components", artifactId = "components-splitpane", diff --git a/components/build.gradle.kts b/components/build.gradle.kts index 29727b3274..d09b33a6dc 100644 --- a/components/build.gradle.kts +++ b/components/build.gradle.kts @@ -3,15 +3,6 @@ plugins { id("com.android.library") apply false } -allprojects { - repositories { - mavenLocal() // mavenLocal should be the first to get the correct version of skiko during a local build. - google() - mavenCentral() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - } -} - subprojects { version = findProperty("deploy.version") ?: property("compose.version")!! diff --git a/components/gradle.properties b/components/gradle.properties index c52d6fe71c..1e8c6e79b3 100644 --- a/components/gradle.properties +++ b/components/gradle.properties @@ -1,21 +1,25 @@ -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +#Gradle +org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.caching=true +#org.gradle.configuration-cache=true //stable since kotlin 1.9.20 + +#Android android.useAndroidX=true -android.enableJetifier=true -kotlin.code.style=official -# __KOTLIN_COMPOSE_VERSION__ -kotlin.version=1.8.22 -# __LATEST_COMPOSE_RELEASE_VERSION__ -compose.version=1.5.10-rc01 -agp.version=7.3.1 + +#Versions +kotlin.version=1.9.10 +compose.version=1.5.3 +agp.version=8.1.2 + +#Compose org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true - -kotlin.native.useEmbeddableCompilerJar=true -kotlin.native.enableDependencyPropagation=false -kotlin.mpp.enableGranularSourceSetsMetadata=true -# Enable kotlin/native experimental memory model -kotlin.native.binary.memoryModel=experimental compose.desktop.verbose=true + +#Kotlin +kotlin.code.style=official +kotlin.js.compiler=ir kotlin.js.webpack.major.version=4 -xcodeproj=./resources/demo/iosApp +kotlin.native.useEmbeddableCompilerJar=true +kotlin.native.binary.memoryModel=experimental \ No newline at end of file diff --git a/components/gradle/wrapper/gradle-wrapper.properties b/components/gradle/wrapper/gradle-wrapper.properties index ae04661ee7..e411586a54 100644 --- a/components/gradle/wrapper/gradle-wrapper.properties +++ b/components/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/components/resources/demo/androidApp/build.gradle.kts b/components/resources/demo/androidApp/build.gradle.kts index 3c2f0857ff..122f5e1123 100644 --- a/components/resources/demo/androidApp/build.gradle.kts +++ b/components/resources/demo/androidApp/build.gradle.kts @@ -4,25 +4,25 @@ plugins { id("org.jetbrains.compose") } -dependencies { - implementation(project(":resources:demo:shared")) - implementation("androidx.appcompat:appcompat:1.5.1") - implementation("androidx.activity:activity-compose:1.6.1") - implementation("androidx.compose.foundation:foundation:1.3.1") - implementation("androidx.compose.ui:ui:1.3.1") -} - android { - compileSdk = 33 + compileSdk = 34 + namespace = "org.jetbrains.compose.resources.demo" defaultConfig { applicationId = "me.user.androidApp" minSdk = 21 - targetSdk = 33 + targetSdk = 34 versionCode = 1 versionName = "1.0" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + dependencies { + implementation(project(":resources:demo:shared")) + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("androidx.activity:activity-compose:1.8.0") + implementation("androidx.compose.foundation:foundation:1.5.3") + implementation("androidx.compose.ui:ui:1.5.3") } } diff --git a/components/resources/demo/androidApp/src/main/AndroidManifest.xml b/components/resources/demo/androidApp/src/main/AndroidManifest.xml index c5060697da..8235e8b903 100644 --- a/components/resources/demo/androidApp/src/main/AndroidManifest.xml +++ b/components/resources/demo/androidApp/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + + macosTarget.binaries { executable { entryPoint = "main" } @@ -48,56 +57,23 @@ kotlin { implementation(project(":resources:library")) } } - val iosMain by creating { - dependsOn(commonMain) - } - val iosTest by creating { - } - val iosX64Main by getting { - dependsOn(iosMain) - } - val iosArm64Main by getting { - dependsOn(iosMain) - } - val iosSimulatorArm64Main by getting { - dependsOn(iosMain) - } - val iosX64Test by getting { - dependsOn(iosMain) - } - val iosArm64Test by getting { - dependsOn(iosMain) - } - val iosSimulatorArm64Test by getting { - dependsOn(iosMain) - } val desktopMain by getting { dependencies { implementation(compose.desktop.common) } } - val macosMain by creating { - dependsOn(commonMain) - } - val macosX64Main by getting { - dependsOn(macosMain) - } - val macosArm64Main by getting { - dependsOn(macosMain) - } } } android { - compileSdk = 33 - sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + compileSdk = 34 + namespace = "org.jetbrains.compose.resources.demo.shared" defaultConfig { minSdk = 21 - targetSdk = 33 } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } sourceSets { named("main") { diff --git a/components/resources/demo/shared/src/androidMain/AndroidManifest.xml b/components/resources/demo/shared/src/androidMain/AndroidManifest.xml deleted file mode 100644 index c01a0139ab..0000000000 --- a/components/resources/demo/shared/src/androidMain/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/components/resources/library/build.gradle.kts b/components/resources/library/build.gradle.kts index 3bff485c99..fe0a9c1d6c 100644 --- a/components/resources/library/build.gradle.kts +++ b/components/resources/library/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi plugins { kotlin("multiplatform") @@ -10,42 +10,68 @@ plugins { val composeVersion = extra["compose.version"] as String kotlin { + @OptIn(ExperimentalKotlinGradlePluginApi::class) + targetHierarchy.default() jvm("desktop") - android { + androidTarget { publishLibraryVariants("release") + compilations.all { + kotlinOptions { + jvmTarget = "11" + } + } } - ios() + iosX64() + iosArm64() iosSimulatorArm64() - js(IR) { - browser() + js { + browser { + testTask(Action { + enabled = false + }) + } } macosX64() macosArm64() sourceSets { + all { + languageSettings { + optIn("kotlin.RequiresOptIn") + optIn("kotlinx.cinterop.ExperimentalForeignApi") + } + } + val commonMain by getting { dependencies { implementation("org.jetbrains.compose.runtime:runtime:$composeVersion") implementation("org.jetbrains.compose.foundation:foundation:$composeVersion") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") } } val commonTest by getting { dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3") implementation(kotlin("test")) } } val commonButJSMain by creating { dependsOn(commonMain) } + val commonButJSTest by creating { + dependsOn(commonTest) + } val skikoMain by creating { dependsOn(commonMain) } + val skikoTest by creating { + dependsOn(commonTest) + } val jvmAndAndroidMain by creating { dependsOn(commonMain) } - val nativeMain by creating { - dependsOn(commonMain) + val jvmAndAndroidTest by creating { + dependsOn(commonTest) } val desktopMain by getting { dependsOn(skikoMain) @@ -53,60 +79,61 @@ kotlin { dependsOn(commonButJSMain) } val desktopTest by getting { + dependsOn(skikoTest) + dependsOn(jvmAndAndroidTest) + dependsOn(commonButJSTest) dependencies { implementation(compose.desktop.currentOs) implementation("org.jetbrains.compose.ui:ui-test-junit4:$composeVersion") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.6.4") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.7.3") } } val androidMain by getting { dependsOn(jvmAndAndroidMain) dependsOn(commonButJSMain) } - val androidTest by getting { - dependencies { - - } + val androidInstrumentedTest by getting { + dependsOn(commonTest) + dependsOn(jvmAndAndroidTest) + dependsOn(commonButJSTest) } val iosMain by getting { dependsOn(skikoMain) dependsOn(commonButJSMain) - dependsOn(nativeMain) } - val iosTest by getting - val iosSimulatorArm64Main by getting - iosSimulatorArm64Main.dependsOn(iosMain) - val iosSimulatorArm64Test by getting - iosSimulatorArm64Test.dependsOn(iosTest) + val iosTest by getting { + dependsOn(skikoTest) + dependsOn(commonButJSTest) + } val jsMain by getting { dependsOn(skikoMain) } - val macosMain by creating { + val jsTest by getting { + dependsOn(skikoTest) + } + val macosMain by getting { dependsOn(skikoMain) dependsOn(commonButJSMain) - dependsOn(nativeMain) - } - val macosX64Main by getting { - dependsOn(macosMain) } - val macosArm64Main by getting { - dependsOn(macosMain) + val macosTest by getting { + dependsOn(skikoTest) + dependsOn(commonButJSTest) } } } android { - compileSdk = 33 - sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") + compileSdk = 34 + namespace = "org.jetbrains.compose.components.resources" defaultConfig { minSdk = 21 - targetSdk = 33 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } + @Suppress("UnstableApiUsage") testOptions { managedDevices { devices { @@ -118,20 +145,13 @@ android { } } } -} - -dependencies { - //Android integration tests - testImplementation("androidx.test:core:1.5.0") - androidTestImplementation("androidx.compose.ui:ui-test-manifest:1.3.1") - androidTestImplementation("androidx.compose.ui:ui-test:1.3.1") - androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.3.1") - androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4") -} - -// TODO it seems that argument isn't applied to the common sourceSet. Figure out why -tasks.withType().configureEach { - kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn" + dependencies { + //Android integration tests + testImplementation("androidx.test:core:1.5.0") + androidTestImplementation("androidx.compose.ui:ui-test-manifest:1.5.3") + androidTestImplementation("androidx.compose.ui:ui-test:1.5.3") + androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.3") + } } configureMavenPublication( diff --git a/components/resources/library/src/androidAndroidTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt b/components/resources/library/src/androidInstrumentedTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt similarity index 100% rename from components/resources/library/src/androidAndroidTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt rename to components/resources/library/src/androidInstrumentedTest/kotlin/org/jetbrains/compose/resources/ComposeResourceTest.kt diff --git a/components/resources/library/src/androidAndroidTest/resources/1.png b/components/resources/library/src/androidInstrumentedTest/resources/1.png similarity index 100% rename from components/resources/library/src/androidAndroidTest/resources/1.png rename to components/resources/library/src/androidInstrumentedTest/resources/1.png diff --git a/components/resources/library/src/androidAndroidTest/resources/2.png b/components/resources/library/src/androidInstrumentedTest/resources/2.png similarity index 100% rename from components/resources/library/src/androidAndroidTest/resources/2.png rename to components/resources/library/src/androidInstrumentedTest/resources/2.png diff --git a/components/resources/library/src/androidMain/AndroidManifest.xml b/components/resources/library/src/androidMain/AndroidManifest.xml deleted file mode 100644 index 8cbd70ab54..0000000000 --- a/components/resources/library/src/androidMain/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/components/settings.gradle.kts b/components/settings.gradle.kts index 0e9c93eb23..055bf57049 100644 --- a/components/settings.gradle.kts +++ b/components/settings.gradle.kts @@ -1,10 +1,9 @@ pluginManagement { repositories { + google() gradlePluginPortal() mavenCentral() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") - google() - mavenLocal() } plugins { @@ -15,10 +14,18 @@ pluginManagement { } } +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + } +} + include(":SplitPane:library") include(":SplitPane:demo") include(":AnimatedImage:library") -include("AnimatedImage:demo") +include(":AnimatedImage:demo") include(":resources:library") include(":resources:demo:androidApp") include(":resources:demo:desktopApp")