Skip to content

Commit

Permalink
Update to Kotlin 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed May 26, 2024
1 parent 4a8f478 commit 30726fd
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ captures/


!/renovate.json
/.kotlin/
7 changes: 3 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ android-gradle-plugin = "8.2.2"
android-compile-sdk = "34"
android-min-sdk = "21"
android-target-sdk = "34"
kotlin = "1.9.23"
kotlin = "2.0.0"
library-version-name = "6.0.7"

# Library dependencies
Expand All @@ -23,10 +23,9 @@ androidx-lifecycle-viewmodel-ktx = "2.7.0"
androidx-recyclerview = "1.3.2"
androidx-swiperefreshlayout = "1.1.0"
com-google-android-material = "1.11.0"
compose-multiplatform = "1.6.1"
compose-multiplatform = "1.6.10"
io-coil = "2.6.0"
androidx-lifecycle-extensions = "2.2.0"
compose-compiler = "1.5.11"
androidx-compose-bom = "2024.03.00"
activity-compose = "1.8.2"

Expand Down Expand Up @@ -59,7 +58,6 @@ androidx-compose-foundation = { module = "androidx.compose.foundation:foundation
androidx-compose-material = { module = "androidx.compose.material:material" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "compose-compiler" }

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
Expand All @@ -69,6 +67,7 @@ kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
com-vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "com-vanniktech-maven-publish" }
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
compose-multiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

[bundles]
compose = [
Expand Down
4 changes: 1 addition & 3 deletions samples/multiplatform/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("com.android.application")
kotlin("android")
alias(libs.plugins.compose.compiler)
}

android {
Expand All @@ -17,9 +18,6 @@ android {
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
Expand Down
5 changes: 1 addition & 4 deletions samples/multiplatform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@ plugins {
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.compose.compiler) apply false
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
10 changes: 5 additions & 5 deletions samples/multiplatform/desktopApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
kotlin("multiplatform")
id("org.jetbrains.compose")
alias(libs.plugins.compose.compiler)
}

group = "com.prof"
version = "1.0-SNAPSHOT"


kotlin {
jvmToolchain(17)

jvm {
jvmToolchain(17)
withJava()
}
sourceSets {
val jvmMain by getting {
jvmMain {
dependencies {

implementation(project(":samples:multiplatform:shared"))
implementation(compose.desktop.currentOs)
implementation(compose.runtime)
Expand All @@ -32,7 +32,7 @@ compose.desktop {
application {
mainClass = "com.prof18.rssparser.sample.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
targetFormats(TargetFormat.Dmg)
packageName = "sample"
packageVersion = "1.0.0"
}
Expand Down
3 changes: 0 additions & 3 deletions samples/multiplatform/gradle.properties

This file was deleted.

10 changes: 5 additions & 5 deletions samples/multiplatform/iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "echo \"AAAAA\"\nech \"aaaaaaaa\"\necho $SRCROOT\ncd \"$SRCROOT/../../..\"\n./gradlew :samples:multiplatform:shared:embedAndSignAppleFrameworkForXcode\n";
shellScript = "cd \"$SRCROOT/../../..\"\n./gradlew :samples:multiplatform:shared:embedAndSignAppleFrameworkForXcode\n";
};
CC2BCF8B2BFBF9E400523E82 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -589,7 +589,7 @@
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 2LS7B6UW98;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
Expand Down Expand Up @@ -629,7 +629,7 @@
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 2LS7B6UW98;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
Expand Down Expand Up @@ -666,7 +666,7 @@
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = Q7CUB3RNAK;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
Expand All @@ -691,7 +691,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = Q7CUB3RNAK;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
Expand Down
Binary file not shown.
18 changes: 6 additions & 12 deletions samples/multiplatform/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ plugins {
}

kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}
jvmToolchain(17)

jvm("desktop") {
jvmToolchain(17)
}
androidTarget()

jvm("desktop")

listOf(
iosX64(),
Expand Down Expand Up @@ -51,7 +45,7 @@ android {
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}

0 comments on commit 30726fd

Please sign in to comment.