Compile gradle task only when executed

Viewed 16

We've written some custom gradle tasks in Kotlin, and as they've grown, they've moved from build.gradle to buildSrc. These tasks are for processes that run in CI and developers don't really need them on their local machines.

The issue is that any time we modify these scripts, when developers pull latest their next gradle command takes an extra 15+ seconds because it has to compile buildSrc again.

Is there a best practice for how I can get ./gradlew <my-custom-task> to automatically compile and run a Kotlin task from somewhere in the project, but if I run ./gradlew build it ignores my task and does not attempt to compile it?

0 Answers
Related