Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(root): Introduce files module #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand All @@ -12,13 +11,19 @@ plugins {
id("org.openjfx.javafxplugin") version jfxVersion
}

repositories {
jcenter()
allprojects {
group = "luna"
version = "1.0"

repositories {
jcenter()
}
}

val junitVersion: String by project

dependencies {
implementation(project("files"))
implementation("com.google.code.gson:gson:2.8.5")
implementation("org.apache.logging.log4j:log4j-core:2.11.1")
implementation("org.apache.logging.log4j:log4j-api:2.11.1")
Expand All @@ -43,18 +48,10 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}

group = "luna"
version = "1.0"

application {
mainClassName = "io.luna.Luna"
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

sourceSets {
main {
withConvention(KotlinSourceSet::class) {
Expand All @@ -70,7 +67,6 @@ javafx {

tasks.withType<JavaCompile> {
options.compilerArgs = MutableList(1) { "-Xlint:unchecked" }
options.encoding = "UTF-8"
}

tasks.withType<KotlinCompile>().all {
Expand Down
15 changes: 15 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
plugins {
java
}

allprojects {
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
}

8 changes: 8 additions & 0 deletions files/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
`java-library`
}

dependencies {
implementation("com.google.code.gson:gson:2.8.5")
implementation("com.google.guava:guava:27.0.1-jre")
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.luna.util.parser;
package io.luna.files;

import com.google.common.collect.ImmutableList;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.luna.util.parser;
package io.luna.files;
notjuanortiz marked this conversation as resolved.
Show resolved Hide resolved

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.luna.util.parser;
package io.luna.files;

import java.io.BufferedReader;
import java.util.Scanner;
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
*/

rootProject.name = "luna"
include("network")
include("files")
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.google.common.collect.ImmutableList;
import com.google.common.net.InetAddresses;
import io.luna.net.LunaChannelFilter;
import io.luna.util.parser.AbstractNewLineFileParser;
import io.luna.files.AbstractNewLineFileParser;

/**
* A {@link AbstractNewLineFileParser} implementation that parses blacklisted addresses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.luna.game.model.def.EquipmentDefinition;
import io.luna.game.model.def.EquipmentDefinition.Requirement;
import io.luna.util.GsonUtils;
import io.luna.util.parser.AbstractJsonFileParser;
import io.luna.files.AbstractJsonFileParser;

/**
* A {@link AbstractJsonFileParser} implementation that reads equipment definitions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.JsonObject;
import io.luna.game.model.def.ItemDefinition;
import io.luna.util.GsonUtils;
import io.luna.util.parser.AbstractJsonFileParser;
import io.luna.files.AbstractJsonFileParser;

/**
* A {@link AbstractJsonFileParser} implementation that reads item definitions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import io.luna.net.msg.GameMessage;
import io.luna.net.msg.GameMessageReader;
import io.luna.net.msg.GameMessageRepository;
import io.luna.util.parser.AbstractJsonFileParser;
import io.luna.files.AbstractJsonFileParser;

import java.lang.reflect.Field;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.JsonObject;
import io.luna.game.model.def.NpcCombatDefinition;
import io.luna.util.GsonUtils;
import io.luna.util.parser.AbstractJsonFileParser;
import io.luna.files.AbstractJsonFileParser;

/**
* A {@link AbstractJsonFileParser} implementation that reads NPC combat definitions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.JsonObject;
import io.luna.game.model.def.NpcDefinition;
import io.luna.util.GsonUtils;
import io.luna.util.parser.AbstractJsonFileParser;
import io.luna.files.AbstractJsonFileParser;

/**
* A {@link AbstractJsonFileParser} implementation that reads NPC definitions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.gson.JsonObject;
import io.luna.game.model.def.ObjectDefinition;
import io.luna.util.GsonUtils;
import io.luna.util.parser.AbstractJsonFileParser;
import io.luna.files.AbstractJsonFileParser;

/**
* A {@link AbstractJsonFileParser} implementation that reads Object definitions.
Expand Down