From fe796eb18b90c15f13cb010e448f13d057e6b76f Mon Sep 17 00:00:00 2001 From: broccolai Date: Sat, 8 May 2021 09:23:22 +0100 Subject: [PATCH] build: Use Indra and minor cleanup Also fixes a small checkstyle complaint so I could test build --- .../carbon/api/DefaultedKeyValueRegistry.java | 4 +- build.gradle.kts | 69 ++++++++++--------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/api/src/main/java/net/draycia/carbon/api/DefaultedKeyValueRegistry.java b/api/src/main/java/net/draycia/carbon/api/DefaultedKeyValueRegistry.java index 84854a3e..d68c7507 100644 --- a/api/src/main/java/net/draycia/carbon/api/DefaultedKeyValueRegistry.java +++ b/api/src/main/java/net/draycia/carbon/api/DefaultedKeyValueRegistry.java @@ -5,8 +5,8 @@ import org.checkerframework.checker.nullness.qual.NonNull; /** * An extension of the DefaultedRegistryGetter that declares a defaultValue method - * @param - * @param + * @param the key type + * @param the value type */ public interface DefaultedKeyValueRegistry extends DefaultedRegistryGetter { diff --git a/build.gradle.kts b/build.gradle.kts index 3424bcd9..83452ecd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,17 @@ -import net.draycia.carbon.* - +import net.draycia.carbon.STYLECHECK_VER import org.checkerframework.gradle.plugin.CheckerFrameworkPlugin +import org.checkerframework.gradle.plugin.CheckerFrameworkExtension +import net.kyori.indra.IndraExtension +import net.kyori.indra.IndraCheckstylePlugin +import net.kyori.indra.IndraPlugin +import net.kyori.indra.IndraPublishingPlugin plugins { - `java-library` - `maven-publish` + val indraVersion = "2.0.2" + id("net.kyori.indra") version indraVersion apply false + id("net.kyori.indra.checkstyle") version indraVersion apply false + id("net.kyori.indra.publishing") version indraVersion apply false id("com.github.johnrengelman.shadow") version "7.0.0" apply false - //checkstyle id("org.checkerframework") version "0.5.20" apply false } @@ -14,31 +19,14 @@ ext["github"] = "https://github.com/Hexaoxide/Carbon" val projectVersion: String by project -allprojects { - group = "net.draycia" - description = "CarbonChat - A modern chat plugin" - version = projectVersion // todo: include git hash -} - -allprojects { - //configure { - // sourceCompatibility = JavaVersion.VERSION_11 - // targetCompatibility = sourceCompatibility - // disableAutoTargetJvm() - //} - - //checkstyle { - // toolVersion = "8.36.2" - // val configRoot = rootProject.projectDir - // configDirectory.set(configRoot) - // configProperties["basedir"] = configRoot.absolutePath - //} -} +group = "net.draycia" +description = "CarbonChat - A modern chat plugin" +version = projectVersion // todo: include git hash subprojects { - apply() - apply() - //apply() + apply() + apply() + apply() apply() repositories { @@ -63,14 +51,27 @@ subprojects { } dependencies { - //checkstyle("ca.stellardrift:stylecheck:$STYLECHECK_VER") + "checkstyle"("ca.stellardrift:stylecheck:$STYLECHECK_VER") + } + + configure { + disableAutoTargetJvm() + } + + configure { + checkers = listOf( + "org.checkerframework.checker.nullness.NullnessChecker" + ) + } + + configure { + gpl3OnlyLicense() + + javaVersions { + target(11) + } } -// checkerFramework { -// checkers = [ -// "org.checkerframework.checker.nullness.NullnessChecker" -// ] -// } } tasks {