Skip to content
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 .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--ignore-engines true
104 changes: 26 additions & 78 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.konan.target.Family.ANDROID
import org.jetbrains.kotlin.konan.target.Family.LINUX
import org.jetbrains.kotlin.konan.target.Family.MINGW

buildscript {
dependencies {
classpath("com.vanniktech:gradle-maven-publish-plugin:0.25.3")
}
}
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension

plugins {
kotlin("multiplatform")
}

repositories {
mavenCentral()
google()
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.mavenPublish)
}

val GROUP: String by project
Expand All @@ -25,7 +14,10 @@ group = GROUP
version = VERSION_NAME

kotlin {
targetHierarchy.default()
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
macosX64()
iosX64()
iosArm64()
Expand Down Expand Up @@ -55,73 +47,29 @@ kotlin {
browser()
nodejs()
}
wasm {
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
binaries.executable()
nodejs()
}

sourceSets {
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
@Suppress("OPT_IN_USAGE")
applyDefaultHierarchyTemplate {
common {
group("jsAndWasmJs") {
withJs()
withWasm()
}
}
}

val jsWasmMain by creating {
dependsOn(commonMain)
}
val jsWasmTest by creating {
dependsOn(commonTest)
}
val jsMain by getting {
dependsOn(jsWasmMain)
}
val jsTest by getting {
dependsOn(jsWasmTest)
}
val wasmMain by getting {
dependsOn(jsWasmMain)
}
val wasmTest by getting {
dependsOn(jsWasmTest)
}

val nativeCommonMain by creating {
dependsOn(commonMain)
}
val nativeCommonTest by creating {
dependsOn(commonTest)
}

val nativeDarwinMain by creating {
dependsOn(nativeCommonMain)
}
val nativeLinuxMain by creating {
dependsOn(nativeCommonMain)
}
val mingwMain by getting {
dependsOn(nativeCommonMain)
}

targets.withType<KotlinNativeTarget>().all {
val mainSourceSet = compilations.getByName("main").defaultSourceSet
val testSourceSet = compilations.getByName("test").defaultSourceSet

mainSourceSet.dependsOn(nativeCommonMain)
testSourceSet.dependsOn(nativeCommonTest)

when {
konanTarget.family == MINGW -> mainSourceSet.dependsOn(mingwMain)
konanTarget.family == LINUX || konanTarget.family == ANDROID -> mainSourceSet.dependsOn(
nativeLinuxMain
)

konanTarget.family.isAppleFamily -> mainSourceSet.dependsOn(nativeDarwinMain)
else -> mainSourceSet.dependsOn(nativeCommonMain)
}
}
sourceSets.commonTest.dependencies {
implementation(kotlin("test"))
}
}

apply(plugin = "com.vanniktech.maven.publish")
// https://github.com/Kotlin/kotlin-wasm-examples/commit/701a051d6ee869abcabebff702b3ccd98d51c38d
rootProject.the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309143a48826a08"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}
7 changes: 2 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true

GROUP=co.touchlab
VERSION_NAME=0.6.11
KOTLIN_VERSION=1.9.10
VERSION_NAME=0.6.12

POM_ARTIFACT_ID=testhelp

Expand All @@ -37,6 +36,4 @@ POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=kpgalligan
POM_DEVELOPER_NAME=Kevin Galligan
POM_DEVELOPER_ORG=Touchlab
POM_DEVELOPER_URL=https://touchlab.co/

kotlin.js.ir.output.granularity=whole-program
POM_DEVELOPER_URL=https://touchlab.co/
14 changes: 14 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[versions]

mavenPublish = "0.27.0"
kotlin = "1.9.23"

[libraries]


[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }

[bundles]

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
22 changes: 4 additions & 18 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
#
# Copyright (C) 2018 Touchlab, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Loading