Skip to content

Commit 2692cb3

Browse files
authored
Update Kotlin, dependencies and build scripts (JetBrains#3835)
1 parent c26ebac commit 2692cb3

File tree

18 files changed

+164
-181
lines changed

18 files changed

+164
-181
lines changed
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import org.jetbrains.compose.compose
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3-
41
plugins {
52
kotlin("multiplatform")
63
id("org.jetbrains.compose")
74
}
85

96
kotlin {
10-
jvm {}
7+
jvm()
118
sourceSets {
12-
named("jvmMain") {
9+
all {
10+
languageSettings {
11+
optIn("kotlin.RequiresOptIn")
12+
}
13+
}
14+
val jvmMain by getting {
1315
dependencies {
1416
implementation(compose.desktop.currentOs)
1517
implementation(project(":AnimatedImage:library"))
@@ -22,8 +24,4 @@ compose.desktop {
2224
application {
2325
mainClass = "org.jetbrains.compose.animatedimage.demo.MainKt"
2426
}
25-
}
26-
27-
tasks.withType<KotlinCompile>().configureEach {
28-
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
2927
}

components/AnimatedImage/library/build.gradle.kts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import org.jetbrains.compose.compose
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3-
41
plugins {
52
kotlin("multiplatform")
63
id("org.jetbrains.compose")
@@ -9,25 +6,22 @@ plugins {
96

107
kotlin {
118
jvm("desktop")
12-
139
sourceSets {
14-
named("commonMain") {
10+
all {
11+
languageSettings {
12+
optIn("kotlin.RequiresOptIn")
13+
}
14+
}
15+
val commonMain by getting {
1516
dependencies {
1617
api(compose.runtime)
1718
api(compose.foundation)
1819
api(project(":resources:library"))
19-
2020
}
2121
}
22-
named("desktopMain") {}
2322
}
2423
}
2524

26-
// TODO it seems that argument isn't applied to the common sourceSet. Figure out why
27-
tasks.withType<KotlinCompile>().configureEach {
28-
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
29-
}
30-
3125
configureMavenPublication(
3226
groupId = "org.jetbrains.compose.components",
3327
artifactId = "components-animatedimage",
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
import org.jetbrains.compose.compose
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
32

43
plugins {
54
kotlin("multiplatform")
65
id("org.jetbrains.compose")
76
}
87

98
kotlin {
10-
jvm {}
9+
jvm()
1110
sourceSets {
12-
named("jvmMain") {
11+
all {
12+
languageSettings {
13+
optIn("kotlin.RequiresOptIn")
14+
}
15+
}
16+
17+
val jvmMain by getting {
1318
dependencies {
1419
implementation(compose.desktop.currentOs)
1520
implementation(project(":SplitPane:library"))
@@ -22,8 +27,4 @@ compose.desktop {
2227
application {
2328
mainClass = "org.jetbrains.compose.splitpane.demo.MainKt"
2429
}
25-
}
26-
27-
tasks.withType<KotlinCompile>().configureEach {
28-
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
2930
}

components/SplitPane/library/build.gradle.kts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import org.jetbrains.compose.compose
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3-
41
plugins {
52
kotlin("multiplatform")
63
id("org.jetbrains.compose")
@@ -11,21 +8,21 @@ kotlin {
118
jvm("desktop")
129

1310
sourceSets {
14-
named("commonMain") {
11+
all {
12+
languageSettings {
13+
optIn("kotlin.RequiresOptIn")
14+
}
15+
}
16+
17+
val commonMain by getting {
1518
dependencies {
1619
api(compose.runtime)
1720
api(compose.foundation)
1821
}
1922
}
20-
named("desktopMain") {}
2123
}
2224
}
2325

24-
// TODO it seems that argument isn't applied to the common sourceSet. Figure out why
25-
tasks.withType<KotlinCompile>().configureEach {
26-
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
27-
}
28-
2926
configureMavenPublication(
3027
groupId = "org.jetbrains.compose.components",
3128
artifactId = "components-splitpane",

components/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ plugins {
33
id("com.android.library") apply false
44
}
55

6-
allprojects {
7-
repositories {
8-
mavenLocal() // mavenLocal should be the first to get the correct version of skiko during a local build.
9-
google()
10-
mavenCentral()
11-
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
12-
}
13-
}
14-
156
subprojects {
167
version = findProperty("deploy.version") ?: property("compose.version")!!
178

components/gradle.properties

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1+
#Gradle
2+
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
3+
org.gradle.caching=true
4+
#org.gradle.configuration-cache=true //stable since kotlin 1.9.20
5+
6+
#Android
27
android.useAndroidX=true
3-
android.enableJetifier=true
4-
kotlin.code.style=official
5-
# __KOTLIN_COMPOSE_VERSION__
6-
kotlin.version=1.8.22
7-
# __LATEST_COMPOSE_RELEASE_VERSION__
8-
compose.version=1.5.10-rc01
9-
agp.version=7.3.1
8+
9+
#Versions
10+
kotlin.version=1.9.10
11+
compose.version=1.5.3
12+
agp.version=8.1.2
13+
14+
#Compose
1015
org.jetbrains.compose.experimental.jscanvas.enabled=true
1116
org.jetbrains.compose.experimental.macos.enabled=true
1217
org.jetbrains.compose.experimental.uikit.enabled=true
13-
14-
kotlin.native.useEmbeddableCompilerJar=true
15-
kotlin.native.enableDependencyPropagation=false
16-
kotlin.mpp.enableGranularSourceSetsMetadata=true
17-
# Enable kotlin/native experimental memory model
18-
kotlin.native.binary.memoryModel=experimental
1918
compose.desktop.verbose=true
19+
20+
#Kotlin
21+
kotlin.code.style=official
22+
kotlin.js.compiler=ir
2023
kotlin.js.webpack.major.version=4
21-
xcodeproj=./resources/demo/iosApp
24+
kotlin.native.useEmbeddableCompilerJar=true
25+
kotlin.native.binary.memoryModel=experimental
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

components/resources/demo/androidApp/build.gradle.kts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ plugins {
44
id("org.jetbrains.compose")
55
}
66

7-
dependencies {
8-
implementation(project(":resources:demo:shared"))
9-
implementation("androidx.appcompat:appcompat:1.5.1")
10-
implementation("androidx.activity:activity-compose:1.6.1")
11-
implementation("androidx.compose.foundation:foundation:1.3.1")
12-
implementation("androidx.compose.ui:ui:1.3.1")
13-
}
14-
157
android {
16-
compileSdk = 33
8+
compileSdk = 34
9+
namespace = "org.jetbrains.compose.resources.demo"
1710
defaultConfig {
1811
applicationId = "me.user.androidApp"
1912
minSdk = 21
20-
targetSdk = 33
13+
targetSdk = 34
2114
versionCode = 1
2215
versionName = "1.0"
2316
}
2417
compileOptions {
25-
sourceCompatibility = JavaVersion.VERSION_1_8
26-
targetCompatibility = JavaVersion.VERSION_1_8
18+
sourceCompatibility = JavaVersion.VERSION_11
19+
targetCompatibility = JavaVersion.VERSION_11
20+
}
21+
dependencies {
22+
implementation(project(":resources:demo:shared"))
23+
implementation("androidx.appcompat:appcompat:1.6.1")
24+
implementation("androidx.activity:activity-compose:1.8.0")
25+
implementation("androidx.compose.foundation:foundation:1.5.3")
26+
implementation("androidx.compose.ui:ui:1.5.3")
2727
}
2828
}

components/resources/demo/androidApp/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="org.jetbrains.compose.resources.demo">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<application
65
android:allowBackup="true"

components/resources/demo/desktopApp/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
kotlin {
7-
jvm {}
7+
jvm()
88
sourceSets {
99
val jvmMain by getting {
1010
dependencies {

0 commit comments

Comments
 (0)