From b15488b8b9235f36e616d969c76ad4750a7694a6 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 12 Jul 2021 12:16:48 -0700 Subject: [PATCH 1/4] Migrate build to kotlin dsl for atrium-with-mocha --- samples/js/build.gradle | 37 ------------------- samples/js/build.gradle.kts | 33 +++++++++++++++++ .../{settings.gradle => settings.gradle.kts} | 0 3 files changed, 33 insertions(+), 37 deletions(-) delete mode 100644 samples/js/build.gradle create mode 100644 samples/js/build.gradle.kts rename samples/js/{settings.gradle => settings.gradle.kts} (100%) 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..5e70da467e --- /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 + +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") + + // 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 From 0910575c55f737ed9ad78bd628f018a16867de8e Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 12 Jul 2021 12:37:47 -0700 Subject: [PATCH 2/4] Migrate build to kotlin DSL for jvm samples --- samples/jvm/junit5/build.gradle | 47 ------------------- samples/jvm/junit5/build.gradle.kts | 42 +++++++++++++++++ .../{settings.gradle => settings.gradle.kts} | 0 samples/jvm/spek/build.gradle | 47 ------------------- samples/jvm/spek/build.gradle.kts | 42 +++++++++++++++++ samples/jvm/spek/settings.gradle | 2 - samples/jvm/spek/settings.gradle.kts | 2 + 7 files changed, 86 insertions(+), 96 deletions(-) delete mode 100644 samples/jvm/junit5/build.gradle create mode 100644 samples/jvm/junit5/build.gradle.kts rename samples/jvm/junit5/{settings.gradle => settings.gradle.kts} (100%) delete mode 100644 samples/jvm/spek/build.gradle create mode 100644 samples/jvm/spek/build.gradle.kts delete mode 100644 samples/jvm/spek/settings.gradle create mode 100644 samples/jvm/spek/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..2ba35c74cd --- /dev/null +++ b/samples/jvm/junit5/build.gradle.kts @@ -0,0 +1,42 @@ +// 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 + +plugins { + kotlin("jvm") version "1.5.20" +} + +group = "org.atriumlib.samples" +version = "0.0.1" + +repositories { + mavenCentral() +} + +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") + + // setup for junit5 + testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_version") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit_version") +} + +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..24a0f0224d --- /dev/null +++ b/samples/jvm/spek/build.gradle.kts @@ -0,0 +1,42 @@ +// 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 + +plugins { + kotlin("jvm") version "1.5.20" +} + +group = "org.atriumlib.samples" +version = "0.0.1" + +repositories { + mavenCentral() +} + +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") + + // 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") +} + +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" + From a7215d83c40d71b96d77e1b728802a7b8d689f34 Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 13 Jul 2021 11:05:29 -0700 Subject: [PATCH 3/4] Migrate multiplatform sample to kotlin dsl --- samples/js/build.gradle.kts | 8 +-- samples/jvm/junit5/build.gradle.kts | 11 +-- samples/jvm/spek/build.gradle.kts | 11 +-- samples/multiplatform/build.gradle | 70 ------------------- samples/multiplatform/build.gradle.kts | 69 ++++++++++++++++++ .../{settings.gradle => settings.gradle.kts} | 2 +- 6 files changed, 86 insertions(+), 85 deletions(-) delete mode 100644 samples/multiplatform/build.gradle create mode 100644 samples/multiplatform/build.gradle.kts rename samples/multiplatform/{settings.gradle => settings.gradle.kts} (90%) diff --git a/samples/js/build.gradle.kts b/samples/js/build.gradle.kts index 5e70da467e..5d6d2297c3 100644 --- a/samples/js/build.gradle.kts +++ b/samples/js/build.gradle.kts @@ -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") diff --git a/samples/jvm/junit5/build.gradle.kts b/samples/jvm/junit5/build.gradle.kts index 2ba35c74cd..4acb53cf5e 100644 --- a/samples/jvm/junit5/build.gradle.kts +++ b/samples/jvm/junit5/build.gradle.kts @@ -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 { diff --git a/samples/jvm/spek/build.gradle.kts b/samples/jvm/spek/build.gradle.kts index 24a0f0224d..b732687bae 100644 --- a/samples/jvm/spek/build.gradle.kts +++ b/samples/jvm/spek/build.gradle.kts @@ -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 { 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" From 3a7c9cdac7a25fe2cc5246cfa7dd2aef792276c0 Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 13 Jul 2021 11:48:05 -0700 Subject: [PATCH 4/4] Move note on infix-api to correct location --- samples/js/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/js/build.gradle.kts b/samples/js/build.gradle.kts index 5d6d2297c3..e4050285dd 100644 --- a/samples/js/build.gradle.kts +++ b/samples/js/build.gradle.kts @@ -1,6 +1,7 @@ // 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" @@ -9,7 +10,6 @@ repositories { } dependencies { - // for infix-api -> change to 'atrium-infix-en_GB-js' "implementation"("org.jetbrains.kotlin:kotlin-stdlib-js") // setup for Atrium: