How to create gradle task which always runs?

后端 未结 3 534
走了就别回头了
走了就别回头了 2021-02-13 14:01

I\'m likely overlooking something pretty core/obvious, but how can I create a task that will always be executed for every task/target?

I can do something like:



        
3条回答
  •  清酒与你
    2021-02-13 14:22

    What's wrong with invoking it straight from the root build.gradle?

    task init << {
        println "I always run"
    }
    
    tasks.init.execute()
    

提交回复
热议问题