diff --git a/samples/js/build.gradle b/samples/js/build.gradle deleted file mode 100644 index 58cf5274e4..0000000000 --- a/samples/js/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -// 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 - -buildscript { - ext { - // for infix-api -> change to 'atrium-infix-en_GB-js' - atrium_api = 'atrium-fluent-en_GB-js' - atrium_version = '0.16.0' - } -} - -plugins { - id 'org.jetbrains.kotlin.js' version '1.5.20' -} - -group 'org.atriumlib.samples' -version '0.0.1' - -repositories { - mavenCentral() -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-js" - - // setup for Atrium: - testImplementation("ch.tutteli.atrium:$atrium_api:$atrium_version") - - // setup for mocha: - testImplementation "org.jetbrains.kotlin:kotlin-test-js" -} - -kotlin { - js { - nodejs() - } -} diff --git a/samples/js/build.gradle.kts b/samples/js/build.gradle.kts new file mode 100644 index 0000000000..e4050285dd --- /dev/null +++ b/samples/js/build.gradle.kts @@ -0,0 +1,33 @@ +// 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 + +// for infix-api -> change to 'atrium-infix-en_GB-js' +val atriumApi = "atrium-fluent-en_GB-js" +val atriumVersion = "0.16.0" + +repositories { + mavenCentral() +} + +dependencies { + "implementation"("org.jetbrains.kotlin:kotlin-stdlib-js") + + // setup for Atrium: + "testImplementation"("ch.tutteli.atrium:$atriumApi:$atriumVersion") + + // setup for mocha: + "testImplementation"("org.jetbrains.kotlin:kotlin-test-js") +} + +plugins { + kotlin("js") version "1.5.20" +} + +group = "org.atriumlib.samples" +version = "0.0.1" + +kotlin { + js { + nodejs() + } +} diff --git a/samples/js/settings.gradle b/samples/js/settings.gradle.kts similarity index 100% rename from samples/js/settings.gradle rename to samples/js/settings.gradle.kts diff --git a/samples/jvm/junit5/build.gradle b/samples/jvm/junit5/build.gradle deleted file mode 100644 index f8da2c7b9e..0000000000 --- a/samples/jvm/junit5/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ -// Example project to show how to use Atrium in combination with JUnit5 -// For more information on how to setup Atrium for a JVM project -> https://github.com/robstoll/atrium#jvm - -import org.gradle.api.tasks.testing.logging.TestExceptionFormat - -buildscript { - ext { - atrium_version = '0.16.0' - junit_version = '5.7.2' - } -} - -plugins { - id 'org.jetbrains.kotlin.jvm' version '1.5.20' -} - -group 'org.atriumlib.samples' -version '0.0.1' - -repositories { - mavenCentral() -} - -dependencies { - // 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" - - // setup for junit5 - testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" -} - -test { - useJUnitPlatform { - includeEngines 'junit-jupiter' - } - testLogging { - exceptionFormat TestExceptionFormat.FULL - showExceptions true - showCauses true - showStackTraces true - } -} diff --git a/samples/jvm/junit5/build.gradle.kts b/samples/jvm/junit5/build.gradle.kts new file mode 100644 index 0000000000..4acb53cf5e --- /dev/null +++ b/samples/jvm/junit5/build.gradle.kts @@ -0,0 +1,43 @@ +// Example project to show how to use Atrium in combination with JUnit5 +// For more information on how to setup Atrium for a JVM project -> https://github.com/robstoll/atrium#jvm + +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" +} + +group = "org.atriumlib.samples" +version = "0.0.1" + +repositories { + mavenCentral() +} + +dependencies { + // 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:$atriumVersion") + + // setup for junit5 + testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion") +} + +tasks.test { + useJUnitPlatform { + includeEngines("junit-jupiter") + } + testLogging { + exceptionFormat = TestExceptionFormat.FULL + showExceptions = true + showCauses = true + showStackTraces = true + } +} diff --git a/samples/jvm/junit5/settings.gradle b/samples/jvm/junit5/settings.gradle.kts similarity index 100% rename from samples/jvm/junit5/settings.gradle rename to samples/jvm/junit5/settings.gradle.kts diff --git a/samples/jvm/spek/build.gradle b/samples/jvm/spek/build.gradle deleted file mode 100644 index b977ff2c25..0000000000 --- a/samples/jvm/spek/build.gradle +++ /dev/null @@ -1,47 +0,0 @@ -// Example project to show how to use Atrium in combination with Spek -// For more information on how to setup Atrium for a JVM project -> https://github.com/robstoll/atrium#jvm - -import org.gradle.api.tasks.testing.logging.TestExceptionFormat - -buildscript { - ext { - atrium_version = '0.16.0' - spek_version = '2.0.15' - } -} - -plugins { - id 'org.jetbrains.kotlin.jvm' version '1.5.20' -} - -group 'org.atriumlib.samples' -version '0.0.1' - -repositories { - mavenCentral() -} - -dependencies { - //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" - - // 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" -} - -test { - useJUnitPlatform { - includeEngines 'spek2' - } - testLogging { - exceptionFormat TestExceptionFormat.FULL - showExceptions true - showCauses true - showStackTraces true - } -} diff --git a/samples/jvm/spek/build.gradle.kts b/samples/jvm/spek/build.gradle.kts new file mode 100644 index 0000000000..b732687bae --- /dev/null +++ b/samples/jvm/spek/build.gradle.kts @@ -0,0 +1,43 @@ +// Example project to show how to use Atrium in combination with Spek +// For more information on how to setup Atrium for a JVM project -> https://github.com/robstoll/atrium#jvm + +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" +} + +group = "org.atriumlib.samples" +version = "0.0.1" + +repositories { + mavenCentral() +} + +dependencies { + //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:$atriumVersion") + + // setup for 'spek', for some kotlin-version + testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") + testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion") +} + +tasks.test { + useJUnitPlatform { + includeEngines("spek2") + } + testLogging { + exceptionFormat = TestExceptionFormat.FULL + showExceptions = true + showCauses = true + showStackTraces = true + } +} diff --git a/samples/jvm/spek/settings.gradle b/samples/jvm/spek/settings.gradle deleted file mode 100644 index 0b7b3521c2..0000000000 --- a/samples/jvm/spek/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -rootProject.name = 'atrium-spek' - diff --git a/samples/jvm/spek/settings.gradle.kts b/samples/jvm/spek/settings.gradle.kts new file mode 100644 index 0000000000..ea98b4e012 --- /dev/null +++ b/samples/jvm/spek/settings.gradle.kts @@ -0,0 +1,2 @@ +rootProject.name = "atrium-spek" + diff --git a/samples/multiplatform/build.gradle b/samples/multiplatform/build.gradle deleted file mode 100644 index e06faf9d39..0000000000 --- a/samples/multiplatform/build.gradle +++ /dev/null @@ -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 - } -} diff --git a/samples/multiplatform/build.gradle.kts b/samples/multiplatform/build.gradle.kts new file mode 100644 index 0000000000..558f04c173 --- /dev/null +++ b/samples/multiplatform/build.gradle.kts @@ -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 + } + } +} diff --git a/samples/multiplatform/settings.gradle b/samples/multiplatform/settings.gradle.kts similarity index 90% rename from samples/multiplatform/settings.gradle rename to samples/multiplatform/settings.gradle.kts index 4c283e3c55..ee1e4b6685 100644 --- a/samples/multiplatform/settings.gradle +++ b/samples/multiplatform/settings.gradle.kts @@ -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"