build: Use Indra and minor cleanup

Also fixes a small checkstyle complaint so I could test build
This commit is contained in:
broccolai committed 2021-05-08 09:23:22 +01:00
1 parent 75f9e44bc8
commit fe796eb18b
2 files changed
+37 -36

No files matched your search

@@ -5,8 +5,8 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* An extension of the DefaultedRegistryGetter that declares a defaultValue method * An extension of the DefaultedRegistryGetter that declares a defaultValue method
* @param <K> * @param <K> the key type
* @param <V> * @param <V> the value type
*/ */
public interface DefaultedKeyValueRegistry<K, V> extends DefaultedRegistryGetter<K, V> { public interface DefaultedKeyValueRegistry<K, V> extends DefaultedRegistryGetter<K, V> {
+35 -34
View File
@@ -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.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 { plugins {
`java-library` val indraVersion = "2.0.2"
`maven-publish` 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 id("com.github.johnrengelman.shadow") version "7.0.0" apply false
//checkstyle
id("org.checkerframework") version "0.5.20" apply false 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 val projectVersion: String by project
allprojects { group = "net.draycia"
group = "net.draycia" description = "CarbonChat - A modern chat plugin"
description = "CarbonChat - A modern chat plugin" version = projectVersion // todo: include git hash
version = projectVersion // todo: include git hash
}
allprojects {
//configure<JavaPluginConvention> {
// sourceCompatibility = JavaVersion.VERSION_11
// targetCompatibility = sourceCompatibility
// disableAutoTargetJvm()
//}
//checkstyle {
// toolVersion = "8.36.2"
// val configRoot = rootProject.projectDir
// configDirectory.set(configRoot)
// configProperties["basedir"] = configRoot.absolutePath
//}
}
subprojects { subprojects {
apply<JavaLibraryPlugin>() apply<IndraPlugin>()
apply<MavenPublishPlugin>() apply<IndraCheckstylePlugin>()
//apply<CheckstylePlugin>() apply<IndraPublishingPlugin>()
apply<CheckerFrameworkPlugin>() apply<CheckerFrameworkPlugin>()
repositories { repositories {
@@ -63,14 +51,27 @@ subprojects {
} }
dependencies { dependencies {
//checkstyle("ca.stellardrift:stylecheck:$STYLECHECK_VER") "checkstyle"("ca.stellardrift:stylecheck:$STYLECHECK_VER")
}
configure<JavaPluginConvention> {
disableAutoTargetJvm()
}
configure<CheckerFrameworkExtension> {
checkers = listOf(
"org.checkerframework.checker.nullness.NullnessChecker"
)
}
configure<IndraExtension> {
gpl3OnlyLicense()
javaVersions {
target(11)
}
} }
// checkerFramework {
// checkers = [
// "org.checkerframework.checker.nullness.NullnessChecker"
// ]
// }
} }
tasks { tasks {