I have a script plugin that I would like to:
- Check if the
ivy-publishapplied (viaapply plugin: ivy-publish): - If it is applied, declare
publishing { repositories { ivy { } } } - If it's not applied, run some other code
However, I'm unsure of how to actually run code if the ivy-publish plugin is applied, and I couldn't find anything about that in the documentation. Is there any way to do this?
You can use the
PluginManager.withPlugin(String id, Action<? super AppliedPlugin> action) method. From the Javadoc:In your build script you could do something like: