diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c69d41c..19373fcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed +- Minimum supported kotlin version is 1.4.0 +- Multiplatform artifacts are published as a single artifact. You can now just write + ```groovy + sourceSets { + commonTest { + dependencies { + implementation "com.willowtreeapps.assertk:assertk:..." + } + } + } + ``` +instead of defining one for each platform. +- Added support for the Kotlin/JS [IR compiler](https://kotlinlang.org/docs/reference/js-ir-compiler.html) + ### Added - Add `prop` function with `KProperty1` argument. @@ -13,6 +28,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Deprecated `prop` function with `KCallable` argument. Use the new overload with type-safe `KProperty1` argument or another overload with explicit name and lambda. +### Fixed +- Primitive array 'contains' methods now work with NaN. ex: + ```kotlin + assertThat(floatArrayOf(Float.Nan)).contains(Float.NaN) + ``` + will pass when it failed before. + ## [0.22] 2020-03-11 ### Added diff --git a/assertk-coroutines/build.gradle b/assertk-coroutines/build.gradle index 1e22a9c1..c6395d08 100644 --- a/assertk-coroutines/build.gradle +++ b/assertk-coroutines/build.gradle @@ -13,38 +13,8 @@ kotlin { commonMain { dependencies { implementation project(':assertk') - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$kotlin_coroutines_version" - } - } - jvmMain { - dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" } } - jsMain { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$kotlin_coroutines_version" - } - } - linuxMain { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-linuxx64:$kotlin_coroutines_version" - } - } - iosArm64Main { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-iosarm64:$kotlin_coroutines_version" - } - } - iosX64Main { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-iosx64:$kotlin_coroutines_version" - } - } - macosMain { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-macosx64:$kotlin_coroutines_version" - } - } } } diff --git a/assertk/build.gradle b/assertk/build.gradle index 23dfeb2e..4c4230bf 100644 --- a/assertk/build.gradle +++ b/assertk/build.gradle @@ -40,18 +40,11 @@ kotlin { implementation project(':java-interop') } } - jsMain { - dependencies { - // kotlin-js doesn't handle this as a transitive dep correctly - // when it's scoped as runtime. - api "com.willowtreeapps.opentest4k:opentest4k-js:$opentest4k_version" - } - } } } -[compileKotlinJvm, compileKotlinJs].each { it.dependsOn(compileTemplates) } -[compileTestKotlinJvm, compileTestKotlinJs].each { it.dependsOn(compileTestTemplates) } +[compileKotlinJvm, compileKotlinJsLegacy, compileKotlinJsIr].each { it.dependsOn(compileTemplates) } +[compileTestKotlinJvm, compileTestKotlinJsLegacy, compileTestKotlinJsIr].each { it.dependsOn(compileTestTemplates) } gitPublish { repoUri = 'git@github.com:willowtreeapps/assertk.git' diff --git a/assertk/src/jsTest/kotlin/test/assertk/JSAssertLambdaTest.kt b/assertk/src/jsTest/kotlin/test/assertk/JSAssertLambdaTest.kt index 28141109..c1d32916 100644 --- a/assertk/src/jsTest/kotlin/test/assertk/JSAssertLambdaTest.kt +++ b/assertk/src/jsTest/kotlin/test/assertk/JSAssertLambdaTest.kt @@ -2,7 +2,6 @@ package test.assertk import assertk.assertThat import assertk.assertions.* -import assertk.catch import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.promise import kotlin.test.Test diff --git a/assertk/src/jvmTest/kotlin/test/assertk/JVMAssertLambdaTest.kt b/assertk/src/jvmTest/kotlin/test/assertk/JVMAssertLambdaTest.kt index e4e315ca..7911bbce 100644 --- a/assertk/src/jvmTest/kotlin/test/assertk/JVMAssertLambdaTest.kt +++ b/assertk/src/jvmTest/kotlin/test/assertk/JVMAssertLambdaTest.kt @@ -4,14 +4,14 @@ import assertk.* import assertk.assertions.* import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay -import kotlinx.coroutines.test.runBlockingTest +import kotlinx.coroutines.runBlocking import org.junit.Test class JVMAssertLambdaTest { @OptIn(ExperimentalCoroutinesApi::class) @Test fun returnedValue_works_in_coroutine_test() { - runBlockingTest { + runBlocking { assertThat { asyncReturnValue() }.isSuccess().isEqualTo(1) @@ -20,7 +20,7 @@ class JVMAssertLambdaTest { @OptIn(ExperimentalCoroutinesApi::class) @Test fun returnedValue_exception_works_in_coroutine_test() { - runBlockingTest { + runBlocking { assertThat { asyncThrows() }.isFailure().hasMessage("test") diff --git a/assertk/src/nativeTest/kotlin/test/assertk/exceptionName.kt b/assertk/src/nativeTest/kotlin/test/assertk/exceptionName.kt index 5de246ec..4a6ff053 100644 --- a/assertk/src/nativeTest/kotlin/test/assertk/exceptionName.kt +++ b/assertk/src/nativeTest/kotlin/test/assertk/exceptionName.kt @@ -2,4 +2,4 @@ package test.assertk actual val exceptionPackageName: String = "kotlin." -actual val opentestPackageName: String = "" +actual val opentestPackageName: String = "com.willowtreeapps.opentest4k." diff --git a/build.gradle b/build.gradle index 1a1804ca..ca031be4 100644 --- a/build.gradle +++ b/build.gradle @@ -3,22 +3,23 @@ import io.gitlab.arturbosch.detekt.Detekt import org.jetbrains.dokka.gradle.DokkaTask plugins { - id 'org.jetbrains.kotlin.multiplatform' version '1.3.70' apply false + id 'org.jetbrains.kotlin.multiplatform' version '1.4.0' apply false id 'org.jetbrains.dokka' version '1.4.0-rc' apply false id 'io.gitlab.arturbosch.detekt' version '1.5.0' apply false id 'org.ajoberstar.git-publish' version '2.1.1' apply false } +version = '0.23-SNAPSHOT' + ext { - isReleaseVersion = !(project.version =~ /-SNAPSHOT$/) + isReleaseVersion = !(version =~ /-SNAPSHOT$/) - opentest4k_version = '1.2.0' - kotlin_coroutines_version = '1.3.4' + opentest4k_version = '1.2.1-SNAPSHOT' + kotlin_coroutines_version = '1.3.9' } subprojects { group 'com.willowtreeapps.assertk' - version '0.23-SNAPSHOT' configurations.all { // Don't cache SNAPSHOT deps diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 1d7ddd8c..3014cdd7 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.30' + ext.kotlin_version = '1.4.0' repositories { mavenCentral() @@ -18,5 +18,4 @@ repositories { dependencies { compile gradleApi() - compile "org.jetbrains.kotlin:kotlin-stdlib" } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ceddf08f..374c9151 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,3 @@ -org.gradle.jvmargs=-Xmx2048m \ No newline at end of file +org.gradle.jvmargs=-Xmx2048m +kotlin.mpp.enableGranularSourceSetsMetadata=true +kotlin.native.enableDependencyPropagation=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b7c8c5db..6c9a2247 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/multiplatform.gradle b/multiplatform.gradle index ad8a5480..57caa45d 100644 --- a/multiplatform.gradle +++ b/multiplatform.gradle @@ -7,7 +7,7 @@ kotlin { jvmTarget = "1.8" } } - js { + js(BOTH) { nodejs() browser() compilations.main.kotlinOptions { @@ -19,17 +19,16 @@ kotlin { } } linuxX64('linux') - iosArm64() - iosX64() + ios() macosX64('macos') targets.all { if (name != 'metadata') { compilations.main.kotlinOptions { - allWarningsAsErrors = true +// allWarningsAsErrors = true } compilations.test.kotlinOptions { - allWarningsAsErrors = true +// allWarningsAsErrors = true freeCompilerArgs += ["-Xopt-in=kotlin.RequiresOptIn"] } } @@ -37,37 +36,27 @@ kotlin { sourceSets { commonMain { - dependencies { - implementation kotlin('stdlib-common') - } } commonTest { dependencies { implementation kotlin('test-common') implementation kotlin('test-annotations-common') + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version" } } jvmMain { - dependencies { - implementation kotlin('stdlib-jdk8') - } } jvmTest { dependencies { implementation kotlin('test-junit') implementation kotlin('reflect') - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlin_coroutines_version" } } jsMain { - dependencies { - implementation kotlin('stdlib-js') - } } jsTest { dependencies { implementation kotlin('test-js') - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-js:$kotlin_coroutines_version" } } nativeMain { @@ -76,31 +65,19 @@ kotlin { nativeTest { dependsOn(commonTest) } - [linuxMain, iosArm64Main, iosX64Main, macosMain].each { + [linuxMain, iosMain, macosMain].each { it.dependsOn(nativeMain) } - [linuxTest, iosArm64Test, iosX64Test, macosTest].each { + [linuxTest, iosTest, macosTest].each { it.dependsOn(nativeTest) } linuxTest { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-linuxx64:$kotlin_coroutines_version" - } } iosArm64Test { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-iosarm64:$kotlin_coroutines_version" - } } iosX64Test { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-iosx64:$kotlin_coroutines_version" - } } macosTest { - dependencies { - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-macosx64:$kotlin_coroutines_version" - } } } } @@ -110,6 +87,6 @@ task nativeTest { } task test { - dependsOn(jvmTest, jsTest, nativeTest) + dependsOn(allTests) } diff --git a/settings.gradle b/settings.gradle index 5ed4a0b2..e894f86e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,5 +3,3 @@ rootProject.name = 'assertk-project' include 'assertk' include 'assertk-coroutines' include 'java-interop' - -enableFeaturePreview('GRADLE_METADATA')