Limit builds to hosts, bump to 0.0.3

This commit is contained in:
Ugljesa Jovanovic 2020-05-16 23:55:26 +02:00 committed by Ugljesa Jovanovic
parent 2078775119
commit a5fc3c8350
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F

View File

@ -47,7 +47,7 @@ repositories {
} }
group = "com.ionspin.kotlin" group = "com.ionspin.kotlin"
version = "0.0.3-SNAPSHOT" version = "0.0.3"
val ideaActive = System.getProperty("idea.active") == "true" val ideaActive = System.getProperty("idea.active") == "true"
@ -68,22 +68,23 @@ kotlin {
"windows" -> mingwX64("native") "windows" -> mingwX64("native")
} }
} }
jvm() if (hostOsName == "linux") {
js { jvm()
compilations { js {
this.forEach { compilations {
it.compileKotlinTask.kotlinOptions.sourceMap = true this.forEach {
it.compileKotlinTask.kotlinOptions.moduleKind = "commonjs" it.compileKotlinTask.kotlinOptions.sourceMap = true
it.compileKotlinTask.kotlinOptions.metaInfo = true it.compileKotlinTask.kotlinOptions.moduleKind = "commonjs"
it.compileKotlinTask.kotlinOptions.metaInfo = true
if (it.name == "main") { if (it.name == "main") {
it.compileKotlinTask.kotlinOptions.main = "call" it.compileKotlinTask.kotlinOptions.main = "call"
}
println("Compilation name ${it.name} set")
println("Destination dir ${it.compileKotlinTask.destinationDir}")
} }
println("Compilation name ${it.name} set")
println("Destination dir ${it.compileKotlinTask.destinationDir}")
} }
} //Until I figure out how to run headless chrome on travis
//Until I figure out how to run headless chrome on travis
// browser { // browser {
// //
// testTask { // testTask {
@ -92,56 +93,76 @@ kotlin {
// } // }
// } // }
// } // }
nodejs { nodejs {
testTask { testTask {
useMocha() { useMocha() {
timeout = "10s" timeout = "10s"
}
}
}
}
linuxX64("linux") {
binaries {
staticLib {
}
}
}
linuxArm32Hfp() {
binaries {
staticLib {
}
}
}
linuxArm64() {
binaries {
staticLib {
} }
} }
} }
} }
linuxX64("linux") {
binaries {
staticLib {
if (hostOsName == "mac") {
iosX64("ios") {
binaries {
framework {
}
}
}
iosArm64("ios64Arm") {
binaries {
framework {
}
}
}
iosArm32("ios32Arm") {
binaries {
framework {
}
}
}
macosX64() {
binaries {
framework {
}
} }
} }
} }
iosX64("ios") { if (hostOsName == "windows") {
binaries {
framework {
} mingwX64() {
} binaries {
} staticLib {
iosArm64("ios64Arm") {
binaries {
framework {
}
}
}
iosArm32("ios32Arm") {
binaries {
framework {
}
}
}
macosX64() {
binaries {
framework {
}
}
}
mingwX64() {
binaries {
staticLib {
}
} }
} }
} }
@ -154,19 +175,6 @@ kotlin {
// } // }
// } // }
linuxArm32Hfp() {
binaries {
staticLib {
}
}
}
linuxArm64() {
binaries {
staticLib {
}
}
}
println(targets.names) println(targets.names)
@ -185,34 +193,7 @@ kotlin {
implementation(kotlin(Deps.Common.testAnnotation)) implementation(kotlin(Deps.Common.testAnnotation))
} }
} }
val jvmMain by getting {
dependencies {
implementation(kotlin(Deps.Jvm.stdLib))
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(Deps.Jvm.coroutinesCore)
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(Deps.Jvm.coroutinesTest)
implementation(kotlin(Deps.Jvm.reflection))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin(Deps.Js.stdLib))
implementation(kotlin(Deps.Js.test))
implementation(Deps.Js.coroutines)
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val nativeMain = if (ideaActive) { val nativeMain = if (ideaActive) {
val nativeMain by getting { val nativeMain by getting {
dependsOn(commonMain) dependsOn(commonMain)
@ -242,40 +223,91 @@ kotlin {
nativeTest nativeTest
} }
if (hostOsName == "linux") {
val jvmMain by getting {
dependencies {
implementation(kotlin(Deps.Jvm.stdLib))
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(Deps.Jvm.coroutinesCore)
}
}
val jvmTest by getting {
dependencies {
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(Deps.Jvm.coroutinesTest)
implementation(kotlin(Deps.Jvm.reflection))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin(Deps.Js.stdLib))
implementation(kotlin(Deps.Js.test))
implementation(Deps.Js.coroutines)
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val linuxMain by getting {
dependsOn(nativeMain)
}
val linuxTest by getting {
dependsOn(nativeTest)
}
val linuxArm32HfpMain by getting {
dependsOn(nativeMain)
}
val linuxArm32HfpTest by getting {
dependsOn(nativeTest)
}
val linuxArm64Main by getting {
dependsOn(nativeMain)
}
val linuxArm64Test by getting {
dependsOn(nativeTest)
}
val iosMain by getting {
dependsOn(nativeMain)
}
val iosTest by getting {
dependsOn(nativeTest)
} }
val ios64ArmMain by getting { if (hostOsName == "mac") {
dependsOn(nativeMain)
} val iosMain by getting {
val ios64ArmTest by getting { dependsOn(nativeMain)
dependsOn(nativeTest) }
val iosTest by getting {
dependsOn(nativeTest)
}
val ios64ArmMain by getting {
dependsOn(nativeMain)
}
val ios64ArmTest by getting {
dependsOn(nativeTest)
}
val ios32ArmMain by getting {
dependsOn(nativeMain)
}
val ios32ArmTest by getting {
dependsOn(nativeTest)
}
val macosX64Main by getting {
dependsOn(nativeMain)
}
val macosX64Test by getting {
dependsOn(nativeTest)
}
} }
val ios32ArmMain by getting {
dependsOn(nativeMain)
}
val ios32ArmTest by getting {
dependsOn(nativeTest)
}
val macosX64Main by getting {
dependsOn(nativeMain)
}
val macosX64Test by getting {
dependsOn(nativeTest)
}
val linuxMain by getting {
dependsOn(nativeMain)
}
val linuxTest by getting {
dependsOn(nativeTest)
}
// Coroutines don't support mingwx86 yet // Coroutines don't support mingwx86 yet
// val mingwX86Main by getting { // val mingwX86Main by getting {
// dependsOn(commonMain) // dependsOn(commonMain)
@ -288,32 +320,20 @@ kotlin {
// dependsOn(commonTest) // dependsOn(commonTest)
// } // }
// //
val mingwX64Main by getting { if (hostOsName == "windows") {
dependsOn(commonMain) val mingwX64Main by getting {
dependencies { dependsOn(commonMain)
implementation(Deps.Native.coroutines) dependencies {
implementation(Deps.Native.coroutines)
}
}
val mingwX64Test by getting {
dependsOn(commonTest)
} }
} }
val mingwX64Test by getting {
dependsOn(commonTest)
}
val linuxArm32HfpMain by getting {
dependsOn(nativeMain)
}
val linuxArm32HfpTest by getting {
dependsOn(nativeTest)
}
val linuxArm64Main by getting {
dependsOn(nativeMain)
}
val linuxArm64Test by getting {
dependsOn(nativeTest)
}
all { all {
languageSettings.enableLanguageFeature("InlineClasses") languageSettings.enableLanguageFeature("InlineClasses")
} }
@ -355,44 +375,47 @@ tasks {
platforms = listOf("Common") platforms = listOf("Common")
} }
} }
if (getHostOsName() == "linux") {
val jvmTest by getting(Test::class) { val jvmTest by getting(Test::class) {
testLogging { testLogging {
events("PASSED", "FAILED", "SKIPPED") events("PASSED", "FAILED", "SKIPPED")
}
} }
}
val linuxTest by getting(KotlinNativeTest::class) { val linuxTest by getting(KotlinNativeTest::class) {
testLogging { testLogging {
events("PASSED", "FAILED", "SKIPPED") events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true // showStandardStreams = true
}
} }
}
val mingwX64Test by getting(KotlinNativeTest::class) { val jsNodeTest by getting(KotlinJsTest::class) {
testLogging { testLogging {
events("PASSED", "FAILED", "SKIPPED") events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true showStandardStreams = true
}
} }
}
val jsNodeTest by getting(KotlinJsTest::class) { // val jsBrowserTest by getting(KotlinJsTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true
}
}
// val jsBrowserTest by getting(KotlinJsTest::class) {
// //
// testLogging { // testLogging {
// events("PASSED", "FAILED", "SKIPPED") // events("PASSED", "FAILED", "SKIPPED")
// showStandardStreams = true // showStandardStreams = true
// } // }
// } // }
}
if (getHostOsName() == "windows") {
val mingwX64Test by getting(KotlinNativeTest::class) {
testLogging {
events("PASSED", "FAILED", "SKIPPED")
showStandardStreams = true
}
}
}
} }