Home > OS >  Trigger ./gradlew test when files have changed
Trigger ./gradlew test when files have changed

Time:10-27

I am building a Spring Boot REST API application and using Kotlin as the language. For the development I am using IntellJ as the IDE.

The project structure looks as follows:

enter image description here

Is there a way to watch changes in the folder src to trigger the gradle task ./gradlew test after files have been changed?

CodePudding user response:

You can right click the gradle task and set it to be done e.g. after each build.

enter image description here

CodePudding user response:

You can use Gradle's support for continuous builds:

./gradlew test --continuous

This will cause Gradle to watch the filesystem for changes and execute the test task and any tasks upon which it depends whenever a change is detected.

  • Related