Skip to content

Commit

Permalink
divided into two modules
Browse files Browse the repository at this point in the history
  • Loading branch information
p0loskun committed Jul 27, 2024
1 parent d841ede commit f36cba9
Show file tree
Hide file tree
Showing 415 changed files with 252 additions and 166 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
121 changes: 63 additions & 58 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,77 +1,82 @@
val utf8: String = Charsets.UTF_8.name()
val javaVersion: Int = property("java.version").toString().toInt()
val javaCompilerArgs: String = property("java.compilerArgs").toString()
val projectGroup: String = property("project.group").toString()
val projectVersion: Any = property("project.version")!!
val projectDescription: String = property("project.description").toString()

plugins {
java
alias(libs.plugins.paper.userdev)
alias(libs.plugins.shadow)
alias(libs.plugins.run.paper)
alias(libs.plugins.shadow) apply false
alias(libs.plugins.paper.userdev) apply false
alias(libs.plugins.paper.run) apply false
}

group = "com.minersstudios"
version = "1.0.0"
description = "A Minecraft plugin for WhoMine"
subprojects {
apply(plugin = "java")

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
group = project.group
version = projectVersion
description = projectDescription

repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://maven.playpro.com")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(javaVersion))
}

dependencies {
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
compileOnly(libs.jetbrains.annotations)
compileOnly(libs.jackson.annotations)
compileOnly(libs.jda)
compileOnly(libs.authme)
compileOnly(libs.coreprotect)
}
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.codemc.org/repository/maven-public/")
maven("https://maven.playpro.com")
}

