mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-02 19:22:08 +00:00
Batch 5 of the API review: depend on IrisModule as a build of its own
settings.gradle includes ../IrisModule (art.arcane:iris-module); core depends on it with api, so the adapters keep seeing module classes. Core no longer compiles the module's sources: gradle/default-module.gradle, the ownership check and the module root of bukkitPurityRatchet are gone. The 111 module sources that need Iris itself (layout model, objects and blocks, structure model and placer, object placers) move into core unchanged. :core:builtinModulesJar now takes IrisModule's checked iris-builtins.jar (capability art.arcane:iris-builtins), checks it once more against the VolmLib classes the Bukkit jar leaves out, and writes it to build/builtin-modules for the jar and shadowJar. The shadowJar leaves out the module artifact's copies of the jar's classes, read from the jar itself. Tests copy that jar into packs (iris.builtinModulesJar) instead of rebuilding it from builtin-modules.txt; the pack type purity gate scans both class roots. EntityKeyHandler names iris:spawn's entity kind by id instead of SpawnResources.ENTITIES, which ships only in the built-ins jar (verifyBukkitArtifact failed on it since batch 3).
This commit is contained in:
1 parent
64658013fe
commit
b0a8904b31
118 files changed
+24552
-206
No files matched your search
@@ -1,60 +0,0 @@
|
||||
import org.gradle.api.tasks.bundling.Jar
|
||||
|
||||
// The first extraction keeps the legacy host/feature dependency cycle intact. Compile both
|
||||
// source roots together until the built-ins have been ported to the public IrisApi contracts.
|
||||
File defaultModuleDirectory = rootProject.file('../IrisModule')
|
||||
File defaultModuleSources = new File(defaultModuleDirectory, 'src/main/java')
|
||||
File sourcePatternsFile = new File(defaultModuleDirectory, 'source-patterns.txt')
|
||||
List<String> featureSourcePatterns = sourcePatternsFile.readLines().findAll { !it.isBlank() }
|
||||
|
||||
sourceSets.main.java.srcDir(defaultModuleSources)
|
||||
|
||||
def verifyDefaultModuleOwnership = tasks.register('verifyDefaultModuleOwnership') {
|
||||
group = 'verification'
|
||||
description = 'Checks that extracted built-ins have one source owner outside core.'
|
||||
inputs.file(sourcePatternsFile)
|
||||
inputs.dir(defaultModuleSources)
|
||||
inputs.dir(project.file('src/main/java'))
|
||||
doLast {
|
||||
Set<File> coreFeatureSources = fileTree(project.file('src/main/java')) {
|
||||
include(featureSourcePatterns)
|
||||
}.files
|
||||
if (!coreFeatureSources.isEmpty()) {
|
||||
throw new GradleException("Built-in sources must live in IrisModule: ${coreFeatureSources}")
|
||||
}
|
||||
|
||||
Set<File> unexpectedSources = fileTree(defaultModuleSources) {
|
||||
include('**/*.java')
|
||||
exclude(featureSourcePatterns)
|
||||
}.files
|
||||
if (!unexpectedSources.isEmpty()) {
|
||||
throw new GradleException("Default module sources need declared ownership: ${unexpectedSources}")
|
||||
}
|
||||
|
||||
featureSourcePatterns.each { String pattern ->
|
||||
if (fileTree(defaultModuleSources) { include(pattern) }.isEmpty()) {
|
||||
throw new GradleException("Missing default module source family: ${pattern}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named('compileJava').configure {
|
||||
dependsOn(verifyDefaultModuleOwnership)
|
||||
// The default module's lombok.config imports core's, so editing either changes the generated members.
|
||||
inputs.file(new File(defaultModuleDirectory, 'lombok.config'))
|
||||
.withPropertyName('defaultModuleLombokConfig')
|
||||
.withPathSensitivity(PathSensitivity.NONE)
|
||||
}
|
||||
|
||||
tasks.named('test').configure {
|
||||
systemProperty('iris.defaultModuleSources', defaultModuleSources.absolutePath)
|
||||
}
|
||||
|
||||
tasks.register('defaultModuleSourcesJar', Jar) {
|
||||
group = 'build'
|
||||
description = 'Packages the extracted built-in sources without the host implementation.'
|
||||
archiveBaseName.set('iris-default-module')
|
||||
archiveClassifier.set('sources')
|
||||
from(defaultModuleSources)
|
||||
}
|
||||
Reference in new issue
Block a user