Is it possible to add a conditional statement when...
# gradle
m
Is it possible to add a conditional statement when applying a plugin? e.g.:
id 'com.plugins.my-plugin' version '1.0.0' apply ifEnvVarPresent
I want to apply this plugin only if an particular env var is present
t
Copy code
plugins {
    id 'com.plugins.my-plugin' version '1.0.0' apply false
}

if (myEnvVarPreset) {
    prygins.apply('com.plugins.my-plugin')
}
👍 1
m
Awesome! Thanks @turansky