sourceSets {
test {
java {
srcDirs("src/main/test/java")
}
dependencies {
compileOnly(rootProject.libs.fastutil)
compileOnly(rootProject.libs.google.guava)
compileOnly(rootProject.libs.google.gson)
compileOnly(rootProject.libs.google.jsr305)
compileOnly(rootProject.libs.jetbrains.annotations)
compileOnly(rootProject.libs.jackson.annotations)
compileOnly(rootProject.libs.jda)
}
}

tasks {
val utf8 = Charsets.UTF_8.name()
tasks {
compileJava {
options.encoding = utf8

assemble {
dependsOn(reobfJar)
}
options.release.set(javaVersion)
options.compilerArgs.add(javaCompilerArgs)
}

compileJava {
options.encoding = utf8
jar {
archiveBaseName.set("${rootProject.name}-${project.name}")
destinationDirectory.set(file("$rootDir/build"))
}

options.release.set(17)
options.compilerArgs.add("-Xlint:deprecation")
}
javadoc {
enabled = false
options.encoding = utf8
setDestinationDir(file("$rootDir/builds/javadoc"))
}

javadoc {
options.encoding = utf8
processResources {
filteringCharset = utf8
}
}
}

processResources {
filteringCharset = utf8
val props = mapOf(
"name" to rootProject.name,
"version" to rootProject.version,
"description" to "A Minecraft plugin for WhoMine",
"author" to "MinersStudios",
"contributors" to "p0loskun, PackmanDude",
"website" to "https://whomine.net",
"apiVersion" to "'1.20'",
"coreProtectVersion" to libs.versions.coreprotect.get(),
"authMeVersion" to libs.versions.authme.get(),
)

inputs.properties(props)
filesMatching("paper-plugin.yml") {
expand(props)
tasks {
compileJava { enabled = false }
processResources { enabled = false }
classes { enabled = false }
jar {
doLast {
file("build").deleteRecursively()
}
}
assemble { enabled = false }
testClasses { enabled = false }
test { enabled = false }
check { enabled = false }
build { enabled = false }
}
Empty file added common/build.gradle.kts
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.minersstudios.whomine.annotation;
package com.minersstudios.whomine.api.annotation;

import com.minersstudios.whomine.throwable.InvalidRegexException;
import com.minersstudios.whomine.api.throwable.InvalidRegexException;
import org.intellij.lang.annotations.RegExp;
import org.intellij.lang.annotations.Subst;
import org.jetbrains.annotations.Contract;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.minersstudios.whomine.annotation;
package com.minersstudios.whomine.api.annotation;

import com.minersstudios.whomine.throwable.InvalidRegexException;
import com.minersstudios.whomine.api.throwable.InvalidRegexException;
import org.intellij.lang.annotations.RegExp;
import org.intellij.lang.annotations.Subst;
import org.jetbrains.annotations.Contract;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.minersstudios.whomine.annotation;
package com.minersstudios.whomine.api.annotation;

import com.minersstudios.whomine.throwable.InvalidRegexException;
import org.bukkit.NamespacedKey;
import com.minersstudios.whomine.api.throwable.InvalidRegexException;
import org.intellij.lang.annotations.RegExp;
import org.intellij.lang.annotations.Subst;
import org.jetbrains.annotations.Contract;
Expand All @@ -15,7 +14,7 @@
import static java.lang.annotation.ElementType.*;

/**
* Annotation used to mark the {@link NamespacedKey namespaced-key}.
* Annotation used to mark the {@code namespaced-key}.
* <br>
* The namespaced-key must match the {@link #REGEX regex} pattern.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.minersstudios.whomine.annotation;
package com.minersstudios.whomine.api.annotation;

import com.minersstudios.whomine.throwable.InvalidRegexException;
import com.minersstudios.whomine.api.throwable.InvalidRegexException;
import org.intellij.lang.annotations.RegExp;
import org.intellij.lang.annotations.Subst;
import org.jetbrains.annotations.Contract;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.minersstudios.whomine.status;
package com.minersstudios.whomine.api.status;

import com.minersstudios.whomine.annotation.StatusKey;
import com.minersstudios.whomine.api.annotation.StatusKey;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.minersstudios.whomine.status;
package com.minersstudios.whomine.api.status;

import com.minersstudios.whomine.annotation.StatusKey;
import com.minersstudios.whomine.api.annotation.StatusKey;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.minersstudios.whomine.status;
package com.minersstudios.whomine.api.status;

import com.minersstudios.whomine.annotation.StatusKey;
import com.minersstudios.whomine.throwable.InvalidRegexException;
import com.minersstudios.whomine.api.annotation.StatusKey;
import com.minersstudios.whomine.api.throwable.InvalidRegexException;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.function.Consumer;
import java.util.function.Function;

import static com.minersstudios.whomine.annotation.StatusKey.Validator.validate;
import static com.minersstudios.whomine.api.annotation.StatusKey.Validator.validate;

/**
* Represents a status.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minersstudios.whomine.status;
package com.minersstudios.whomine.api.status;

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import org.jetbrains.annotations.Contract;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minersstudios.whomine.status;
package com.minersstudios.whomine.api.status;

import com.google.common.base.Joiner;
import com.google.common.collect.Sets;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.minersstudios.whomine.status;
package com.minersstudios.whomine.api.status;

import com.minersstudios.whomine.annotation.StatusKey;
import com.minersstudios.whomine.api.annotation.StatusKey;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* This package contains classes and interfaces related to statuses and their
* management. They are thread-safe and can be safely used to manage plugin
* statuses in a multithreading environment.
*
* @see com.minersstudios.whomine.api.status.Status
* @see com.minersstudios.whomine.api.status.StatusWatcher
* @see com.minersstudios.whomine.api.status.StatusHandler
*/
package com.minersstudios.whomine.api.status;
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package com.minersstudios.whomine.throwable;
package com.minersstudios.whomine.api.throwable;

import com.minersstudios.whomine.Config;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* Checked configuration exception.
* <br>
* Thrown when a configuration error occurs while working with the
* {@link Config} class.
* {@code Config} class.
* <br>
* This exception is used to indicate problems encountered during configuration
* operations.
*
* @see Config
*/
public class ConfigurationException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.minersstudios.whomine.throwable;
package com.minersstudios.whomine.api.throwable;

import org.jetbrains.annotations.Nullable;

Expand Down
12 changes: 12 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
java.version=17
java.compilerArgs=-Xlint:deprecation

paper.version=1.20.4-R0.1-SNAPSHOT

project.group=com.minersstudios
project.name=WhoMine
project.version=1.0.0
project.description=A Minecraft plugin for WhoMine
project.author=MinersStudios
project.contributors=p0loskun, PackmanDude
project.website=https://whomine.net
32 changes: 20 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
[versions]
# libraries
fastutil = "8.5.13"
google-guava = "33.2.1-jre"
google-gson = "2.11.0"
google-jsr305 = "3.0.2"
jetbrains-annotations = "24.0.1"
jackson-annotations = "2.16.0"
jda = "5.0.0-beta.23"
authme = "5.6.0-SNAPSHOT"
coreprotect = "22.2"
jackson-annotations = "2.16.0"
jda = "5.0.0-beta.23"
authme = "5.6.0-SNAPSHOT"
coreprotect = "22.2"

# plugins
paper-userdev = "1.5.11"
shadow = "8.1.1"
run-paper = "2.2.3"
shadow = "8.1.1"
paper-run = "2.2.3"

[libraries]
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
google-guava = { group = "com.google.guava", name = "guava", version.ref = "google-guava" }
google-gson = { group = "com.google.code.gson", name = "gson", version.ref = "google-gson" }
google-jsr305 = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "google-jsr305" }
jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrains-annotations" }
jackson-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "jackson-annotations" }
jda = { group = "net.dv8tion", name = "JDA", version.ref = "jda" }
authme = { group = "fr.xephi", name = "authme", version.ref = "authme" }
coreprotect = { group = "net.coreprotect", name = "coreprotect", version.ref = "coreprotect" }
jackson-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "jackson-annotations" }
jda = { group = "net.dv8tion", name = "JDA", version.ref = "jda" }
authme = { group = "fr.xephi", name = "authme", version.ref = "authme" }
coreprotect = { group = "net.coreprotect", name = "coreprotect", version.ref = "coreprotect" }

[plugins]
paper-userdev = { id = "io.papermc.paperweight.userdev", version.ref = "paper-userdev" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
run-paper = { id = "xyz.jpenilla.run-paper", version.ref = "run-paper" }
paper-run = { id = "xyz.jpenilla.run-paper", version.ref = "paper-run" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
Loading

0 comments on commit f36cba9

Please sign in to comment.