BEWARE! This plugin is in incubating state, so its API may change in the future!
The plugin applies following plugins:
ShipkitConfigurationPlugin
GitOriginPlugin
GitConfigPlugin
and adds following tasks:
- checkoutBaseBranch - checkouts base branch - the branch to which version upgrade should be applied through pull request
- pullUpstream - syncs the fork on which we perform version upgrade with the upstream repo
- findOpenPullRequest - finds an open pull request with version upgrade if it exists
- checkoutVersionBranch - checkouts version branch where version will be upgraded. A new branch or the head branch for open pull request
- replaceVersion - replaces version in build file, using dependency pattern
- commitVersionUpgrade - commits replaced version
- pushVersionUpgrade - pushes the commit to the version branch
- createPullRequest - creates a pull request between base and version branches if there is no open pull request for this dependency already
- mergePullRequest - wait for status checks defined for pull request and in case of success merge it to base branch. Task is executed only if there was no previously opened pull request. If createPullRequest task is skipped, mergePullRequest is also skipped and pull request needs to be merged manually. If no checks defined, pull request also needs to be merged manually
- performVersionUpgrade - task aggregating all of the above
Plugin should be used in client projects that want to have automated version upgrades of some other dependency, that use the producer version of this plugin.
Project with the producer plugin applied would then clone a fork of client project and run './gradlew performVersionUpgrade -Pdependency=${group:name:version}' on it.
Example of plugin usage:
Configure your 'shipkit.gradle' file like here:
apply plugin: 'org.shipkit.upgrade-dependency'
upgradeDependency {
baseBranch = 'release/2.x'
buildFile = file('build.gradle')
}
and then call it:
./gradlew performVersionUpgrade -Pdependency=org.shipkit:shipkit:1.2.3