Skip to content

Clean up the K2 build config #135

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

Merged
merged 2 commits into from
Apr 9, 2025
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
45 changes: 32 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
@file:OptIn(ExperimentalKotlinGradlePluginApi::class)

import io.github.petertrr.configurePublishing
import io.github.petertrr.ext.booleanProperty
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
Expand All @@ -26,16 +22,16 @@ kotlin {
explicitApi()

compilerOptions {
apiVersion = KotlinVersion.KOTLIN_1_9
languageVersion = KotlinVersion.KOTLIN_1_9
apiVersion = KotlinVersion.KOTLIN_2_1
languageVersion = KotlinVersion.KOTLIN_2_1
}

jvm {
compilations.configureEach {
compileTaskProvider.configure {
compilerOptions {
// Minimum bytecode level is 52
jvmTarget = JvmTarget.JVM_11
jvmTarget = JvmTarget.JVM_1_8

// Output interfaces with default methods
freeCompilerArgs.addAll(
Expand Down Expand Up @@ -81,11 +77,36 @@ kotlin {
nodejs()
}

// Tier 1
macosX64()
macosArm64()
iosSimulatorArm64()
iosX64()
iosArm64()

// Tier 2
linuxX64()
linuxArm64()
watchosSimulatorArm64()
watchosX64()
watchosArm32()
watchosArm64()
tvosSimulatorArm64()
tvosX64()
tvosArm64()

// Tier 3
mingwX64()
macosX64()
macosArm64()
androidNativeArm32()
androidNativeArm64()
androidNativeX86()
androidNativeX64()
watchosDeviceArm64()

// Deprecated.
// Should follow the same route as official Kotlin libraries
@Suppress("DEPRECATION")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYM by the same route? Sorry, I'm not keeping up with the recent context

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petertrr basically we should stick to what kotlinx libs do: build for all targets, even if deprecated.
Once (and if) it will get removed, we'll delete that line.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks for the clarification!

linuxArm32Hfp()

sourceSets {
commonTest {
Expand All @@ -105,9 +126,7 @@ detekt {
}

tasks {
withType<Detekt> {
named("check") {
dependsOn(this@withType)
}
check {
dependsOn(detekt)
}
}
21 changes: 15 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
kotlin.code.style=official
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.caching=true
# https://kotlinlang.org/docs/whatsnew19.html#preview-of-gradle-configuration-cache
org.gradle.configuration-cache=false
org.gradle.parallel=true
#########################
# Gradle settings
#########################
org.gradle.jvmargs = -Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel = true
org.gradle.caching = true
org.gradle.configuration-cache = false

#########################
# Kotlin settings
#########################
kotlin.code.style = official

# Kotlin/Native
kotlin.native.enableKlibsCrossCompilation = true
Loading