Conditional Application Gradle Plugin

As the name implies, I want to use the plugin in my build.gradle if a specific properties file exists in the project folder. Next try

 buildscript { File c = file('crashlytics.properties') ext { crashlytics = c.exists(); } } if (crashlytics) { apply plugin: 'io.fabric' } //... 

the following error message is displayed

 No such property: verboseGradlePlugin for class: java.lang.Boolean 

Is there any way to achieve what I want?

+5
source share
1 answer

You may try:

 if (project.file('crashlytics.properties').exists()) { apply plugin: 'io.fabric' } 
+6
source

Source: https://habr.com/ru/post/1215081/


All Articles