I create Gradle task which requires additional property (./gradlew myTask -PmyProperty=something
), so I want to check if this property exists and stop build task if not.
if (!project.hasProperty("myProperty")) {
throw new StopActionException("Please blebleble...")
}
And it works properly if I use gradlew, but Intellij suggests to import changes (Intellij Gradle plugin) and then I get an error exactly in this line where I throw exception. It seems like plugin tries run this tasks before I launch them or something. Is there any possibility to fix it?
I did it exactly like here: Recommended way to stop a Gradle build