Thank you for considering a contribution!
This guide explains how to:
- maximize the chance of your changes being accepted
- find the documentation to work on a Gradle plugin
- work on the code base and test your changes
- Check out the parent plugin: ben-manes/gradle-versions-plugin. Your feature request or bug report may be better adressed at this level.
- Check out the existing issues.
- Explain your use case and start the discussion before your submit a pull-request
If you have never worked on a Gradle plugin before, have a glimpse at the following guides
https://github.com/gradle-guides/gradle-site-plugin is a wonderful Gradle plugin sample demonstrating established techniques and practices for plugin development as described in the following guides:
Start IntelliJ IDEA 2018.3+
Open in IntelliJ the project from the folder composite
(composite/build.gradle).
From the Gradle
tool window, run the tasks checkAll
The composite
module defines a number of custom tasks to simplify the workflow
$ pwd
buildSrcVersions/composite
$ ./gradlew tasks --group=custom -q
Custom tasks
------------
checkAll - Run all checks
hello - Minimal task that do nothing. Useful to debug a failing build
pluginTests - Run plugin unit tests
publishLocally - Publish the plugin locally
publishPlugins - Publishes this plugin to the Gradle Plugin portal.
updateGradle - Update Gradle in all modules
wrapper - Update Gradle with ./gradlew wrapper
The samples are useful to test quickly how the plugin behaves, but sometimes it's best to test it into a real project.
This is as easy as editing your Settings
:
// MY_PROJECT/settings.gradle(.kts)
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
//rootProject.name = "MY_PROJECT"
The workflow is then:
- change something inside the plugin
- Run either the task
:publishLocally
fromcomposite
- ... or the task
:publishToMavenLocal
fromplugin
- Then run
:refreshVersions
or:buildSrcVersions
insideMY_PROJECT