343 lines
7.7 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
2020-05-24 10:16:53 +02:00
plugins {
kotlin(PluginsDeps.multiplatform)
id (PluginsDeps.mavenPublish)
id (PluginsDeps.signing)
id (PluginsDeps.dokka) version Versions.dokkaPlugin
}
repositories {
mavenCentral()
jcenter()
}
group = ReleaseInfo.group
version = ReleaseInfo.version
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
//Not supported in OFFICIAL coroutines at the moment
linuxArm64() {
binaries {
staticLib {
}
}
}
2020-06-01 19:37:07 +02:00
//Not supported in OFFICAL coroutines at the moment
linuxArm32Hfp() {
binaries {
staticLib {
}
}
}
}
runningOnLinuxArm64 {
2020-06-01 11:45:49 +02:00
}
2020-06-01 12:24:18 +02:00
runningOnLinuxArm32 {
2020-06-01 19:37:07 +02:00
2020-05-24 10:16:53 +02:00
}
2020-05-30 23:33:06 +02:00
runningOnMacos {
iosX64() {
2020-05-24 10:16:53 +02:00
binaries {
framework {
optimized = true
}
}
}
2020-05-30 23:33:06 +02:00
iosArm64() {
2020-05-24 10:16:53 +02:00
binaries {
framework {
optimized = true
}
}
}
2020-05-30 23:33:06 +02:00
iosArm32() {
2020-05-24 10:16:53 +02:00
binaries {
framework {
optimized = true
}
}
}
2020-05-24 10:16:53 +02:00
macosX64() {
binaries {
framework {
optimized = true
}
}
}
2020-05-30 23:33:06 +02:00
tvosX64() {
binaries {
framework {
optimized = true
}
}
}
tvosArm64() {
binaries {
framework {
optimized = true
}
}
}
watchosArm64() {
binaries {
framework {
optimized = true
}
}
}
watchosArm32() {
2020-05-30 23:33:06 +02:00
binaries {
framework {
optimized = true
}
}
}
watchosX86() {
2020-05-30 23:33:06 +02:00
binaries {
framework {
optimized = true
}
}
}
2020-05-24 10:16:53 +02:00
}
2020-05-30 23:33:06 +02:00
runningOnWindows {
2020-05-24 10:16:53 +02:00
mingwX64() {
binaries {
staticLib {
optimized = true
}
}
}
mingwX86() {
binaries {
staticLib {
}
}
}
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")
}
}
}
tasks {
create<Jar>("javadocJar") {
dependsOn(dokka)
archiveClassifier.set("javadoc")
from(dokka.get().outputDirectory)
}
dokka {
println ("Dokka !")
impliedPlatforms = mutableListOf("Common")
kotlinTasks {
listOf()
}
sourceRoot {
println ("Common !")
path = "/home/ionspin/Projects/Future/kotlin-multiplatform-crypto/crypto/src/commonMain" //TODO remove static path!
platforms = listOf("Common")
}
}
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
}
}
// 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
}
}
}
}