Gradle: Force Custom Task to always run (no cache)

后端 未结 1 1151
花落未央
花落未央 2021-02-03 19:37

I wrote up a custom Gradle task to handle some dependency resolution on the file system where the paths are configurable. I want tasks of this type to always run. It seems thoug

相关标签:
1条回答
  • 2021-02-03 20:19

    You can achieve this by setting outputs.upToDateWhen { false } on the task.

    This can be performed in your build.gradle file:

    handleManagementArchive.outputs.upToDateWhen { false }
    

    It can also be done in the constructor of your custom task.

    ResolveProjectArchiveDependency() {
        outputs.upToDateWhen { false }
    }
    
    0 讨论(0)
提交回复
热议问题