-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d12d3d6
commit 2c0c584
Showing
22 changed files
with
203 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
Hyperverse - A minecraft world management plugin | ||
// | ||
// Hyperverse - A minecraft world management plugin | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,42 @@ | ||
import com.hierynomus.gradle.license.LicenseBasePlugin | ||
import com.hierynomus.gradle.license.tasks.LicenseCheck | ||
import net.kyori.indra.IndraExtension | ||
import net.kyori.indra.IndraPlugin | ||
import net.kyori.indra.IndraPublishingPlugin | ||
import net.kyori.indra.IndraCheckstylePlugin | ||
import net.ltgt.gradle.errorprone.ErrorPronePlugin | ||
import net.ltgt.gradle.errorprone.errorprone | ||
import nl.javadude.gradle.plugins.license.LicenseExtension | ||
import org.gradle.api.plugins.JavaPlugin.* | ||
import org.gradle.kotlin.dsl.support.serviceOf | ||
import java.nio.charset.StandardCharsets | ||
import com.diffplug.gradle.spotless.SpotlessTask | ||
|
||
plugins { | ||
val indraVersion = "3.1.3" | ||
id("net.kyori.indra") version indraVersion | ||
id("net.kyori.indra.checkstyle") version indraVersion apply false | ||
id("net.kyori.indra.publishing.sonatype") version indraVersion | ||
id("com.github.hierynomus.license") version "0.16.1" apply false | ||
id("com.github.johnrengelman.shadow") version "8.1.1" apply false | ||
id("net.ltgt.errorprone") version "3.1.0" apply false | ||
id("com.github.ben-manes.versions") version "0.50.0" | ||
idea | ||
alias(libs.plugins.cloud.buildLogic.rootProject.publishing) | ||
alias(libs.plugins.cloud.buildLogic.rootProject.spotless) | ||
} | ||
|
||
group = "se.hyperver.hyperverse" | ||
version = "0.11.0-SNAPSHOT" | ||
description = "Minecraft world management plugin" | ||
|
||
apply<IdeaPlugin>() | ||
|
||
val targetJavaVersion = 17 | ||
spotlessPredeclare { | ||
kotlin { ktlint(libs.versions.ktlint.get()) } | ||
kotlinGradle { ktlint(libs.versions.ktlint.get()) } | ||
} | ||
|
||
subprojects { | ||
apply<IndraPlugin>() | ||
apply<IndraPublishingPlugin>() | ||
apply<ErrorPronePlugin>() | ||
apply<LicenseBasePlugin>() | ||
apply<IdeaPlugin>() | ||
|
||
if (this.name.startsWith("hyperverse-nms").not()) { | ||
apply<IndraCheckstylePlugin>() | ||
} | ||
|
||
extensions.configure(LicenseExtension::class) { | ||
header = rootProject.file("HEADER") | ||
mapping("java", "DOUBLESLASH_STYLE") | ||
mapping("kt", "DOUBLESLASH_STYLE") | ||
includes(listOf("**/*.java", "**/*.kt")) | ||
} | ||
|
||
extensions.configure(IndraExtension::class) { | ||
github("Incendo", "Hyperverse") { | ||
ci(true) | ||
} | ||
gpl3OnlyLicense() | ||
|
||
javaVersions { | ||
target(targetJavaVersion) | ||
testWith(targetJavaVersion) | ||
} | ||
checkstyle("8.39") | ||
|
||
configurePublications { | ||
pom { | ||
developers { | ||
developer { | ||
id.set("Sauilitired") | ||
name.set("Alexander Söderberg") | ||
url.set("https://alexander-soderberg.com") | ||
email.set("[email protected]") | ||
} | ||
if ("nms" in name) { | ||
tasks { | ||
whenTaskAdded { | ||
if ("checkstyle" in name) { | ||
enabled = false | ||
} | ||
} | ||
} | ||
} | ||
|
||
/* Disable checkstyle on tests */ | ||
project.gradle.startParameter.excludedTaskNames.add("checkstyleTest") | ||
|
||
tasks { | ||
withType(JavaCompile::class) { | ||
javaCompiler.set(serviceOf<JavaToolchainService>().compilerFor(java.toolchain)) | ||
options.release.set(targetJavaVersion) | ||
|
||
options.errorprone { | ||
/* These are just annoying */ | ||
disable( | ||
"JdkObsolete", | ||
"FutureReturnValueIgnored", | ||
"ImmutableEnumChecker", | ||
"StringSplitter", | ||
"EqualsGetClass", | ||
"CatchAndPrintStackTrace", | ||
"TypeParameterUnusedInFormals", | ||
"EmptyCatch" | ||
) | ||
} | ||
// TODO: Re-enable | ||
// options.compilerArgs.addAll(listOf("-Xlint:-processing", "-Werror")) | ||
} | ||
|
||
withType(Javadoc::class) { | ||
javadocTool.set(serviceOf<JavaToolchainService>().javadocToolFor(java.toolchain)) | ||
options.encoding = StandardCharsets.UTF_8.name() | ||
} | ||
|
||
named("check") { | ||
dependsOn(withType(LicenseCheck::class)) | ||
repositories { | ||
maven("https://repo.aikar.co/content/groups/aikar/") | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
sonatype.ossSnapshots() | ||
|
||
maven("https://oss.sonatype.org/content/repositories/releases") { | ||
mavenContent { | ||
releasesOnly() | ||
} | ||
afterEvaluate { | ||
tasks.withType<JavaCompile>().configureEach { | ||
options.compilerArgs.remove("-Werror") | ||
} | ||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") | ||
maven("https://repo.aikar.co/content/groups/aikar/") | ||
maven("https://repo.papermc.io/repository/maven-public/") | ||
maven("https://repo.codemc.org/repository/maven-public/") | ||
maven("https://repo.spongepowered.org/maven") | ||
maven("https://repo.onarandombox.com/content/repositories/multiverse/") | ||
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") | ||
maven("https://ci.mg-dev.eu/plugin/repository/everything/") | ||
maven("https://repo.essentialsx.net/releases/") | ||
|
||
tasks.findByName("spotlessConfigsCheck")?.enabled = false | ||
} | ||
} | ||
|
||
dependencies { | ||
COMPILE_ONLY_API_CONFIGURATION_NAME("org.checkerframework", "checker-qual", "3.9.1") | ||
TEST_IMPLEMENTATION_CONFIGURATION_NAME("org.junit.jupiter", "junit-jupiter-engine", "5.8.2") | ||
"errorprone"("com.google.errorprone", "error_prone_core", "2.10.0") | ||
COMPILE_ONLY_API_CONFIGURATION_NAME("com.google.errorprone", "error_prone_annotations", "2.5.1") | ||
COMPILE_ONLY_API_CONFIGURATION_NAME("org.jetbrains", "annotations", "23.0.0") | ||
tasks { | ||
spotlessCheck { | ||
dependsOn(gradle.includedBuild("build-logic").task(":spotlessCheck") ) | ||
} | ||
spotlessApply { | ||
dependsOn(gradle.includedBuild("build-logic").task(":spotlessApply")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
alias(libs.plugins.cloud.buildLogic.spotless) | ||
} | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
implementation(libs.cloud.build.logic) | ||
implementation(libs.gradleKotlinJvm) | ||
|
||
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) | ||
} | ||
|
||
cloudSpotless { | ||
licenseHeaderFile.convention(null as RegularFile?) | ||
ktlintVersion = libs.versions.ktlint | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
rootProject.name = "build-logic" | ||
|
||
pluginManagement { | ||
repositories { | ||
gradlePluginPortal() | ||
mavenLocal() | ||
} | ||
} | ||
|
||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../libs.versions.toml")) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import org.gradle.accessors.dm.LibrariesForLibs | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.the | ||
|
||
val Project.libs: LibrariesForLibs | ||
get() = the() |
13 changes: 13 additions & 0 deletions
13
gradle/build-logic/src/main/kotlin/hyperverse.base-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
plugins { | ||
id("org.incendo.cloud-build-logic") | ||
id("org.incendo.cloud-build-logic.spotless") | ||
} | ||
|
||
indra { | ||
javaVersions { | ||
minimumToolchain(17) | ||
target(17) | ||
testWith().set(setOf(17)) | ||
} | ||
checkstyle().set(libs.versions.checkstyle) | ||
} |
20 changes: 20 additions & 0 deletions
20
gradle/build-logic/src/main/kotlin/hyperverse.publishing-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import org.incendo.cloudbuildlogic.city | ||
|
||
plugins { | ||
id("org.incendo.cloud-build-logic.publishing") | ||
} | ||
|
||
indra { | ||
github("Incendo", "hyperverse") { | ||
ci(true) | ||
} | ||
mitLicense() | ||
|
||
configurePublications { | ||
pom { | ||
developers { | ||
city() | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
hyperverse-core/src/main/java/se/hyperver/hyperverse/database/SQLiteDatabase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.