I'm trying add "thow StopExecutionException" in my android gradle file:
apply plugin: 'com.android.library'
task exportJar(type: Copy) {
def classesJar = file("build/intermediatess/bundles/release/classes.jar")
if (classesJar.exists()) {
//some code
} else {
**throw StopExecutionException**(classesJar.getPath() + " doesn't exist");
}
}
I use existing solution:
Recommended way to stop a Gradle build
but gradle doesn't recoginze StopExecutionException and any other Exception.
What I have to do? Apply some kind of plugin? Add classpath dependancy?