Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Kotlin to 2.0.10 #14

Merged
merged 2 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
// in each subproject's classloader
id("root.publication")
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
Expand Down
32 changes: 13 additions & 19 deletions compose-dnd/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

/*
Expand All @@ -35,43 +36,36 @@ plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
id("module.publication")
id("module.spotless")
}

kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
applyDefaultHierarchyTemplate {
common {
group("nonWasm") {
withNative()
withJvm()
withAndroidTarget()
withJs()
}
}
}
applyDefaultHierarchyTemplate()

androidTarget {
publishLibraryVariants("release")
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

jvm("desktop") {
jvmToolchain(11)
}
jvmToolchain(11)
jvm("desktop")

js(IR) {
browser()
}

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
browser {
testTask {
enabled = false
}
}
}

iosX64()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.geometry.Size
import androidx.compose.ui.unit.plus
import kotlin.math.max
import kotlin.math.min
import kotlin.math.pow

internal object MathUtils {
/**
Expand Down Expand Up @@ -112,4 +113,8 @@ internal object MathUtils {
point.y >= topLeft.y &&
point.y <= topLeft.y + size.height
}

fun distance2(p1: Offset, p2: Offset): Float {
return (p1.x - p2.x).pow(2) + (p1.y - p2.y).pow(2)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.mohamedrejeb.dnd"
version = "0.2.0"
version = "0.3.0-dev01"
}

nexusPublishing {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ org.jetbrains.compose.experimental.uikit.enabled=true
# Compose for Web
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true
kotlin.wasm.stability.nowarn=true

#Android
android.useAndroidX=true
Expand Down
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
[versions]
kotlin = "1.9.22"
compose = "1.6.0"
compose-compiler = "1.5.4"
kotlin = "2.0.10"
compose = "1.6.11"
agp = "8.2.2"
android-minSdk = "24"
android-compileSdk = "34"
android-targetSdk = "34"
androidx-activityCompose = "1.8.2"
androidx-core-ktx = "1.12.0"
voyager = "1.1.0-alpha03"
spotless = "6.23.3"
androidx-activityCompose = "1.9.1"
androidx-core-ktx = "1.13.1"
voyager = "1.1.0-beta02"
spotless = "6.25.0"
nexus-publish = "2.0.0-rc-1"

[libraries]
Expand All @@ -23,6 +22,7 @@ voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.

[plugins]
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose" }
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Expand Down
Loading
Loading