mirror of
https://github.com/jlengrand/atrium.git
synced 2026-03-10 08:01:19 +00:00
Migrate multiplatform sample to kotlin dsl
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
// Example project to show how to use Atrium in combination with mocha
|
||||
// For more information on how to setup Atrium for a JS project -> https://github.com/robstoll/atrium#js
|
||||
|
||||
val atriumApi = "atrium-fluent-en_GB-js"
|
||||
val atriumVersion = "0.16.0"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// for infix-api -> change to 'atrium-infix-en_GB-js'
|
||||
val atrium_api = "atrium-fluent-en_GB-js"
|
||||
val atrium_version = "0.16.0"
|
||||
|
||||
"implementation"("org.jetbrains.kotlin:kotlin-stdlib-js")
|
||||
|
||||
// setup for Atrium:
|
||||
"testImplementation"("ch.tutteli.atrium:$atrium_api:$atrium_version")
|
||||
"testImplementation"("ch.tutteli.atrium:$atriumApi:$atriumVersion")
|
||||
|
||||
// setup for mocha:
|
||||
"testImplementation"("org.jetbrains.kotlin:kotlin-test-js")
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
|
||||
val atriumVersion = "0.16.0"
|
||||
val junitVersion = "5.7.2"
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.5.20"
|
||||
}
|
||||
@@ -15,18 +18,16 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val atrium_version = "0.16.0"
|
||||
val junit_version = "5.7.2"
|
||||
// junit5 requires jdk8, define dependency to stdlib-jdk at least in test
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
|
||||
// setup for Atrium:
|
||||
// for infix-api -> change artifact-id to 'atrium-infix-en_GB'
|
||||
testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:$atrium_version")
|
||||
testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:$atriumVersion")
|
||||
|
||||
// setup for junit5
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_version")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit_version")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
|
||||
val atriumVersion = "0.16.0"
|
||||
val spekVersion = "2.0.15"
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.5.20"
|
||||
}
|
||||
@@ -15,18 +18,16 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val atrium_version = "0.16.0"
|
||||
val spek_version = "2.0.15"
|
||||
//spek requires jdk8, define dependency to stdlib-jdk at least in test
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
||||
|
||||
// setup for Atrium:
|
||||
// for infix-api -> change artifact-id to 'atrium-infix-en_GB'
|
||||
testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:$atrium_version")
|
||||
testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:$atriumVersion")
|
||||
|
||||
// setup for 'spek', for some kotlin-version
|
||||
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spek_version")
|
||||
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spek_version")
|
||||
testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
|
||||
testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
// Example project to show how to use Atrium in a multiplatform project
|
||||
// For more information on how to setup Atrium for a multiplatform project -> https://github.com/robstoll/atrium#common
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
// for infix-api -> change to 'atrium-infix-en_GB'
|
||||
atrium_api = 'atrium-fluent-en_GB'
|
||||
atrium_version = '0.16.0'
|
||||
junit_version = '5.7.2'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.multiplatform' version '1.5.20'
|
||||
}
|
||||
|
||||
group 'org.atriumlib.samples'
|
||||
version '0.0.1'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
js().nodejs{}
|
||||
sourceSets {
|
||||
commonTest {
|
||||
dependencies {
|
||||
// setup for Atrium:
|
||||
implementation "ch.tutteli.atrium:$atrium_api-common:$atrium_version"
|
||||
|
||||
// setup for common tests:
|
||||
implementation kotlin('test-common')
|
||||
implementation kotlin('test-annotations-common')
|
||||
}
|
||||
}
|
||||
jvmTest {
|
||||
dependencies {
|
||||
// setup for Atrium:
|
||||
implementation "ch.tutteli.atrium:$atrium_api:$atrium_version"
|
||||
|
||||
// setup for Junit5:
|
||||
implementation kotlin('test')
|
||||
implementation kotlin('test-junit')
|
||||
implementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
|
||||
}
|
||||
}
|
||||
jsTest {
|
||||
dependencies {
|
||||
// setup for Atrium:
|
||||
implementation "ch.tutteli.atrium:$atrium_api-js:$atrium_version"
|
||||
|
||||
// setup for mocha:
|
||||
implementation kotlin('test-js')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jvmTest {
|
||||
testLogging {
|
||||
exceptionFormat TestExceptionFormat.FULL
|
||||
showExceptions true
|
||||
showCauses true
|
||||
showStackTraces true
|
||||
}
|
||||
}
|
||||
69
samples/multiplatform/build.gradle.kts
Normal file
69
samples/multiplatform/build.gradle.kts
Normal file
@@ -0,0 +1,69 @@
|
||||
// Example project to show how to use Atrium in a multiplatform project
|
||||
// For more information on how to setup Atrium for a multiplatform project -> https://github.com/robstoll/atrium#common
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
|
||||
// for infix-api -> change to 'atrium-infix-en_GB'
|
||||
val atriumApi = "atrium-fluent-en_GB"
|
||||
val atriumVersion = "0.16.0"
|
||||
val junitVersion = "5.7.2"
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.5.20"
|
||||
}
|
||||
|
||||
group = "org.atriumlib.samples"
|
||||
version = "0.0.1"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
js().nodejs()
|
||||
sourceSets {
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
// setup for Atrium:
|
||||
implementation("ch.tutteli.atrium:$atriumApi-common:$atriumVersion")
|
||||
|
||||
// setup for common tests:
|
||||
implementation(kotlin("test-common"))
|
||||
implementation(kotlin("test-annotations-common"))
|
||||
}
|
||||
}
|
||||
val jvmTest by getting {
|
||||
dependencies {
|
||||
// setup for Atrium:
|
||||
implementation("ch.tutteli.atrium:$atriumApi:$atriumVersion")
|
||||
|
||||
// setup for Junit5:
|
||||
implementation(kotlin("test"))
|
||||
implementation(kotlin("test-junit"))
|
||||
implementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
|
||||
}
|
||||
|
||||
}
|
||||
val jsTest by getting {
|
||||
dependencies {
|
||||
// setup for Atrium:
|
||||
implementation("ch.tutteli.atrium:$atriumApi-js:$atriumVersion")
|
||||
|
||||
// setup for mocha:
|
||||
implementation(kotlin("test-js"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
val jvmTest by getting(Test::class) {
|
||||
testLogging {
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
showExceptions = true
|
||||
showCauses = true
|
||||
showStackTraces = true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,4 +7,4 @@
|
||||
* in the user manual at https://docs.gradle.org/6.0.1/userguide/multi_project_builds.html
|
||||
*/
|
||||
|
||||
rootProject.name = 'multiplatform'
|
||||
rootProject.name = "multiplatform"
|
||||
Reference in New Issue
Block a user