diff --git a/build.gradle.kts b/build.gradle.kts index 1e61a92b..8cdc8741 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ - import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -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") @@ -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) { @@ -70,7 +67,6 @@ javafx { tasks.withType { options.compilerArgs = MutableList(1) { "-Xlint:unchecked" } - options.encoding = "UTF-8" } tasks.withType().all { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..31d1cde7 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + java +} + +allprojects { + java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + tasks.withType { + options.encoding = "UTF-8" + } +} + diff --git a/files/build.gradle.kts b/files/build.gradle.kts new file mode 100644 index 00000000..f236bf91 --- /dev/null +++ b/files/build.gradle.kts @@ -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") +} \ No newline at end of file diff --git a/src/main/java/io/luna/util/parser/AbstractFileParser.java b/files/src/main/java/io/luna/files/AbstractFileParser.java similarity index 99% rename from src/main/java/io/luna/util/parser/AbstractFileParser.java rename to files/src/main/java/io/luna/files/AbstractFileParser.java index d4c72964..6de7af77 100644 --- a/src/main/java/io/luna/util/parser/AbstractFileParser.java +++ b/files/src/main/java/io/luna/files/AbstractFileParser.java @@ -1,4 +1,4 @@ -package io.luna.util.parser; +package io.luna.files; import com.google.common.collect.ImmutableList; diff --git a/src/main/java/io/luna/util/parser/AbstractJsonFileParser.java b/files/src/main/java/io/luna/files/AbstractJsonFileParser.java similarity index 97% rename from src/main/java/io/luna/util/parser/AbstractJsonFileParser.java rename to files/src/main/java/io/luna/files/AbstractJsonFileParser.java index a43bc291..74f115f6 100644 --- a/src/main/java/io/luna/util/parser/AbstractJsonFileParser.java +++ b/files/src/main/java/io/luna/files/AbstractJsonFileParser.java @@ -1,4 +1,4 @@ -package io.luna.util.parser; +package io.luna.files; import com.google.gson.JsonArray; import com.google.gson.JsonElement; diff --git a/src/main/java/io/luna/util/parser/AbstractNewLineFileParser.java b/files/src/main/java/io/luna/files/AbstractNewLineFileParser.java similarity index 98% rename from src/main/java/io/luna/util/parser/AbstractNewLineFileParser.java rename to files/src/main/java/io/luna/files/AbstractNewLineFileParser.java index 9fb651aa..4a1e27fb 100644 --- a/src/main/java/io/luna/util/parser/AbstractNewLineFileParser.java +++ b/files/src/main/java/io/luna/files/AbstractNewLineFileParser.java @@ -1,4 +1,4 @@ -package io.luna.util.parser; +package io.luna.files; import java.io.BufferedReader; import java.util.Scanner; diff --git a/settings.gradle.kts b/settings.gradle.kts index ff326966..ee8d7f2b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,3 +3,5 @@ */ rootProject.name = "luna" +include("network") +include("files") diff --git a/src/main/java/io/luna/util/parser/impl/BlacklistFileParser.java b/src/main/java/io/luna/util/parser/impl/BlacklistFileParser.java index 5f958c58..dbc4d917 100644 --- a/src/main/java/io/luna/util/parser/impl/BlacklistFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/BlacklistFileParser.java @@ -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. diff --git a/src/main/java/io/luna/util/parser/impl/EquipmentDefinitionFileParser.java b/src/main/java/io/luna/util/parser/impl/EquipmentDefinitionFileParser.java index 0b588caf..9fd035ef 100644 --- a/src/main/java/io/luna/util/parser/impl/EquipmentDefinitionFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/EquipmentDefinitionFileParser.java @@ -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. diff --git a/src/main/java/io/luna/util/parser/impl/ItemDefinitionFileParser.java b/src/main/java/io/luna/util/parser/impl/ItemDefinitionFileParser.java index b797d6ef..41f5376e 100644 --- a/src/main/java/io/luna/util/parser/impl/ItemDefinitionFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/ItemDefinitionFileParser.java @@ -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. diff --git a/src/main/java/io/luna/util/parser/impl/MessageRepositoryFileParser.java b/src/main/java/io/luna/util/parser/impl/MessageRepositoryFileParser.java index 25485868..727196ec 100644 --- a/src/main/java/io/luna/util/parser/impl/MessageRepositoryFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/MessageRepositoryFileParser.java @@ -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; diff --git a/src/main/java/io/luna/util/parser/impl/NpcCombatDefinitionFileParser.java b/src/main/java/io/luna/util/parser/impl/NpcCombatDefinitionFileParser.java index e88f1a70..b62d99a4 100644 --- a/src/main/java/io/luna/util/parser/impl/NpcCombatDefinitionFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/NpcCombatDefinitionFileParser.java @@ -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. diff --git a/src/main/java/io/luna/util/parser/impl/NpcDefinitionFileParser.java b/src/main/java/io/luna/util/parser/impl/NpcDefinitionFileParser.java index 544c515f..4e6b8f84 100644 --- a/src/main/java/io/luna/util/parser/impl/NpcDefinitionFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/NpcDefinitionFileParser.java @@ -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. diff --git a/src/main/java/io/luna/util/parser/impl/ObjectDefinitionFileParser.java b/src/main/java/io/luna/util/parser/impl/ObjectDefinitionFileParser.java index b9c991de..fd8640c2 100644 --- a/src/main/java/io/luna/util/parser/impl/ObjectDefinitionFileParser.java +++ b/src/main/java/io/luna/util/parser/impl/ObjectDefinitionFileParser.java @@ -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.