Skip to content

Commit

Permalink
Update build for travis release
Browse files Browse the repository at this point in the history
  • Loading branch information
rspieldenner committed Aug 12, 2015
1 parent d342b18 commit 74d1c15
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
3.0.0 / 2015-08-11
3.0.0 / 2015-08-12
==================

* Simplify to just setting up and wiring publishing via travis through bintray.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Nebula Plugin Plugin
====================


[![Build Status](https://travis-ci.org/nebula-plugins/nebula-plugin-plugin.svg)](https://travis-ci.org/nebula-plugins/nebula-plugin-plugin)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nebula-plugins/nebula-plugin-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Apache 2.0](https://img.shields.io/github/license/nebula-plugins/nebula-plugin-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0)

Plugin to establish conventions for a nebula-plugins plugin, e.g. publishing, licenses.

Expand All @@ -21,7 +22,7 @@ To apply this plugin if using Gradle 2.1 or newer


plugins {
id 'nebula.plugin-plugin' version '3.0.0'
id 'nebula.plugin-plugin' version '3.0.0'
}

If using an older version of Gradle
Expand Down
41 changes: 41 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,44 @@ pluginBundle {
artifactId = 'nebula-plugin-plugin'
}
}

// Wire up build and publishing process
project.tasks.getByName('verifyReleaseStatus').actions.clear()
project.tasks.getByName('verifySnapshotStatus').actions.clear()

tasks.matching { it.name == 'bintrayUpload' || it.name == 'artifactoryPublish'}.all { Task task ->
task.mustRunAfter('build')
tasks.release.dependsOn(task)
}

tasks.matching { it.name == 'bintrayUpload' }.all { Task task ->
project.gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
task.onlyIf {
graph.hasTask(':final') || graph.hasTask(':candidate')
}
}
}

project.tasks.matching { it.name == 'artifactoryPublish'}.all { Task task ->
project.gradle.taskGraph.whenReady { TaskExecutionGraph graph ->
task.onlyIf {
graph.hasTask(':snapshot')
}
}
}

import org.ajoberstar.gradle.git.release.base.ReleasePluginExtension
ReleasePluginExtension releaseExtension = project.extensions.findByType(ReleasePluginExtension)
releaseExtension.with {
defaultVersionStrategy = nebula.plugin.release.NetflixOssStrategies.SNAPSHOT
}

if (project.hasProperty('release.travisci') && project.property('release.travisci').toBoolean()) {
project.tasks.release.deleteAllActions()
project.tasks.prepare.deleteAllActions()
nebulaRelease {
addReleaseBranchPattern(/HEAD/)
addReleaseBranchPattern(/v?\d+\.\d+\.\d+/)
addReleaseBranchPattern(/gradle-\d+\.\d+/)
}
}

0 comments on commit 74d1c15

Please sign in to comment.