Update Gradle and dependencies

- Fix *some* cross-project isolation issues. This appears to be the
   bare minimum to make the configuration cache happy. There is
   obviously a lot more work to do here.

 - Enable Configuration cache.

 - Fix some new checkstyle/errorprone/nullaway warnings.
This commit is contained in:
Jonathan Coates
2026-08-27 16:33:36 +01:00
parent 99e9c72686
commit 3469060b6b
23 changed files with 98 additions and 92 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ plugins {
id("cc-tweaked")
}
val isUnstable = project.properties["isUnstable"] == "true"
val modVersion: String by extra
val isUnstable = extra["isUnstable"] == "true"
val modVersion = extra["modVersion"] as String
val mcVersion = project.extensions.getByType<VersionCatalogsExtension>().named("libs")
.findVersion("minecraft").get().toString()
@@ -21,7 +21,7 @@ plugins {
id("net.fabricmc.fabric-loom-companion")
}
val modVersion: String by extra
val modVersion = extra["modVersion"] as String
val libs = project.extensions.getByType<VersionCatalogsExtension>().named("libs")
@@ -19,8 +19,8 @@ abstract class ModPublishingExtension {
val modPublishing = project.extensions.create("modPublishing", ModPublishingExtension::class.java)
val isUnstable = project.properties["isUnstable"] == "true"
val modVersion: String by extra
val isUnstable = extra["isUnstable"] == "true"
val modVersion = extra["modVersion"] as String
val mcVersion = project.extensions.getByType<VersionCatalogsExtension>().named("libs")
.findVersion("minecraft").get().toString()
@@ -29,12 +29,19 @@ MinecraftConfigurations.createDerivedConfiguration(project, MinecraftConfigurati
sourceSets.main { resources.srcDir("src/generated/resources") }
sourceSets.named("examples") { resources.srcDir("src/examples/generatedResources") }
configurations.consumable("samplesElement") {
attributes { attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType.SAMPLES)) }
outgoing.artifacts(sourceSets.named("examples").map { it.allSource.sourceDirectories.files }) {
type = ArtifactTypeDefinition.DIRECTORY_TYPE
}
}
// Make sure our examples compile.
tasks.check { dependsOn(tasks.named("compileExamplesJava")) }
// Similar to java-test-fixtures, but tries to avoid putting the obfuscated jar on the classpath.
val testFixtures by sourceSets.creating {
val testFixtures = sourceSets.create("testFixtures") {
compileClasspath += main.compileClasspath + client.compileClasspath
}
@@ -48,10 +55,10 @@ dependencies {
add(testFixtures.apiConfigurationName, libs.findBundle("test").get())
// Consumers of this project already have the common and client classes on the classpath, so it's fine for these
// to be compile-only.
add(testFixtures.compileOnlyApiConfigurationName, commonClasses(project))
add(testFixtures.compileOnlyApiConfigurationName, clientClasses(project))
add(testFixtures.compileOnlyApiConfigurationName, commonClasses(project()))
add(testFixtures.compileOnlyApiConfigurationName, clientClasses(project()))
testImplementation(testFixtures(project))
testImplementation(testFixtures(project()))
}
kotlin.compilerOptions.jvmTarget = CCTweakedPlugin.KOTLIN_TARGET
+1 -3
View File
@@ -96,9 +96,7 @@ SPDX-License-Identifier: MPL-2.0
<!-- Seems to complain about @hidden!? -->
<property name="allowUnknownTags" value="true" />
</module>
<module name="JavadocStyle">
<property name="checkHtml" value="false" />
</module>
<module name="SummaryJavadoc" />
<module name="NonEmptyAtclauseDescription" />
<module name="SingleLineJavadoc" />
<module name="SummaryJavadocCheck"/>
+1
View File
@@ -4,6 +4,7 @@
org.gradle.jvmargs=-Xmx3G -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configuration-cache=true
kotlin.stdlib.default.dependency=false
kotlin.jvm.target.validation.mode=error
+20 -20
View File
@@ -23,17 +23,17 @@ netty = "4.1.82.Final"
slf4j = "2.0.1"
# Core dependencies (independent of Minecraft)
asm = "9.9.1"
asm = "9.10.1"
autoService = "1.1.1"
checkerFramework = "4.0.0"
checkerFramework = "4.2.2"
cobalt = { strictly = "0.9.9" }
commonsCli = "1.11.0"
jetbrainsAnnotations = "26.1.0"
jspecify = "1.0.0"
jspecify = "1.0.1"
jzlib = "1.1.3"
kotlin = "2.3.21"
kotlin-coroutines = "1.10.2"
nightConfig = "3.8.4"
kotlin = "2.4.10"
kotlin-coroutines = "1.11.0"
nightConfig = "3.9.0"
# Minecraft mods
emi = "1.0.8+1.20.1"
@@ -51,30 +51,30 @@ create-fabric = "6.0.7.0+mc1.20.1-build.1716"
# Testing
hamcrest = "3.0"
jqwik = "1.9.3"
junit = "6.0.3"
junitPlatform = "6.0.3"
jqwik = "1.10.1"
junit = "6.1.3"
junitPlatform = "6.1.3"
jmh = "1.37"
# Build tools
cctJavadoc = "1.9.0"
checkstyle = "13.4.1"
errorProne-core = "2.49.0"
checkstyle = "14.0.0"
errorProne-core = "2.50.0"
errorProne-plugin = "4.3.0"
fabric-loom = "1.17.11"
fabric-loom = "1.17.20"
githubRelease = "2.5.2"
gradleVersions = "0.54.0"
gradleVersions = "0.61.0"
ideaExt = "1.3"
illuaminate = "0.1.0-83-g1131f68"
lwjgl = "3.4.1"
lwjgl = "3.4.3"
minotaur = "2.8.7"
modDevGradle = "2.0.141"
nullAway = "0.13.4"
shadow = "9.4.1"
spotless = "8.4.0"
nullAway = "0.14.0"
shadow = "9.6.1"
spotless = "8.10.0"
teavm = "0.15.0"
vanillaExtract = "0.3.1"
versionCatalogUpdate = "1.1.0"
vanillaExtract = "0.3.2"
versionCatalogUpdate = "1.1.1"
[libraries]
# Normal dependencies
@@ -169,7 +169,7 @@ yarn = { module = "net.fabricmc:yarn", version.ref = "yarn" }
[plugins]
githubRelease = { id = "com.github.breadmoirai.github-release", version.ref = "githubRelease" }
gradleVersions = { id = "com.github.ben-manes.versions", version.ref = "gradleVersions" }
gradleVersions = { id = "io.github.ben-manes.versions", version.ref = "gradleVersions" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
versionCatalogUpdate = { id = "nl.littlerobots.version-catalog-update", version.ref = "versionCatalogUpdate" }
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
Vendored
+2 -2
View File
@@ -20,7 +20,7 @@
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
# gradlew start up script for POSIX generated by Gradle.
#
# Important for running:
#
@@ -29,7 +29,7 @@
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
# ksh gradlew
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
Vendored
+2 -2
View File
@@ -19,7 +19,7 @@
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem gradlew startup script for Windows
@rem
@rem ##########################################################################
@@ -72,7 +72,7 @@ echo location of your Java installation. 1>&2
@rem Execute Gradle
@rem Execute gradlew
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
+14 -6
View File
@@ -15,11 +15,21 @@ java {
withJavadocJar()
}
dependencies {
api(project(":core-api"))
val snippetSourcesDependencies = configurations.dependencyScope("snippetSourcesDependencies")
val snippetSources = configurations.resolvable("snippetSources") {
extendsFrom(snippetSourcesDependencies)
attributes { attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named(DocsType.SAMPLES)) }
}
val javadocOverview by tasks.registering(Copy::class) {
dependencies {
api(project(":core-api"))
"snippetSourcesDependencies"(project(":common"))
"snippetSourcesDependencies"(project(":fabric"))
"snippetSourcesDependencies"(project(":forge"))
}
val javadocOverview = tasks.register<Copy>("javadocOverview") {
from("src/overview.html")
into(layout.buildDirectory.dir(name))
@@ -64,9 +74,7 @@ tasks.javadoc {
""".trimIndent(),
)
val snippetSources = listOf(":common", ":fabric", ":forge").flatMap {
project(it).sourceSets["examples"].allSource.sourceDirectories
}
val snippetSources = snippetSources.get().files.toList()
inputs.files(snippetSources)
addPathOption("-snippet-path").value = snippetSources
}
+7 -9
View File
@@ -63,15 +63,13 @@ illuaminate {
version = libs.versions.illuaminate
}
val luaJavadoc by tasks.registering(Javadoc::class) {
val luaJavadoc = tasks.register<Javadoc>("luaJavadoc") {
description = "Generates documentation for Java-side Lua functions."
group = JavaBasePlugin.DOCUMENTATION_GROUP
val sourceSets = listOf(sourceSets.main.get(), project(":core").sourceSets.main.get())
for (sourceSet in sourceSets) {
source(sourceSet.java)
classpath += sourceSet.compileClasspath
}
source(sourceSets.main.get().java.sourceDirectories)
source(project.layout.projectDirectory.dir("../core/src/main/java"))
classpath = sourceSets.main.get().compileClasspath + sourceSets.main.get().runtimeClasspath
destinationDir = layout.buildDirectory.dir("docs/luaJavadoc").get().asFile
@@ -84,7 +82,7 @@ val luaJavadoc by tasks.registering(Javadoc::class) {
javadocTool = javaToolchains.javadocToolFor { languageVersion = CCTweakedPlugin.JDK_VERSION }
}
val lintLua by tasks.registering(IlluaminateExec::class) {
val lintLua = tasks.register<IlluaminateExec>("lintLua") {
group = JavaBasePlugin.VERIFICATION_GROUP
description = "Lint Lua (and Lua docs) with illuaminate"
@@ -118,11 +116,11 @@ fun MergeTrees.configureForDatagen(source: SourceSet, outputFolder: String) {
}
}
val runData by tasks.registering(MergeTrees::class) {
val runData = tasks.register<MergeTrees>("runData") {
configureForDatagen(sourceSets.main.get(), "src/generated/resources")
}
val runExampleData by tasks.registering(MergeTrees::class) {
val runExampleData = tasks.register<MergeTrees>("runExampleData") {
configureForDatagen(sourceSets.examples.get(), "src/examples/generatedResources")
}
@@ -336,7 +336,7 @@ public record ComputerSelector(
private final Message tooltip;
Option(String name, Parser parser, SuggestionProvider suggest) {
private Option(String name, Parser parser, SuggestionProvider suggest) {
this.name = name;
this.parser = parser;
this.suggest = suggest;
@@ -10,6 +10,7 @@ import dan200.computercraft.api.filesystem.WritableMount;
import dan200.computercraft.api.media.IMedia;
import dan200.computercraft.api.peripheral.IComputerAccess;
import dan200.computercraft.api.peripheral.IPeripheral;
import dan200.computercraft.core.util.Nullability;
import dan200.computercraft.shared.common.AbstractContainerBlockEntity;
import dan200.computercraft.shared.network.client.PlayRecordClientMessage;
import dan200.computercraft.shared.network.server.ServerNetworking;
@@ -271,7 +272,7 @@ public final class DiskDriveBlockEntity extends AbstractContainerBlockEntity {
void detach(IComputerAccess computer) {
synchronized (this) {
unmountDisk(computer, computers.remove(computer));
unmountDisk(computer, Nullability.assertNonNull(computers.remove(computer)));
}
}
@@ -131,7 +131,7 @@ public final class TickScheduler {
* As such, it should be unique per {@link BlockEntity} instance to avoid it being queued multiple times.
*/
public static class Token {
static final AtomicReferenceFieldUpdater<Token, State> STATE = AtomicReferenceFieldUpdater.newUpdater(Token.class, State.class, "$state");
private static final AtomicReferenceFieldUpdater<Token, State> STATE = AtomicReferenceFieldUpdater.newUpdater(Token.class, State.class, "$state");
final BlockEntity owner;
+2 -11
View File
@@ -8,20 +8,11 @@ plugins {
id("cc-tweaked")
}
// Due to the slightly circular nature of our API, add the main API jars to the javadoc classpath.
val docApi by configurations.registering {
isTransitive = false
}
dependencies {
compileOnlyApi(libs.bundles.annotations)
"docApi"(project(":common-api"))
}
tasks.javadoc {
// Depend on the common API when publishing javadoc
classpath += docApi.get()
}
// Don't build Javadoc here. We build combined docs in the common-api project.
tasks.javadoc { isEnabled = false }
cct.linters(minecraft = false, loader = null)
+2 -2
View File
@@ -16,7 +16,7 @@ plugins {
id("cc-tweaked")
}
val modVersion: String by extra
val modVersion = extra["modVersion"] as String
dependencies {
api(project(":core-api"))
@@ -53,7 +53,7 @@ tasks.test {
systemProperty("cct.test-files", layout.buildDirectory.dir("tmp/testFiles").getAbsolutePath())
}
val checkChangelog by tasks.registering(cc.tweaked.gradle.CheckChangelog::class) {
val checkChangelog = tasks.register<cc.tweaked.gradle.CheckChangelog>("checkChangelog") {
version = modVersion
whatsNew = file("src/main/resources/data/computercraft/lua/rom/help/whatsnew.md")
changelog = file("src/main/resources/data/computercraft/lua/rom/help/changelog.md")
@@ -145,7 +145,7 @@ public final class MemoryMount extends AbstractInMemoryMount<MemoryMount.FileEnt
if (destParent == null) throw new FileOperationException(dest, "Parent directory does not exist");
if (destParent.exists()) throw new FileOperationException(dest, FILE_EXISTS);
destParent.put(sourceParent.parent().remove(sourceParent.name()));
destParent.put(Nullability.assertNonNull(sourceParent.parent().remove(sourceParent.name())));
}
@Override
+9 -9
View File
@@ -12,7 +12,7 @@ plugins {
id("cc-tweaked.mod-publishing")
}
val modVersion: String by extra
val modVersion = extra["modVersion"] as String
val allProjects = listOf(":core-api", ":core", ":fabric-api").map { evaluationDependsOn(it) }
cct {
@@ -49,11 +49,11 @@ addRemappedConfiguration("testWithIris")
configurations {
// Declare some configurations which are both included (jar-in-jar-ed) and a normal dependency (so they appear in
// our POM).
val includeRuntimeOnly by registering {
val includeRuntimeOnly = register("includeRuntimeOnly") {
isCanBeConsumed = false
isCanBeResolved = false
}
val includeImplementation by registering {
val includeImplementation = register("includeImplementation") {
isCanBeConsumed = false
isCanBeResolved = false
}
@@ -64,7 +64,7 @@ configurations {
// Declare a configuration for projects which are on the compile and runtime classpath, but not treated as
// dependencies. This is used for our local projects.
val localImplementation by registering {
val localImplementation = register("localImplementation") {
isCanBeResolved = false
isCanBeConsumed = false
}
@@ -182,7 +182,7 @@ loom {
jvmArguments.add("-ea")
}
val testClient by registering {
val testClient = register("testClient") {
displayName = "Test Client"
client()
configureForGameTest()
@@ -236,7 +236,7 @@ tasks.sourcesJar {
for (source in cct.sourceDirectories.get()) from(source.sourceSet.allSource)
}
val validateMixinNames by tasks.registering(net.fabricmc.loom.task.ValidateMixinNameTask::class) {
val validateMixinNames = tasks.register<net.fabricmc.loom.task.ValidateMixinNameTask>("validateMixinNames") {
source(sourceSets.main.get().output)
source(sourceSets.client.get().output)
source(sourceSets.testMod.get().output)
@@ -251,7 +251,7 @@ val runGametest = tasks.named<JavaExec>("runGametest") {
cct.jacoco(runGametest)
tasks.check { dependsOn(runGametest) }
val runGametestClient by tasks.registering(ClientJavaExec::class) {
val runGametestClient = tasks.register<ClientJavaExec>("runGametestClient") {
description = "Runs client-side gametests with no mods"
copyFrom("runTestClient")
@@ -259,7 +259,7 @@ val runGametestClient by tasks.registering(ClientJavaExec::class) {
}
cct.jacoco(runGametestClient)
val runGametestClientWithSodium by tasks.registering(ClientJavaExec::class) {
val runGametestClientWithSodium = tasks.register<ClientJavaExec>("runGametestClientWithSodium") {
description = "Runs client-side gametests with Sodium"
copyFrom("runTestClient")
@@ -268,7 +268,7 @@ val runGametestClientWithSodium by tasks.registering(ClientJavaExec::class) {
}
cct.jacoco(runGametestClientWithSodium)
val runGametestClientWithIris by tasks.registering(ClientJavaExec::class) {
val runGametestClientWithIris = tasks.register<ClientJavaExec>("runGametestClientWithIris") {
description = "Runs client-side gametests with Iris"
copyFrom("runTestClient")
+8 -8
View File
@@ -11,7 +11,7 @@ plugins {
id("cc-tweaked.mod-publishing")
}
val modVersion: String by extra
val modVersion = extra["modVersion"] as String
val allProjects = listOf(":core-api", ":core", ":forge-api").map { evaluationDependsOn(it) }
cct {
@@ -20,26 +20,26 @@ cct {
}
legacyForge {
val computercraft by mods.registering {
val computercraft = mods.register("computercraft") {
cct.sourceDirectories.get().forEach {
if (it.classes) sourceSet(it.sourceSet)
}
}
val computercraftDatagen by mods.registering {
val computercraftDatagen = mods.register("computercraftDatagen") {
cct.sourceDirectories.get().forEach {
if (it.classes) sourceSet(it.sourceSet)
}
sourceSet(sourceSets.datagen.get())
}
val testMod by mods.registering {
val testMod = mods.register("testMod") {
sourceSet(sourceSets.testMod.get())
sourceSet(sourceSets.testFixtures.get())
sourceSet(project(":core").sourceSets["testFixtures"])
}
val exampleMod by mods.registering {
val exampleMod = mods.register("exampleMod") {
sourceSet(sourceSets.examples.get())
}
@@ -131,7 +131,7 @@ configurations {
additionalRuntimeClasspath { extendsFrom(jarJar.get()) }
val testAdditionalRuntimeClasspath by registering {
val testAdditionalRuntimeClasspath = register("testAdditionalRuntimeClasspath") {
isCanBeResolved = true
isCanBeConsumed = false
// Prevent ending up with multiple versions of libraries on the classpath.
@@ -144,7 +144,7 @@ configurations {
// Declare a configuration for projects which are on the compile and runtime classpath, but not treated as
// dependencies. This is used for our local projects.
val localImplementation by registering {
val localImplementation = register("localImplementation") {
isCanBeResolved = false
isCanBeConsumed = false
}
@@ -234,7 +234,7 @@ val runGametest = tasks.named<JavaExec>("runGametest") {
cct.jacoco(runGametest)
tasks.check { dependsOn(runGametest) }
val runGametestClient by tasks.registering(ClientJavaExec::class) {
val runGametestClient = tasks.register<ClientJavaExec>("runGametestClient") {
description = "Runs client-side gametests with no mods"
copyFromForge("runTestClient")
tags("client")
+6 -6
View File
@@ -10,7 +10,7 @@ plugins {
id("cc-tweaked.illuaminate")
}
val modVersion: String by extra
val modVersion = extra["modVersion"] as String
node {
projectRoot = rootProject.projectDir
@@ -37,7 +37,7 @@ dependencies {
"builderImplementation"(libs.asm.commons)
}
val compileTeaVM by tasks.registering(JavaExec::class) {
val compileTeaVM = tasks.register<JavaExec>("compileTeaVM") {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Generate our classes and resources files"
@@ -66,7 +66,7 @@ val compileTeaVM by tasks.registering(JavaExec::class) {
javaLauncher = project.javaToolchains.launcherFor { languageVersion = java.toolchain.languageVersion }
}
val rollup by tasks.registering(cc.tweaked.gradle.NpxExecToDir::class) {
val rollup = tasks.register<cc.tweaked.gradle.NpxExecToDir>("rollup") {
group = LifecycleBasePlugin.BUILD_GROUP
description = "Bundles JS into rollup"
@@ -86,7 +86,7 @@ val rollup by tasks.registering(cc.tweaked.gradle.NpxExecToDir::class) {
args = listOf("rollup", "--config", "rollup.config.js") + if (minify) emptyList() else listOf("--configDebug")
}
val illuaminateDocs by tasks.registering(cc.tweaked.gradle.IlluaminateExecToDir::class) {
val illuaminateDocs = tasks.register<cc.tweaked.gradle.IlluaminateExecToDir>("illuaminateDocs") {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Generates docs using Illuaminate"
@@ -106,7 +106,7 @@ val illuaminateDocs by tasks.registering(cc.tweaked.gradle.IlluaminateExecToDir:
workingDir = rootProject.projectDir
}
val htmlTransform by tasks.registering(cc.tweaked.gradle.NpxExecToDir::class) {
val htmlTransform = tasks.register<cc.tweaked.gradle.NpxExecToDir>("htmlTransform") {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Post-processes documentation to statically render some dynamic content."
@@ -130,7 +130,7 @@ val htmlTransform by tasks.registering(cc.tweaked.gradle.NpxExecToDir::class) {
)
}
val docWebsite by tasks.registering(Copy::class) {
val docWebsite = tasks.register<Copy>("docWebsite") {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assemble docs and assets together into the documentation website."
duplicatesStrategy = DuplicatesStrategy.FAIL
+2
View File
@@ -30,6 +30,8 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("1.0.0")
}
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
rootProject.name = "cc-tweaked"
include(":core-api")