From 1b176c43f282088dc1ff77524e0604686cda57f0 Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 5 Apr 2021 14:24:41 -0400 Subject: [PATCH] Set up GameJ and Jstate support --- .gitignore | 11 ---- app/build.gradle | 50 +++++++++++++++++++ .../main/java/ca/retrylife/ldjam48/App.java | 14 ++++++ .../java/ca/retrylife/ldjam48/AppTest.java | 14 ++++++ build.gradle | 6 --- settings.gradle | 1 + 6 files changed, 79 insertions(+), 17 deletions(-) create mode 100644 app/build.gradle create mode 100644 app/src/main/java/ca/retrylife/ldjam48/App.java create mode 100644 app/src/test/java/ca/retrylife/ldjam48/AppTest.java delete mode 100644 build.gradle diff --git a/.gitignore b/.gitignore index 5ac3804..1b6985c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,3 @@ -# Generated by Cargo -# will have compiled files and executables -/target/ - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk - # Ignore Gradle project-specific cache directory .gradle diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..21ad719 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,50 @@ +/* + * 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 + */ + +plugins { + // Apply the application plugin to add support for building a CLI application in Java. + id 'application' +} + +repositories { + // Use JCenter for resolving dependencies. + jcenter() + + maven { + name = "RetryLife Release" + url = "https://release.maven.retrylife.ca" + } + + maven { + name = "RetryLife Snapshot" + url = "https://snapshot.maven.retrylife.ca" + } +} + +dependencies { + // Use JUnit test framework. + testImplementation 'junit:junit:4.13' + + // This dependency is used by the application. + implementation 'com.google.guava:guava:29.0-jre' + + // State machines + implementation "ca.retrylife:jstate:1.+" + implementation "ca.retrylife:jstate:1.+-sources" + implementation "ca.retrylife:jstate:1.+-javadoc" + + // GameJ + implementation "dev.rsninja:gamej:1.+" + implementation "dev.rsninja:gamej:1.+-sources" + implementation "dev.rsninja:gamej:1.+-javadoc" +} + +application { + // Define the main class for the application. + mainClass = 'ca.retrylife.ldjam48.App' +} diff --git a/app/src/main/java/ca/retrylife/ldjam48/App.java b/app/src/main/java/ca/retrylife/ldjam48/App.java new file mode 100644 index 0000000..c6b3a39 --- /dev/null +++ b/app/src/main/java/ca/retrylife/ldjam48/App.java @@ -0,0 +1,14 @@ +/* + * 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/test/java/ca/retrylife/ldjam48/AppTest.java b/app/src/test/java/ca/retrylife/ldjam48/AppTest.java new file mode 100644 index 0000000..93331d7 --- /dev/null +++ b/app/src/test/java/ca/retrylife/ldjam48/AppTest.java @@ -0,0 +1,14 @@ +/* + * 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()); + } +} diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 987a45e..0000000 --- a/build.gradle +++ /dev/null @@ -1,6 +0,0 @@ -/* - * This file was generated by the Gradle 'init' task. - * - * This is a general purpose Gradle build. - * Learn more about Gradle by exploring our samples at https://docs.gradle.org/6.8.2/samples - */ diff --git a/settings.gradle b/settings.gradle index 158af16..19b8c82 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,3 +8,4 @@ */ rootProject.name = 'ludum-dare-48' +include('app')