-
fix(gradle): add dependsOn outputs to inputs dependentTasksOutputFiles (#31683)
发布于
2025-07-02 20:41:16 +00:00 Current Behavior
for gradle, its inputs depends on outputs of its dependsOn task. (e.g.
jar task)
however, if the output file does not exist, (for example, running for
1st time in ci), it will not add to inputs.
when getting inputs, it would give a warning likefile or directory '/Users/emily/code/ocean/dist/libs/shared/db-schema-kotlin/classes/java/main', not found file or directory '/Users/emily/code/ocean/dist/libs/shared/db-schema-kotlin/classes/kotlin/main', not found file or directory '/Users/emily/code/ocean/dist/libs/shared/db-schema-kotlin/resources/main', not foundit is a warning, not an error, so can't be caught.
In Gradle's file resolution internals: When you call task.inputs.files → Gradle resolves each file/directory. If a declared file or dir does not exist AND it's allowed to be missing, Gradle does not throw an error — instead it logs: file or directory '...' not found This log is just an INFO or DEBUG message. Gradle's normal file resolution is designed to be tolerant — so missing files do NOT stop the build by defaultExpected Behavior
this solution basically take AL
L of outputs of dependsOn tasks and add to inputs.Related Issue(s)
Fixes #
(cherry picked from commit
2abf1116d6)下载附件