发布

  • fix(gradle): add dependsOn outputs to inputs dependentTasksOutputFiles (#31683)

    frostbyte_neo 发布于 2025-07-02 20:17:29 +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 like

    file 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 found
    

    it 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 default
    

    Expected Behavior

    this solution basically take AL
    Screenshot 2025-06-22 at 1 02 33 PM
    L of outputs of dependsOn tasks and add to inputs.

    Related Issue(s)

    Fixes #

    下载附件