diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..21f2a33 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,5 @@ +quarkusPluginId=io.quarkus +quarkusPluginVersion=3.32.4 +quarkusPlatformGroupId=io.quarkus.platform +quarkusPlatformArtifactId=quarkus-bom +quarkusPlatformVersion=3.32.4 diff --git a/modules/backcore/build.gradle.kts b/modules/backcore/build.gradle.kts new file mode 100644 index 0000000..d3c228e --- /dev/null +++ b/modules/backcore/build.gradle.kts @@ -0,0 +1,88 @@ +plugins { + id("scala") + id("org.scoverage") version "8.1" + id("io.quarkus") +} + +@Suppress("UNCHECKED_CAST") +val versions = rootProject.extra["VERSIONS"] as Map + +repositories { + mavenCentral() + mavenLocal() +} + +scala { + scalaVersion = versions["SCALA3"]!! +} + +scoverage { + scoverageVersion.set(versions["SCOVERAGE"]!!) +} + +tasks.withType { + scalaCompileOptions.additionalParameters = listOf("-encoding", "UTF-8") +} + +val quarkusPlatformGroupId: String by project +val quarkusPlatformArtifactId: String by project +val quarkusPlatformVersion: String by project + +dependencies { + implementation(project(":modules:api")) + implementation(project(":modules:core")) + implementation(project(":modules:io")) + implementation(project(":modules:rule")) + + implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")) + implementation("io.quarkus:quarkus-rest") + implementation("io.quarkus:quarkus-rest-jackson") + implementation("io.quarkus:quarkus-config-yaml") + implementation("io.quarkus:quarkus-arc") + + implementation("com.fasterxml.jackson.module:jackson-module-scala_3:2.18.0") + + testImplementation(platform("org.junit:junit-bom:5.13.4")) + testImplementation("org.junit.jupiter:junit-jupiter") + testImplementation("org.scalatest:scalatest_3:${versions["SCALATEST"]!!}") + testImplementation("co.helmethair:scalatest-junit-runner:${versions["SCALATEST_JUNIT"]!!}") + testImplementation("io.quarkus:quarkus-junit5") + testImplementation("io.rest-assured:rest-assured") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +configurations.matching { !it.name.startsWith("scoverage") }.configureEach { + resolutionStrategy.force("org.scala-lang:scala-library:${versions["SCALA_LIBRARY"]!!}") +} +configurations.scoverage { + resolutionStrategy.eachDependency { + if (requested.group == "org.scoverage" && requested.name.startsWith("scalac-scoverage-plugin_")) { + useTarget("${requested.group}:scalac-scoverage-plugin_2.13.16:2.3.0") + } + } +} + +group = "de.nowchess" +version = "1.0-SNAPSHOT" + +tasks.withType { + options.encoding = "UTF-8" + options.compilerArgs.add("-parameters") +} + +tasks.withType().configureEach { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE +} + +tasks.test { + useJUnitPlatform { + includeEngines("scalatest", "junit-jupiter") + testLogging { + events("passed", "skipped", "failed") + } + } + finalizedBy(tasks.reportScoverage) +} +tasks.reportScoverage { + dependsOn(tasks.test) +} diff --git a/modules/backcore/src/main/resources/application.yml b/modules/backcore/src/main/resources/application.yml new file mode 100644 index 0000000..85b85bb --- /dev/null +++ b/modules/backcore/src/main/resources/application.yml @@ -0,0 +1,3 @@ +quarkus: + http: + port: 8080 diff --git a/modules/backcore/src/test/scala/de/nowchess/backcore/BackcoreStartupTest.scala b/modules/backcore/src/test/scala/de/nowchess/backcore/BackcoreStartupTest.scala new file mode 100644 index 0000000..66e0c47 --- /dev/null +++ b/modules/backcore/src/test/scala/de/nowchess/backcore/BackcoreStartupTest.scala @@ -0,0 +1,11 @@ +package de.nowchess.backcore + +import io.quarkus.test.junit.QuarkusTest +import org.junit.jupiter.api.Test + +@QuarkusTest +class BackcoreStartupTest: + @Test + def applicationStarts(): Unit = + // If we get here the Quarkus container started successfully + () diff --git a/settings.gradle.kts b/settings.gradle.kts index 1571957..c4b72ae 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,23 @@ rootProject.name = "NowChessSystems" + +pluginManagement { + val quarkusPluginVersion: String by settings + val quarkusPluginId: String by settings + repositories { + mavenCentral() + gradlePluginPortal() + mavenLocal() + } + plugins { + id(quarkusPluginId) version quarkusPluginVersion + } +} + include( "modules:core", "modules:api", "modules:io", "modules:rule", "modules:ui", -) \ No newline at end of file + "modules:backcore", +)