250 lines
5.9 KiB
Plaintext
Raw Normal View History

2020-05-24 10:16:53 +02:00
/*
* Copyright 2019 Ugljesa Jovanovic
*
* 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.
*
*/
@file:Suppress("UnstableApiUsage")
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.dokka.Platform
2020-05-24 10:16:53 +02:00
plugins {
kotlin(PluginsDeps.multiplatform)
2020-08-02 18:34:45 +02:00
id(PluginsDeps.mavenPublish)
id(PluginsDeps.signing)
id(PluginsDeps.dokka)
2020-05-24 10:16:53 +02:00
}
repositories {
mavenCentral()
}
group = ReleaseInfo.group
2021-09-23 19:20:11 +02:00
version = "0.1" //Irrelevant
2020-05-24 10:16:53 +02:00
val ideaActive = System.getProperty("idea.active") == "true"
2020-05-31 21:13:01 +02:00
2020-05-24 10:16:53 +02:00
kotlin {
val hostOsName = getHostOsName()
2020-05-31 20:36:06 +02:00
runningOnLinuxx86_64 {
2020-05-24 10:16:53 +02:00
jvm()
js() {
2020-06-05 16:27:58 +02:00
browser {
2020-05-24 11:12:00 +02:00
testTask {
enabled = false //Until I sort out testing on travis
useKarma {
useChrome()
}
}
}
2020-05-24 10:16:53 +02:00
nodejs {
testTask {
useMocha() {
timeout = "10s"
}
}
}
}
linuxX64("linux") {
binaries {
staticLib {
optimized = true
}
}
}
2020-05-31 20:36:06 +02:00
2020-06-01 11:45:49 +02:00
linuxArm64() {
binaries {
staticLib {
}
}
}
2020-06-01 19:37:07 +02:00
linuxArm32Hfp() {
binaries {
staticLib {
}
}
}
2020-05-24 10:16:53 +02:00
}
2020-05-30 23:33:06 +02:00
runningOnMacos {
2021-09-23 19:20:11 +02:00
iosX64()
iosArm64()
iosArm32()
iosSimulatorArm64()
2021-09-23 19:20:11 +02:00
macosX64()
macosArm64()
2021-09-23 19:20:11 +02:00
tvosX64()
tvosArm64()
tvosSimulatorArm64()
2020-05-30 23:33:06 +02:00
2021-09-23 19:20:11 +02:00
watchosArm64()
watchosArm32()
watchosX86()
watchosSimulatorArm64()
2020-05-30 23:33:06 +02:00
2020-05-24 10:16:53 +02:00
}
2020-05-30 23:33:06 +02:00
runningOnWindows {
2021-09-23 19:20:11 +02:00
mingwX64()
mingwX86()
2020-05-24 10:16:53 +02:00
}
2020-05-24 10:16:53 +02:00
println(targets.names)
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin(Deps.Common.stdLib))
implementation(kotlin(Deps.Common.test))
}
}
val commonTest by getting {
dependencies {
implementation(kotlin(Deps.Common.test))
implementation(kotlin(Deps.Common.testAnnotation))
}
}
2020-05-31 20:59:14 +02:00
runningOnLinuxx86_64 {
2020-05-24 10:16:53 +02:00
val jvmMain by getting {
dependencies {
implementation(kotlin(Deps.Jvm.stdLib))
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(kotlin(Deps.Jvm.reflection))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin(Deps.Js.stdLib))
}
}
val jsTest by getting {
dependencies {
implementation(kotlin(Deps.Js.test))
}
}
}
runningOnMacos {
val tvosX64Main by getting {
dependsOn(commonMain)
}
val tvosArm64Main by getting {
dependsOn(commonMain)
}
val watchosX86Main by getting {
dependsOn(commonMain)
}
val watchosArm64Main by getting {
dependsOn(commonMain)
}
val watchosArm32Main by getting {
dependsOn(commonMain)
}
}
2020-05-24 10:16:53 +02:00
all {
languageSettings.enableLanguageFeature("InlineClasses")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
languageSettings.useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
2020-05-24 10:16:53 +02:00
}
}
}
tasks {
2020-08-09 14:35:20 +02:00
2020-05-31 21:15:22 +02:00
if (getHostOsName() == "linux" && getHostArchitecture() == "x86-64") {
2020-05-24 10:16:53 +02:00
val jvmTest by getting(Test::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
}
}
val linuxTest by getting(KotlinNativeTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
}
}
// val jsNodeTest by getting(KotlinJsTest::class) {
// testLogging {
// events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
// }
// }
2020-05-24 10:16:53 +02:00
// val legacyjsNodeTest by getting(KotlinJsTest::class) {
//
// testLogging {
// events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
// }
// }
// val jsIrBrowserTest by getting(KotlinJsTest::class) {
// testLogging {
// events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true
// }
// }
}
if (getHostOsName() == "windows") {
2020-05-24 10:16:53 +02:00
val mingwX64Test by getting(KotlinNativeTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true
}
}
}
}