Skip to content

Latest commit

 

History

History
84 lines (55 loc) · 2.68 KB

CONTRIBUTING.md

File metadata and controls

84 lines (55 loc) · 2.68 KB

Contributing

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

Before you start

  • 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

Writing a Gradle plugin

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:

Workflow for this project

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

image

Tasks

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

Publishing the plugin locally

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 from composite
  • ... or the task :publishToMavenLocal from plugin
  • Then run :refreshVersions or :buildSrcVersions inside MY_PROJECT