Bump up versions, use more up to date js testing approach

This commit is contained in:
Ugljesa Jovanovic 2019-12-26 15:05:15 +01:00
parent 55456600d0
commit 09065eb6a7
No known key found for this signature in database
GPG Key ID: 178E6DFCECCB0E0F
5 changed files with 82 additions and 73 deletions

View File

@ -15,17 +15,13 @@
*/
object Versions {
val klock = "1.1.1"
val kotlinCoroutines = "1.3.0"
val timber = "5.0.0-SNAPSHOT"
val oshi = "3.12.0"
val kotlin = "1.3.50"
val ktor = "1.1.1"
val kotlinCoroutines = "1.3.3"
val kotlin = "1.3.61"
val kotlinSerialization = "0.11.1"
val nodePlugin = "1.3.0"
val dokkaPlugin = "0.9.18"
val kotlinBigNumVersion = "0.1.1-SNAPSHOT"
val kotlinBigNumVersion = "0.1.5-SNAPSHOT"
}
@ -38,10 +34,7 @@ object Deps {
val testAnnotation = "test-annotations-common"
val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:${Versions.kotlinCoroutines}"
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:${Versions.kotlinSerialization}"
val ktorClient = "io.ktor:ktor-client:${Versions.ktor}"
val ktorClientCore = "io.ktor:ktor-client-core:${Versions.ktor}"
val timber = "com.jakewharton.timber:timber-common:${Versions.timber}"
val klock = "com.soywiz:klock:${Versions.klock}"
val kotlinBigNum = "com.ionspin.kotlin:bignum:${Versions.kotlinBigNumVersion}"
}
@ -51,9 +44,7 @@ object Deps {
val test = "test-js"
val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:${Versions.kotlinCoroutines}"
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-js:${Versions.kotlinSerialization}"
val ktorClient = "io.ktor:ktor-client-js:${Versions.ktor}"
val ktorClientCore = "io.ktor:ktor-client-core-js:${Versions.ktor}"
val timber = "com.jakewharton.timber:timber-js:${Versions.timber}"
}
object Jvm {
@ -64,17 +55,10 @@ object Deps {
val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}"
val coroutinesjdk8 = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:${Versions.kotlinCoroutines}"
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${Versions.kotlinSerialization}"
val ktorClientJvm = "io.ktor:ktor-client-jvm:${Versions.ktor}"
val ktorClientOkHttp = "io.ktor:ktor-client-okhttp:${Versions.ktor}"
val ktorClientCore = "io.ktor:ktor-client-core-jvm:${Versions.ktor}"
val timber = "com.jakewharton.timber:timber-jdk:${Versions.timber}"
val oshi = "com.github.oshi:oshi-core:${Versions.oshi}"
val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.kotlinCoroutines}"
}
object iOs {
val ktorClient = "io.ktor:ktor-client-ios:${Versions.ktor}"
val ktorClientCore = "io.ktor:ktor-client-core-ios:${Versions.ktor}"
val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:${Versions.kotlinSerialization}"
val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${Versions.kotlinCoroutines}"
}

View File

@ -16,6 +16,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -1 +1 @@
./gradlew build publishJvmPublicationToSnapshotRepository publishJsPublicationToSnapshotRepository publishKotlinMultiplatformPublicationToSnapshotRepository publishLinuxPublicationToSnapshotRepository publishMetadataPublicationToSnapshotRepository
./gradlew build publishJvmPublicationToSnapshotRepository publishJsPublicationToSnapshotRepository publishKotlinMultiplatformPublicationToSnapshotRepository publishLinuxPublicationToSnapshotRepository publishMetadataPublicationToSnapshotRepository publishLinuxArm64PublicationToSnapshotRepository publishLinuxArm32HfpPublicationToSnapshotRepository

View File

@ -63,6 +63,14 @@ kotlin {
println("Destination dir ${it.compileKotlinTask.destinationDir}")
}
}
nodejs()
browser() {
testTask {
useKarma {
usePhantomJS()
}
}
}
}
linuxX64("linux") {
binaries {
@ -101,6 +109,36 @@ kotlin {
}
}
mingwX64() {
binaries {
staticLib {
}
}
}
mingwX86() {
binaries {
staticLib {
}
}
}
linuxArm32Hfp() {
binaries {
staticLib {
}
}
}
linuxArm64() {
binaries {
staticLib {
}
}
}
println(targets.names)
sourceSets {
@ -116,6 +154,7 @@ kotlin {
dependencies {
implementation(kotlin(Deps.Common.test))
implementation(kotlin(Deps.Common.testAnnotation))
implementation(Deps.Common.coroutines)
}
}
val jvmMain by getting {
@ -130,7 +169,6 @@ kotlin {
dependencies {
implementation(kotlin(Deps.Jvm.test))
implementation(kotlin(Deps.Jvm.testJUnit))
implementation(Deps.Jvm.oshi)
implementation(Deps.Jvm.coroutinesTest)
implementation(kotlin(Deps.Jvm.reflection))
}
@ -151,7 +189,10 @@ kotlin {
dependsOn(commonMain)
}
val nativeTest by creating {
dependsOn(commonTest)
dependencies {
implementation(Deps.Native.coroutines)
}
}
val iosMain by getting {
@ -187,6 +228,38 @@ kotlin {
val linuxTest by getting {
dependsOn(nativeTest)
}
val mingwX86Main by getting {
dependsOn(nativeMain)
}
val mingwX86Test by getting {
dependsOn(nativeTest)
}
val mingwX64Main by getting {
dependsOn(nativeMain)
}
val mingwX64Test 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)
}
}
@ -206,39 +279,6 @@ tasks {
val npmInstall by getting
val compileKotlinJs by getting(AbstractCompile::class)
val compileTestKotlinJs by getting(Kotlin2JsCompile::class)
val jsTest by getting
val populateNodeModulesForTests by creating {
dependsOn(npmInstall, compileKotlinJs, compileTestKotlinJs)
doLast {
copy {
from(compileKotlinJs.destinationDir)
configurations["jsRuntimeClasspath"].forEach {
from(zipTree(it.absolutePath).matching { include("*.js") })
}
configurations["jsTestRuntimeClasspath"].forEach {
from(zipTree(it.absolutePath).matching { include("*.js") })
}
into("$projectDir/node_modules")
}
}
}
val runTestsWithMocha by creating(NodeTask::class) {
dependsOn(populateNodeModulesForTests)
setScript(file("$projectDir/node_modules/mocha/bin/mocha"))
setArgs(listOf(
compileTestKotlinJs.outputFile,
"--reporter-options",
"topLevelSuite=${project.name}-tests"
))
}
jsTest.dependsOn("copyPackageJson")
jsTest.dependsOn(runTestsWithMocha)
create<Jar>("javadocJar") {
dependsOn(dokka)

View File

@ -1,15 +0,0 @@
{
"name": "kotlin-multiplatform-crypto-js",
"version": "0.0.1",
"description": "Kotlin Multiplatform Crypto",
"main": "crypto.js",
"author": "Ugljesa Jovanovic",
"license": "Apache 2.0",
"homepage": "",
"dependencies": {
"kotlin": "1.3.40"
},
"devDependencies": {
"mocha": "5.2.0"
}
}