diff --git a/build.gradle.kts b/build.gradle.kts index 0066798..dc12f58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,29 +10,30 @@ subprojects { val annotationProcessor by configurations val testCompileOnly by configurations val testAnnotationProcessor by configurations + val runtimeOnly by configurations repositories { mavenCentral() } dependencies { - implementation("org.jetbrains:annotations:22.0.0") - implementation("com.google.code.gson:gson:2.8.8") + implementation(Annotations.id) + implementation(Gson.id) - implementation("org.apache.logging.log4j:log4j-api:2.14.1") - implementation("org.apache.logging.log4j:log4j-core:2.14.1") - implementation("org.apache.logging.log4j:log4j-slf4j-impl:2.14.1") + implementation(Log4j2.api) + runtimeOnly(Log4j2.core) + runtimeOnly(Log4j2.slf4j) - testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") - testImplementation("org.junit.jupiter:junit-jupiter-engine:5.8.1") - testImplementation("org.mockito:mockito-inline:4.0.0") - testImplementation("org.mockito:mockito-junit-jupiter:4.0.0") + testImplementation(JUnit.jupiter) + testImplementation(JUnit.jupiter_engine) + testImplementation(Mockito.inline) + testImplementation(Mockito.jupiter) - compileOnly("org.projectlombok:lombok:1.18.22") - annotationProcessor("org.projectlombok:lombok:1.18.22") + compileOnly(Lombok.id) + annotationProcessor(Lombok.id) - testCompileOnly("org.projectlombok:lombok:1.18.22") - testAnnotationProcessor("org.projectlombok:lombok:1.18.22") + testCompileOnly(Lombok.id) + testAnnotationProcessor(Lombok.id) } tasks { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..6488c73 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + kotlin("jvm") version "1.6.0" +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(gradleApi()) +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt new file mode 100644 index 0000000..dce112f --- /dev/null +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -0,0 +1,88 @@ +@file:Suppress("MemberVisibilityCanBePrivate") + +object Log4j2 { + const val version = "2.14.1" + const val group = "org.apache.logging.log4j" + + const val api = "$group:log4j-api:$version" + const val core = "$group:log4j-core:$version" + const val slf4j = "$group:log4j-slf4j-impl:$version" +} + +object Lombok { + const val version = "1.18.22" + const val group = "org.projectlombok" + + const val id = "$group:lombok:$version" +} + +object JUnit { + const val version = "5.8.1" + const val group = "org.junit.jupiter" + + const val jupiter = "$group:junit-jupiter:$version" + const val jupiter_engine = "$group:junit-jupiter-engine:$version" +} + +object Mockito { + const val version = "4.0.0" + const val group = "org.mockito" + + const val inline = "$group:mockito-inline:$version" + const val jupiter = "$group:mockito-junit-jupiter:$version" +} + +object Gson { + const val version = "2.8.8" + const val group = "com.google.code.gson" + + const val id = "$group:gson:$version" +} + +object Annotations { + const val version = "22.0.0" + const val group = "org.jetbrains" + + const val id = "$group:annotations:$version" +} + +object LibGDX { + const val version = "1.10.0" + const val group = "com.badlogicgames.gdx" + + const val api = "$group:gdx:$version" + const val box2d = "$group:gdx-box2d:$version" + + const val backend_lwjgl3 = "$group:gdx-backend-lwjgl3:$version" + const val platform_desktop = "$group:gdx-platform:$version:natives-desktop" + const val box2d_platform_desktop = "$group:gdx-box2d-platform:$version:natives-desktop" + + const val tools = "$group:gdx-tools:$version" +} + +object PicoCLI { + const val version = "4.6.2" + const val group = "info.picocli" + + const val core = "$group:picocli:$version" + const val shell_jline3 = "$group:picocli-shell-jline3:$version" + const val codegen = "$group:picocli-codegen:$version" +} + +object JLine { + const val version = "3.20.0" + const val group = "org.jline" + const val id = "$group:jline:$version" +} + +object Jansi { + const val version = "2.4.0" + const val group = "org.fusesource.jansi" + const val id = "$group:jansi:$version" +} + +object JavaWebSocket { + const val version = "1.5.2" + const val group = "org.java-websocket" + const val id = "$group:Java-WebSocket:$version" +} \ No newline at end of file diff --git a/wizard-client/wizard-client-cli/build.gradle.kts b/wizard-client/wizard-client-cli/build.gradle.kts new file mode 100644 index 0000000..400f764 --- /dev/null +++ b/wizard-client/wizard-client-cli/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + application +} + +dependencies { + implementation(JLine.id) + implementation(Jansi.id) + implementation(JavaWebSocket.id) + + implementation(PicoCLI.core) + implementation(PicoCLI.shell_jline3) { + exclude(group = JLine.group) // prevent duplicates with org.jline:jline) + } + annotationProcessor(PicoCLI.codegen) +} + +application { + mainClass.set("eu.jonahbauer.wizard.client.cli.Client") +} \ No newline at end of file diff --git a/wizard-client/wizard-client-libgdx/build.gradle.kts b/wizard-client/wizard-client-libgdx/build.gradle.kts index d06347c..be4cca3 100644 --- a/wizard-client/wizard-client-libgdx/build.gradle.kts +++ b/wizard-client/wizard-client-libgdx/build.gradle.kts @@ -4,9 +4,9 @@ project(":wizard-client:wizard-client-libgdx:desktop") { dependencies { implementation(project(":wizard-client:wizard-client-libgdx:core")) - api("com.badlogicgames.gdx:gdx-backend-lwjgl3:1.10.0") - api("com.badlogicgames.gdx:gdx-platform:1.10.0:natives-desktop") - api("com.badlogicgames.gdx:gdx-box2d-platform:1.10.0:natives-desktop") + api(LibGDX.backend_lwjgl3) + api(LibGDX.platform_desktop) + api(LibGDX.box2d_platform_desktop) } } @@ -14,7 +14,7 @@ project(":wizard-client:wizard-client-libgdx:core") { apply(plugin = "java-library") dependencies { - api( "com.badlogicgames.gdx:gdx:1.10.0") - api("com.badlogicgames.gdx:gdx-box2d:1.10.0") + api( LibGDX.api) + api(LibGDX.box2d) } }