From f100d2332adc9d300cf5dd521287dd864afb7f85 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 5 Apr 2021 14:30:59 -0400 Subject: [PATCH] more setup --- .gitignore | 4 +++ app/build.gradle | 35 ++++++++++++++----- app/lombok.config | 2 ++ .../main/java/ca/retrylife/ldjam48/App.java | 9 ++--- app/src/main/resources/log4j.properties | 10 ++++++ .../java/ca/retrylife/ldjam48/AppTest.java | 14 -------- 6 files changed, 45 insertions(+), 29 deletions(-) create mode 100644 app/lombok.config create mode 100644 app/src/main/resources/log4j.properties delete mode 100644 app/src/test/java/ca/retrylife/ldjam48/AppTest.java diff --git a/.gitignore b/.gitignore index 1b6985c..332b3a2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ # Ignore Gradle build output directory build +bin +.project +.settings +.classpath \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 21ad719..35749f7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,17 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This generated file contains a sample Java application project to get you started. - * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle - * User Manual available at https://docs.gradle.org/6.8.2/userguide/building_java_projects.html - */ +buildscript { + repositories { + jcenter() + mavenCentral() + } +} + plugins { // Apply the application plugin to add support for building a CLI application in Java. id 'application' + + id 'io.freefair.lombok' version '5.3.0' + id 'com.github.johnrengelman.shadow' version '6.1.0' } repositories { @@ -42,9 +45,25 @@ dependencies { implementation "dev.rsninja:gamej:1.+" implementation "dev.rsninja:gamej:1.+-sources" implementation "dev.rsninja:gamej:1.+-javadoc" + + // JSON + implementation 'com.google.code.gson:gson:2.8.6' + + // Logging + compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.13.3' + compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.13.3' + compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.13.3' + implementation "org.slf4j:slf4j-log4j12:1.8.0-alpha2" + + // Lombok + compileOnly 'org.projectlombok:lombok:1.18.16' + annotationProcessor 'org.projectlombok:lombok:1.18.16' + testCompileOnly 'org.projectlombok:lombok:1.18.16' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.16' } +mainClassName = "ca.retrylife.ldjam48.App" application { // Define the main class for the application. - mainClass = 'ca.retrylife.ldjam48.App' + mainClass = mainClassName } diff --git a/app/lombok.config b/app/lombok.config new file mode 100644 index 0000000..6aa51d7 --- /dev/null +++ b/app/lombok.config @@ -0,0 +1,2 @@ +# This file is generated by the 'io.freefair.lombok' Gradle plugin +config.stopBubbling = true diff --git a/app/src/main/java/ca/retrylife/ldjam48/App.java b/app/src/main/java/ca/retrylife/ldjam48/App.java index c6b3a39..e6a11b6 100644 --- a/app/src/main/java/ca/retrylife/ldjam48/App.java +++ b/app/src/main/java/ca/retrylife/ldjam48/App.java @@ -1,14 +1,9 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ package ca.retrylife.ldjam48; public class App { - public String getGreeting() { - return "Hello World!"; - } public static void main(String[] args) { - System.out.println(new App().getGreeting()); + + } } diff --git a/app/src/main/resources/log4j.properties b/app/src/main/resources/log4j.properties new file mode 100644 index 0000000..031988e --- /dev/null +++ b/app/src/main/resources/log4j.properties @@ -0,0 +1,10 @@ +log4j.rootLogger = INFO,console + +log4j.appender.console=org.apache.log4j.ConsoleAppender +log4j.appender.console.target=System.out +log4j.appender.console.immediateFlush=true +log4j.appender.console.encoding=UTF-8 +#log4j.appender.console.threshold=warn + +log4j.appender.console.layout=org.apache.log4j.PatternLayout +log4j.appender.console.layout.conversionPattern=%d [%t] %-5p %c - %m%n \ No newline at end of file diff --git a/app/src/test/java/ca/retrylife/ldjam48/AppTest.java b/app/src/test/java/ca/retrylife/ldjam48/AppTest.java deleted file mode 100644 index 93331d7..0000000 --- a/app/src/test/java/ca/retrylife/ldjam48/AppTest.java +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This Java source file was generated by the Gradle 'init' task. - */ -package ca.retrylife.ldjam48; - -import org.junit.Test; -import static org.junit.Assert.*; - -public class AppTest { - @Test public void testAppHasAGreeting() { - App classUnderTest = new App(); - assertNotNull("app should have a greeting", classUnderTest.getGreeting()); - } -}