This is an automated email from the ASF dual-hosted git repository.

pjfanning pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi-xmlbeans.git

commit 9ac1879d57e81471c32c078c14549505af015ead
Author: PJ Fanning <[email protected]>
AuthorDate: Mon Nov 16 05:12:52 2026 +0100

    make the schema compiler classpath an input of the SchemaGen tasks
    
    Only the XSD files were inputs, so a change to the schema compiler in
    src/main/java reused stale generated sources from the build cache. That
    hid the AttrWCRestriction failure from #168 locally while CI, without a
    cache, reported it. The test SchemaGen tasks now also depend on
    bootstrapMigrate, which builds the compiler classes they run, and the sEXT
    classpath keeps the task dependencies of the main source set output.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 build.gradle | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/build.gradle b/build.gradle
index ff37020d..e1908760 100644
--- a/build.gradle
+++ b/build.gradle
@@ -184,9 +184,11 @@ wrapper {
     gradleVersion = '8.14.5'
 }
 
-def extCP = files(configurations.testCompileClasspath + 
sourceSets.main.output.files + sourceSets.main.resources.srcDirs)
+def extCP = files(configurations.testCompileClasspath, sourceSets.main.output, 
sourceSets.main.resources.srcDirs)
 testSchemas.each {
-    schemaGenTask(it.name, 'test', (it.name =~ /sEXT/ ? extCP : 
configurations.genresources), it.dir, "${it.path}:${it.name}")
+    def task = schemaGenTask(it.name, 'test', (it.name =~ /sEXT/ ? extCP : 
configurations.genresources), it.dir, "${it.path}:${it.name}")
+    // genresources holds the schema compiler classes that bootstrapMigrate 
builds from src/main/java
+    task.dependsOn 'bootstrapMigrate'
 }
 
 // https://discuss.gradle.org/t/passing-arguments-to-a-task/8427
@@ -201,6 +203,8 @@ def schemaGenTask(String baseName, String mainTest, 
FileCollection beansPath, St
         FileTree inputFiles = fileTree(dir: xsdDir, includes: 
map.keySet().collect{ it.split(' ')}.flatten())
 
         it.inputs.files(inputFiles)
+        // the schema compiler itself: without it, a change to the compiler 
reuses stale cached output
+        
it.inputs.files(beansPath).withPropertyName('schemaCompilerClasspath').withNormalizer(ClasspathNormalizer)
         it.outputs.dir(srcDir)
         it.outputs.dir(rscDir)
         it.outputs.cacheIf { true }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to