Why is my Gradle task always running?

后端 未结 2 1356
谎友^
谎友^ 2020-12-04 19:20

If I run ./gradlew clean or ./gradlew tasks --all, it is always running my compile task(which I overwrote in the gradle build script like the below

2条回答
  •  广开言路
    2020-12-04 20:20

    Gradle does not know that your source was not changed. For any unknown status it marks the task as not up-to-date. Since your task is 100% replacement of compile, then it is your responsibility to provide the status of the task.

    Writing Custom Task Classes chapter provides details on how to get started with incremental tasks.

    Run your project with --info flag to see why Gradle is marking compile task as not up-to-date.

    Hope it helps.

提交回复
热议问题