mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Move existing feature implementations and pack models out of core into modules/default without changing packages or algorithms. Compile both source roots together while legacy engine dependencies remain. Add source ownership checks, preserve the Bukkit purity ceiling across both roots, and update source-based diagnostics and archives. Validation: fresh compilation preserves all 1,995 runtime class hashes; module and Bukkit artifact checks pass. Targeted runs cover 955 tests, with 953 passing and two platform-fixture failures reproduced on the original commit.
57 lines
2.3 KiB
Groovy
57 lines
2.3 KiB
Groovy
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('modules/default')
|
|
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 modules/default: ${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)
|
|
}
|
|
|
|
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)
|
|
}
|