build: update build-time dependencies, address new warnings (#413)
* build: update build-time dependencies, address new warnings * build: switch to central repo declaration, remove redundant repositories * build: use spotless predeclaration, more task avoidance on kotlin modules
This commit is contained in:
parent
86b76b91c7
commit
59c5a8310c
33 changed files with 204 additions and 135 deletions
12
.palantir/revapi.yml
Normal file
12
.palantir/revapi.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
acceptedBreaks:
|
||||||
|
"1.7.1":
|
||||||
|
cloud.commandframework:cloud-core:
|
||||||
|
- code: "java.generics.formalTypeParameterRemoved"
|
||||||
|
old: "method <T> int cloud.commandframework.arguments.flags.FlagContext::count(java.lang.String)"
|
||||||
|
new: "method int cloud.commandframework.arguments.flags.FlagContext::count(java.lang.String)"
|
||||||
|
justification: "no binary break"
|
||||||
|
cloud.commandframework:cloud-services:
|
||||||
|
- code: "java.class.nowFinal"
|
||||||
|
old: "class cloud.commandframework.services.types.ConsumerService.PipeBurst"
|
||||||
|
new: "class cloud.commandframework.services.types.ConsumerService.PipeBurst"
|
||||||
|
justification: "no practical effect, the constructor was private already"
|
||||||
|
|
@ -24,7 +24,9 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
kotlin {
|
kotlinGradle {
|
||||||
ktlint()
|
target("*.gradle.kts", "src/*/kotlin/**.gradle.kts", "src/*/kotlin/**.kt")
|
||||||
|
ktlint(libs.versions.ktlint.get())
|
||||||
|
.editorConfigOverride(mapOf("ktlint_disabled_rules" to "filename"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import ca.stellardrift.build.configurate.ConfigFormats
|
||||||
import ca.stellardrift.build.configurate.catalog.PolyglotVersionCatalogExtension
|
import ca.stellardrift.build.configurate.catalog.PolyglotVersionCatalogExtension
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("ca.stellardrift.polyglot-version-catalogs") version "5.0.1"
|
id("ca.stellardrift.polyglot-version-catalogs") version "6.0.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
extensions.configure<PolyglotVersionCatalogExtension> {
|
extensions.configure<PolyglotVersionCatalogExtension> {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import net.kyori.indra.repository.sonatypeSnapshots
|
import com.diffplug.gradle.spotless.FormatExtension
|
||||||
import net.ltgt.gradle.errorprone.errorprone
|
import net.ltgt.gradle.errorprone.errorprone
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
|
@ -32,7 +32,7 @@ tasks {
|
||||||
"StringSplitter",
|
"StringSplitter",
|
||||||
"EqualsGetClass",
|
"EqualsGetClass",
|
||||||
"CatchAndPrintStackTrace",
|
"CatchAndPrintStackTrace",
|
||||||
"InlineMeSuggester",
|
"InlineMeSuggester"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
options.compilerArgs.addAll(listOf("-Xlint:-processing", "-Werror"))
|
options.compilerArgs.addAll(listOf("-Xlint:-processing", "-Werror"))
|
||||||
|
|
@ -40,74 +40,30 @@ tasks {
|
||||||
}
|
}
|
||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
java {
|
fun FormatExtension.applyCommon(spaces: Int = 4) {
|
||||||
licenseHeaderFile(rootProject.file("HEADER"))
|
indentWithSpaces(spaces)
|
||||||
importOrderFile(rootProject.file(".spotless/cloud.importorder"))
|
|
||||||
indentWithSpaces(4)
|
|
||||||
trimTrailingWhitespace()
|
trimTrailingWhitespace()
|
||||||
endWithNewline()
|
endWithNewline()
|
||||||
}
|
}
|
||||||
|
java {
|
||||||
|
licenseHeaderFile(rootProject.file("HEADER"))
|
||||||
|
importOrderFile(rootProject.file(".spotless/cloud.importorder"))
|
||||||
|
applyCommon()
|
||||||
|
}
|
||||||
kotlin {
|
kotlin {
|
||||||
licenseHeaderFile(rootProject.file("HEADER"))
|
licenseHeaderFile(rootProject.file("HEADER"))
|
||||||
indentWithSpaces(4)
|
applyCommon()
|
||||||
trimTrailingWhitespace()
|
}
|
||||||
endWithNewline()
|
kotlinGradle {
|
||||||
|
ktlint(libs.versions.ktlint.get())
|
||||||
}
|
}
|
||||||
format("configs") {
|
format("configs") {
|
||||||
target("**/*.yml", "**/*.yaml", "**/*.json")
|
target("**/*.yml", "**/*.yaml", "**/*.json")
|
||||||
targetExclude("run/**")
|
targetExclude("run/**")
|
||||||
indentWithSpaces(2)
|
applyCommon(2)
|
||||||
trimTrailingWhitespace()
|
|
||||||
endWithNewline()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
sonatypeSnapshots()
|
|
||||||
/* Velocity, used for cloud-velocity */
|
|
||||||
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-release/") {
|
|
||||||
mavenContent {
|
|
||||||
releasesOnly()
|
|
||||||
includeGroup("com.velocitypowered")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/") {
|
|
||||||
mavenContent {
|
|
||||||
snapshotsOnly()
|
|
||||||
includeGroup("com.velocitypowered")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* The Minecraft repository, used for cloud-brigadier */
|
|
||||||
maven("https://libraries.minecraft.net/") {
|
|
||||||
mavenContent { releasesOnly() }
|
|
||||||
}
|
|
||||||
/* The Spigot repository, used for cloud-bukkit */
|
|
||||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") {
|
|
||||||
mavenContent { snapshotsOnly() }
|
|
||||||
}
|
|
||||||
/* The paper repository, used for cloud-paper */
|
|
||||||
maven("https://repo.papermc.io/repository/maven-public/")
|
|
||||||
/* Used for cloud-cloudburst */
|
|
||||||
maven("https://repo.opencollab.dev/maven-snapshots/") {
|
|
||||||
mavenContent { includeGroup("org.cloudburstmc") }
|
|
||||||
}
|
|
||||||
/* The current Fabric repository */
|
|
||||||
maven("https://maven.fabricmc.net/") {
|
|
||||||
mavenContent { includeGroup("net.fabricmc") }
|
|
||||||
}
|
|
||||||
/* The current Sponge repository */
|
|
||||||
maven("https://repo.spongepowered.org/repository/maven-public/") {
|
|
||||||
mavenContent { includeGroup("org.spongepowered") }
|
|
||||||
}
|
|
||||||
/* JitPack, used for random dependencies */
|
|
||||||
maven("https://jitpack.io") {
|
|
||||||
content { includeGroupByRegex("com\\.github\\..*") }
|
|
||||||
}
|
|
||||||
/* JDA's maven repository for cloud-jda */
|
|
||||||
maven("https://m2.dv8tion.net/releases")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnlyApi(libs.checkerQual)
|
compileOnlyApi(libs.checkerQual)
|
||||||
compileOnlyApi(libs.apiguardian)
|
compileOnlyApi(libs.apiguardian)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import org.jetbrains.dokka.gradle.DokkaTask
|
import org.jetbrains.dokka.gradle.DokkaTask
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("cloud.base-conventions")
|
id("cloud.base-conventions")
|
||||||
|
|
@ -8,10 +7,18 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
|
explicitApi()
|
||||||
jvmToolchain {
|
jvmToolchain {
|
||||||
(this as JavaToolchainSpec).apply {
|
|
||||||
languageVersion.set(JavaLanguageVersion.of(8))
|
languageVersion.set(JavaLanguageVersion.of(8))
|
||||||
}
|
}
|
||||||
|
coreLibrariesVersion = "1.5.31"
|
||||||
|
target {
|
||||||
|
compilations.configureEach {
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "1.8"
|
||||||
|
languageVersion = "1.5"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -20,7 +27,7 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
withType<DokkaTask> {
|
withType(DokkaTask::class).configureEach {
|
||||||
dokkaSourceSets.named("main") {
|
dokkaSourceSets.named("main") {
|
||||||
includes.from(layout.projectDirectory.file("src/main/descriptions.md"))
|
includes.from(layout.projectDirectory.file("src/main/descriptions.md"))
|
||||||
/*externalDocumentationLink { // todo: fix KDoc linking to JavaDoc
|
/*externalDocumentationLink { // todo: fix KDoc linking to JavaDoc
|
||||||
|
|
@ -32,19 +39,11 @@ tasks {
|
||||||
javadocJar {
|
javadocJar {
|
||||||
from(dokkaHtml)
|
from(dokkaHtml)
|
||||||
}
|
}
|
||||||
withType<KotlinCompile> {
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spotless {
|
spotless {
|
||||||
kotlin {
|
kotlin {
|
||||||
ktlint()
|
ktlint(libs.versions.ktlint.get())
|
||||||
|
.editorConfigOverride(mapOf("ktlint_disabled_rules" to "filename"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
|
||||||
explicitApi()
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id("net.kyori.indra.publishing.sonatype")
|
id("net.kyori.indra.publishing.sonatype")
|
||||||
|
id("com.diffplug.spotless")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spotless.predeclareDeps()
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,17 @@ subprojects {
|
||||||
apply(plugin = "cloud.publishing-conventions")
|
apply(plugin = "cloud.publishing-conventions")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spotlessPredeclare {
|
||||||
|
kotlin { ktlint(libs.versions.ktlint.get()) }
|
||||||
|
kotlinGradle { ktlint(libs.versions.ktlint.get()) }
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
spotlessCheck {
|
||||||
|
dependsOn(gradle.includedBuild("build-logic").task(":spotlessCheck"))
|
||||||
|
}
|
||||||
|
spotlessApply {
|
||||||
|
dependsOn(gradle.includedBuild("build-logic").task(":spotlessApply"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import net.ltgt.gradle.errorprone.errorprone
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("cloud.base-conventions")
|
id("cloud.base-conventions")
|
||||||
id("com.palantir.revapi")
|
id("com.palantir.revapi")
|
||||||
|
|
@ -8,3 +10,9 @@ dependencies {
|
||||||
|
|
||||||
testImplementation(libs.compileTesting)
|
testImplementation(libs.compileTesting)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile::class).configureEach {
|
||||||
|
options.errorprone {
|
||||||
|
disable("UnusedMethod") // false positives from command annotations
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -478,7 +478,7 @@ public class CommandArgument<C, T> implements Comparable<CommandArgument<?, ?>>,
|
||||||
public final int compareTo(final @NonNull CommandArgument<?, ?> o) {
|
public final int compareTo(final @NonNull CommandArgument<?, ?> o) {
|
||||||
if (this instanceof StaticArgument) {
|
if (this instanceof StaticArgument) {
|
||||||
if (o instanceof StaticArgument) {
|
if (o instanceof StaticArgument) {
|
||||||
return (this.getName().compareTo(o.getName()));
|
return this.getName().compareTo(o.getName());
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,7 +258,7 @@ public final class FlagArgument<C> extends CommandArgument<C, Object> {
|
||||||
return strings;
|
return strings;
|
||||||
} else {
|
} else {
|
||||||
CommandFlag<?> currentFlag = null;
|
CommandFlag<?> currentFlag = null;
|
||||||
if (lastArg.startsWith("--")) {
|
if (lastArg.startsWith("--")) { // --long
|
||||||
final String flagName = lastArg.substring(2);
|
final String flagName = lastArg.substring(2);
|
||||||
for (final CommandFlag<?> flag : this.flags) {
|
for (final CommandFlag<?> flag : this.flags) {
|
||||||
if (flagName.equalsIgnoreCase(flag.getName())) {
|
if (flagName.equalsIgnoreCase(flag.getName())) {
|
||||||
|
|
@ -266,7 +266,7 @@ public final class FlagArgument<C> extends CommandArgument<C, Object> {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (lastArg.startsWith("-")) {
|
} else { // -x
|
||||||
final String flagName = lastArg.substring(1);
|
final String flagName = lastArg.substring(1);
|
||||||
for (final CommandFlag<?> flag : this.flags) {
|
for (final CommandFlag<?> flag : this.flags) {
|
||||||
for (final String alias : flag.getAliases()) {
|
for (final String alias : flag.getAliases()) {
|
||||||
|
|
|
||||||
|
|
@ -107,12 +107,11 @@ public final class FlagContext {
|
||||||
* Returns the number of values associated with the given {@code flag}.
|
* Returns the number of values associated with the given {@code flag}.
|
||||||
*
|
*
|
||||||
* @param flag the flag
|
* @param flag the flag
|
||||||
* @param <T> the flag value type
|
|
||||||
* @return the number of values associated with the flag
|
* @return the number of values associated with the flag
|
||||||
* @since 1.7.0
|
* @since 1.7.0
|
||||||
*/
|
*/
|
||||||
@API(status = API.Status.STABLE, since = "1.7.0")
|
@API(status = API.Status.STABLE, since = "1.7.0")
|
||||||
public <T> int count(final @NonNull String flag) {
|
public int count(final @NonNull String flag) {
|
||||||
return this.getAll(flag).size();
|
return this.getAll(flag).size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public final class StandardParserRegistry<C> implements ParserRegistry<C> {
|
||||||
*/
|
*/
|
||||||
public StandardParserRegistry() {
|
public StandardParserRegistry() {
|
||||||
/* Register standard mappers */
|
/* Register standard mappers */
|
||||||
this.<Range, Number>registerAnnotationMapper(Range.class, new RangeMapper<>());
|
this.<Range, Number>registerAnnotationMapper(Range.class, new RangeMapper());
|
||||||
this.<Greedy, String>registerAnnotationMapper(Greedy.class, new GreedyMapper());
|
this.<Greedy, String>registerAnnotationMapper(Greedy.class, new GreedyMapper());
|
||||||
this.<Quoted, String>registerAnnotationMapper(
|
this.<Quoted, String>registerAnnotationMapper(
|
||||||
Quoted.class,
|
Quoted.class,
|
||||||
|
|
@ -291,7 +291,7 @@ public final class StandardParserRegistry<C> implements ParserRegistry<C> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static final class RangeMapper<T> implements BiFunction<@NonNull Range, @NonNull TypeToken<?>,
|
private static final class RangeMapper implements BiFunction<@NonNull Range, @NonNull TypeToken<?>,
|
||||||
@NonNull ParserParameters> {
|
@NonNull ParserParameters> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ public final class TestUtils {
|
||||||
|
|
||||||
private abstract static class TestCommandSenderCommandManager extends CommandManager<TestCommandSender> {
|
private abstract static class TestCommandSenderCommandManager extends CommandManager<TestCommandSender> {
|
||||||
|
|
||||||
|
@SuppressWarnings("unused") // mocked via mockito
|
||||||
protected TestCommandSenderCommandManager(
|
protected TestCommandSenderCommandManager(
|
||||||
final @NonNull Function<@NonNull CommandTree<TestCommandSender>, @NonNull CommandExecutionCoordinator<TestCommandSender>> commandExecutionCoordinator,
|
final @NonNull Function<@NonNull CommandTree<TestCommandSender>, @NonNull CommandExecutionCoordinator<TestCommandSender>> commandExecutionCoordinator,
|
||||||
final @NonNull CommandRegistrationHandler commandRegistrationHandler
|
final @NonNull CommandRegistrationHandler commandRegistrationHandler
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ public fun interface SuspendingExecutionHandler<C : Any> {
|
||||||
*/
|
*/
|
||||||
public fun asCommandExecutionHandler(
|
public fun asCommandExecutionHandler(
|
||||||
scope: CoroutineScope = GlobalScope,
|
scope: CoroutineScope = GlobalScope,
|
||||||
context: CoroutineContext = EmptyCoroutineContext,
|
context: CoroutineContext = EmptyCoroutineContext
|
||||||
): CommandExecutionHandler<C> = createCommandExecutionHandler(scope, context, this)
|
): CommandExecutionHandler<C> = createCommandExecutionHandler(scope, context, this)
|
||||||
|
|
||||||
public companion object {
|
public companion object {
|
||||||
|
|
@ -76,7 +76,7 @@ public fun interface SuspendingExecutionHandler<C : Any> {
|
||||||
public fun <C : Any> createCommandExecutionHandler(
|
public fun <C : Any> createCommandExecutionHandler(
|
||||||
scope: CoroutineScope = GlobalScope,
|
scope: CoroutineScope = GlobalScope,
|
||||||
context: CoroutineContext = EmptyCoroutineContext,
|
context: CoroutineContext = EmptyCoroutineContext,
|
||||||
handler: SuspendingExecutionHandler<C>,
|
handler: SuspendingExecutionHandler<C>
|
||||||
): CommandExecutionHandler<C> = CommandExecutionHandler.FutureCommandExecutionHandler { ctx ->
|
): CommandExecutionHandler<C> = CommandExecutionHandler.FutureCommandExecutionHandler { ctx ->
|
||||||
scope.future(context) {
|
scope.future(context) {
|
||||||
handler(ctx)
|
handler(ctx)
|
||||||
|
|
|
||||||
|
|
@ -43,5 +43,5 @@ import kotlin.coroutines.EmptyCoroutineContext
|
||||||
public fun <C : Any> Command.Builder<C>.suspendingHandler(
|
public fun <C : Any> Command.Builder<C>.suspendingHandler(
|
||||||
scope: CoroutineScope = GlobalScope,
|
scope: CoroutineScope = GlobalScope,
|
||||||
context: CoroutineContext = EmptyCoroutineContext,
|
context: CoroutineContext = EmptyCoroutineContext,
|
||||||
handler: SuspendingExecutionHandler<C>,
|
handler: SuspendingExecutionHandler<C>
|
||||||
): Command.Builder<C> = handler(SuspendingExecutionHandler.createCommandExecutionHandler(scope, context, handler))
|
): Command.Builder<C> = handler(SuspendingExecutionHandler.createCommandExecutionHandler(scope, context, handler))
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ import kotlin.coroutines.EmptyCoroutineContext
|
||||||
public fun <C : Any> MutableCommandBuilder<C>.suspendingHandler(
|
public fun <C : Any> MutableCommandBuilder<C>.suspendingHandler(
|
||||||
scope: CoroutineScope = GlobalScope,
|
scope: CoroutineScope = GlobalScope,
|
||||||
context: CoroutineContext = EmptyCoroutineContext,
|
context: CoroutineContext = EmptyCoroutineContext,
|
||||||
handler: SuspendingExecutionHandler<C>,
|
handler: SuspendingExecutionHandler<C>
|
||||||
): MutableCommandBuilder<C> = mutate {
|
): MutableCommandBuilder<C> = mutate {
|
||||||
it.suspendingHandler(scope, context, handler)
|
it.suspendingHandler(scope, context, handler)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ import kotlin.reflect.KClass
|
||||||
*/
|
*/
|
||||||
public class MutableCommandBuilder<C : Any>(
|
public class MutableCommandBuilder<C : Any>(
|
||||||
commandBuilder: Command.Builder<C>,
|
commandBuilder: Command.Builder<C>,
|
||||||
private val commandManager: CommandManager<C>,
|
private val commandManager: CommandManager<C>
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* The command builder that is being mutated by this [MutableCommandBuilder] instance.
|
* The command builder that is being mutated by this [MutableCommandBuilder] instance.
|
||||||
|
|
@ -703,7 +703,7 @@ public class MutableCommandBuilder<C : Any>(
|
||||||
public fun flag(
|
public fun flag(
|
||||||
name: String,
|
name: String,
|
||||||
aliases: Array<String> = emptyArray(),
|
aliases: Array<String> = emptyArray(),
|
||||||
description: ArgumentDescription = ArgumentDescription.empty(),
|
description: ArgumentDescription = ArgumentDescription.empty()
|
||||||
): MutableCommandBuilder<C> = mutate {
|
): MutableCommandBuilder<C> = mutate {
|
||||||
it.flag(
|
it.flag(
|
||||||
this.commandManager
|
this.commandManager
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ class CommandBuildingDSLTest {
|
||||||
"is",
|
"is",
|
||||||
"is this",
|
"is this",
|
||||||
"is this going",
|
"is this going",
|
||||||
"is this going too_far",
|
"is this going too_far"
|
||||||
)
|
)
|
||||||
.sorted()
|
.sorted()
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ public final class CloudBrigadierManager<C, S> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
private <T, K extends ArgumentParser<C, ?>> @Nullable Pair<@NonNull ArgumentType<?>, @Nullable SuggestionProvider<S>> getArgument(
|
private <K extends ArgumentParser<C, ?>> @Nullable Pair<@NonNull ArgumentType<?>, @Nullable SuggestionProvider<S>> getArgument(
|
||||||
final @NonNull TypeToken<?> valueType,
|
final @NonNull TypeToken<?> valueType,
|
||||||
final @NonNull K argumentParser
|
final @NonNull K argumentParser
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ final class SelectorUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused") // errorprone false positive
|
||||||
private abstract static class SelectorParser<C, T> implements ArgumentParser<C, T>, SelectorMapper<T> {
|
private abstract static class SelectorParser<C, T> implements ArgumentParser<C, T>, SelectorMapper<T> {
|
||||||
|
|
||||||
protected static final Supplier<Object> NO_PLAYERS_EXCEPTION_TYPE =
|
protected static final Supplier<Object> NO_PLAYERS_EXCEPTION_TYPE =
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import net.fabricmc.loom.task.AbstractRunTask
|
||||||
import net.ltgt.gradle.errorprone.errorprone
|
import net.ltgt.gradle.errorprone.errorprone
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("quiet-fabric-loom") version "1.0-SNAPSHOT"
|
id("quiet-fabric-loom")
|
||||||
id("cloud.base-conventions")
|
id("cloud.base-conventions")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -35,7 +35,8 @@ tasks {
|
||||||
jvmArgumentProviders += CommandLineArgumentProvider {
|
jvmArgumentProviders += CommandLineArgumentProvider {
|
||||||
if (System.getProperty("idea.active")?.toBoolean() == true || // IntelliJ
|
if (System.getProperty("idea.active")?.toBoolean() == true || // IntelliJ
|
||||||
System.getenv("TERM") != null || // linux terminals
|
System.getenv("TERM") != null || // linux terminals
|
||||||
System.getenv("WT_SESSION") != null) { // Windows terminal
|
System.getenv("WT_SESSION") != null
|
||||||
|
) { // Windows terminal
|
||||||
listOf("-Dfabric.log.disableAnsi=false")
|
listOf("-Dfabric.log.disableAnsi=false")
|
||||||
} else {
|
} else {
|
||||||
listOf()
|
listOf()
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public interface ConsumerService<Context>
|
||||||
void accept(@NonNull Context context);
|
void accept(@NonNull Context context);
|
||||||
|
|
||||||
|
|
||||||
class PipeBurst extends RuntimeException {
|
final class PipeBurst extends RuntimeException {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1143137258194595985L;
|
private static final long serialVersionUID = -1143137258194595985L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,7 @@ public final class TaskRecipe {
|
||||||
* @param <I> Input type
|
* @param <I> Input type
|
||||||
* @param <O> Output type
|
* @param <O> Output type
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("UnusedTypeParameter") // already in public API
|
||||||
public final class TaskRecipeComponentOutputting<I, O> {
|
public final class TaskRecipeComponentOutputting<I, O> {
|
||||||
|
|
||||||
private final Object initialInput;
|
private final Object initialInput;
|
||||||
|
|
|
||||||
|
|
@ -34,16 +34,18 @@ tasks {
|
||||||
runServer {
|
runServer {
|
||||||
minecraftVersion("1.19.2")
|
minecraftVersion("1.19.2")
|
||||||
runDirectory(file("run/latest"))
|
runDirectory(file("run/latest"))
|
||||||
javaLauncher.set(project.javaToolchains.launcherFor {
|
javaLauncher.set(
|
||||||
|
project.javaToolchains.launcherFor {
|
||||||
languageVersion.set(JavaLanguageVersion.of(17))
|
languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
})
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up a run task for each supported version
|
// Set up a run task for each supported version
|
||||||
mapOf(
|
mapOf(
|
||||||
8 to setOf("1.8.8"),
|
8 to setOf("1.8.8"),
|
||||||
11 to setOf("1.9.4", "1.10.2", "1.11.2"),
|
11 to setOf("1.9.4", "1.10.2", "1.11.2"),
|
||||||
17 to setOf("1.12.2", "1.13.2", "1.14.4", "1.15.2", "1.16.5", "1.17.1", "1.18.2", "1.19.2"),
|
17 to setOf("1.12.2", "1.13.2", "1.14.4", "1.15.2", "1.16.5", "1.17.1", "1.18.2", "1.19.2")
|
||||||
).forEach { (javaVersion, minecraftVersions) ->
|
).forEach { (javaVersion, minecraftVersions) ->
|
||||||
for (version in minecraftVersions) {
|
for (version in minecraftVersions) {
|
||||||
createVersionedRun(version, javaVersion)
|
createVersionedRun(version, javaVersion)
|
||||||
|
|
@ -60,7 +62,9 @@ fun TaskContainerScope.createVersionedRun(
|
||||||
minecraftVersion(version)
|
minecraftVersion(version)
|
||||||
runDirectory(file("run/$version"))
|
runDirectory(file("run/$version"))
|
||||||
systemProperty("Paper.IgnoreJavaVersion", true)
|
systemProperty("Paper.IgnoreJavaVersion", true)
|
||||||
javaLauncher.set(project.javaToolchains.launcherFor {
|
javaLauncher.set(
|
||||||
|
project.javaToolchains.launcherFor {
|
||||||
languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
languageVersion.set(JavaLanguageVersion.of(javaVersion))
|
||||||
})
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,4 @@ org.gradle.parallel=true
|
||||||
org.gradle.jvmargs=-Xmx2G
|
org.gradle.jvmargs=-Xmx2G
|
||||||
|
|
||||||
kotlin.stdlib.default.dependency=false
|
kotlin.stdlib.default.dependency=false
|
||||||
|
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=true
|
||||||
|
|
|
||||||
|
|
@ -5,27 +5,28 @@ metadata:
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
com.github.johnrengelman.shadow: 7.1.2
|
com.github.johnrengelman.shadow: 7.1.2
|
||||||
com.github.ben-manes.versions: 0.42.0
|
com.github.ben-manes.versions: 0.44.0
|
||||||
com.diffplug.spotless: &spotless 6.6.1
|
com.diffplug.spotless: &spotless 6.12.0
|
||||||
xyz.jpenilla.run-paper: &run-task 2.0.0
|
xyz.jpenilla.run-paper: &run-task 2.0.0
|
||||||
xyz.jpenilla.run-velocity: *run-task
|
xyz.jpenilla.run-velocity: *run-task
|
||||||
xyz.jpenilla.run-waterfall: *run-task
|
xyz.jpenilla.run-waterfall: *run-task
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
checkstyle: 9.0
|
checkstyle: 10.5.0
|
||||||
checkerQual: 3.22.1
|
checkerQual: 3.28.0
|
||||||
errorprone: 2.9.0
|
errorprone: 2.16
|
||||||
geantyref: 1.3.13
|
geantyref: 1.3.13
|
||||||
jmh: 1.27
|
jmh: 1.36
|
||||||
apiguardian: 1.1.2
|
apiguardian: 1.1.2
|
||||||
|
|
||||||
# integration
|
# integration
|
||||||
guice: 4.2.3
|
guice: 4.2.3
|
||||||
|
|
||||||
# kotlin
|
# kotlin
|
||||||
kotlin: &kotlin 1.5.31
|
kotlin: 1.7.22
|
||||||
dokka: *kotlin
|
dokka: 1.7.20
|
||||||
coroutines: 1.5.2
|
coroutines: 1.5.2
|
||||||
|
ktlint: 0.47.1
|
||||||
|
|
||||||
# discord
|
# discord
|
||||||
javacord: 3.1.1
|
javacord: 3.1.1
|
||||||
|
|
@ -53,17 +54,17 @@ versions:
|
||||||
fabricPermissionsApi: 0.2-SNAPSHOT
|
fabricPermissionsApi: 0.2-SNAPSHOT
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
jupiterEngine : 5.8.2
|
jupiterEngine : 5.9.1
|
||||||
mockitoCore : 4.1.0
|
mockitoCore : 4.9.0
|
||||||
mockitoKotlin : 4.0.0
|
mockitoKotlin : 4.1.0
|
||||||
mockitoJupiter: 4.5.1
|
mockitoJupiter: 4.9.0
|
||||||
truth : 1.1.3
|
truth : 1.1.3
|
||||||
compileTesting: 0.19
|
compileTesting: "0.20"
|
||||||
|
|
||||||
# build-logic
|
# build-logic
|
||||||
indra: 2.1.1
|
indra: 3.0.1
|
||||||
gradleTestLogger: 3.1.0
|
gradleTestLogger: 3.2.0
|
||||||
gradleErrorprone: 2.0.2
|
gradleErrorprone: 3.0.1
|
||||||
spotless: *spotless
|
spotless: *spotless
|
||||||
revapi: 1.7.0
|
revapi: 1.7.0
|
||||||
|
|
||||||
|
|
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
|
|
@ -1,5 +1,6 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
||||||
12
gradlew
vendored
12
gradlew
vendored
|
|
@ -55,7 +55,7 @@
|
||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
|
@ -80,10 +80,10 @@ do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
@ -143,12 +143,16 @@ fi
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
1
gradlew.bat
vendored
1
gradlew.bat
vendored
|
|
@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,76 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
maven("https://maven.fabricmc.net/")
|
maven("https://maven.fabricmc.net/") {
|
||||||
maven("https://maven.quiltmc.org/repository/release/")
|
name = "fabric"
|
||||||
maven("https://repo.jpenilla.xyz/snapshots/")
|
}
|
||||||
|
maven("https://maven.quiltmc.org/repository/release/") {
|
||||||
|
name = "quiltReleases"
|
||||||
|
mavenContent { releasesOnly() }
|
||||||
|
}
|
||||||
|
maven("https://repo.jpenilla.xyz/snapshots/") {
|
||||||
|
name = "jmpSnapshots"
|
||||||
|
mavenContent { snapshotsOnly() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
includeBuild("build-logic")
|
includeBuild("build-logic")
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("ca.stellardrift.polyglot-version-catalogs") version "5.0.1"
|
id("ca.stellardrift.polyglot-version-catalogs") version "6.0.1"
|
||||||
|
id("quiet-fabric-loom") version "1.0-SNAPSHOT"
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven("https://oss.sonatype.org/content/repositories/snapshots/") {
|
||||||
|
name = "sonatypeOssSnapshots"
|
||||||
|
mavenContent { snapshotsOnly() }
|
||||||
|
}
|
||||||
|
/* The Minecraft repository, used for cloud-brigadier */
|
||||||
|
maven("https://libraries.minecraft.net/") {
|
||||||
|
name = "minecraftLibraries"
|
||||||
|
mavenContent {
|
||||||
|
releasesOnly()
|
||||||
|
includeGroup("com.mojang")
|
||||||
|
includeGroup("net.minecraft")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* The paper repository, used for cloud-paper */
|
||||||
|
maven("https://repo.papermc.io/repository/maven-public/")
|
||||||
|
/* Used for cloud-cloudburst */
|
||||||
|
maven("https://repo.opencollab.dev/maven-snapshots/") {
|
||||||
|
name = "cloudburst"
|
||||||
|
mavenContent {
|
||||||
|
snapshotsOnly()
|
||||||
|
includeGroup("org.cloudburstmc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* The current Fabric repository */
|
||||||
|
maven("https://maven.fabricmc.net/") {
|
||||||
|
name = "fabric"
|
||||||
|
mavenContent { includeGroup("net.fabricmc") }
|
||||||
|
}
|
||||||
|
/* The current Sponge repository */
|
||||||
|
maven("https://repo.spongepowered.org/repository/maven-public/") {
|
||||||
|
name = "sponge"
|
||||||
|
mavenContent { includeGroup("org.spongepowered") }
|
||||||
|
}
|
||||||
|
/* JitPack, used for random dependencies */
|
||||||
|
maven("https://jitpack.io") {
|
||||||
|
name = "jitpack"
|
||||||
|
content { includeGroupByRegex("com\\.github\\..*") }
|
||||||
|
}
|
||||||
|
/* JDA's maven repository for cloud-jda */
|
||||||
|
maven("https://m2.dv8tion.net/releases") {
|
||||||
|
name = "dv8tion"
|
||||||
|
mavenContent { releasesOnly() }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "cloud"
|
rootProject.name = "cloud"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue