I have a script plugin that I would like to:
ivy-publish
applied (via apply plugin: ivy-publish
):publishing { repositories { ivy { } } }
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?
The default behavior of the plugins {} block is to immediately resolve and apply the plugins. But, you can use the apply false syntax to tell Gradle not to apply the plugin to the current project and then use the plugins {} block without the version in subprojects' build scripts: Example 3.
This plugin adds Gradle Support to Jenkins. Gradle is managed as another tool inside Jenkins (the same way as Ant or Maven), including support for automatic installation and a new build step is provided to execute Gradle tasks.
This plugin will change the name of the APK, move the APK to your desired location, and create a text file in which it'll add all the dependencies for all the APKs you've created through the plugin. In the process, you'll learn about the following topics: Gradle tasks.
There are two types of plugins one is script plugin and second is binary plugin.
You can use the PluginManager.withPlugin(String id, Action<? super AppliedPlugin> action
) method. From the Javadoc:
If a plugin with the specified ID has already been applied, the supplied action will be executed immediately. Otherwise, the action will executed immediately after a plugin with the specified ID is applied.
In your build script you could do something like:
pluginManager.withPlugin('ivy-publish') {
// Do configuration
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With