forked from Netflix/Hystrix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Justin Ryan
committed
Aug 22, 2012
1 parent
a85e196
commit 8f289b7
Showing
6 changed files
with
79 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
version=1.4-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
// Executed in context of buildscript | ||
repositories { | ||
ivy { | ||
name = 'gradle_release' | ||
artifactPattern 'http://launchpad.net/[organization]/trunk/[revision]/+download/[artifact]-[revision].jar' | ||
} | ||
} | ||
dependencies { | ||
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.6.0' | ||
classpath 'com.mapvine:gradle-cobertura-plugin:0.1' | ||
classpath 'gradle-release:gradle-release:1.0pre' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,64 @@ | ||
buildscript { | ||
dependencies { classpath group: 'no.entitas.gradle', name: 'gradle-release-plugin', version: '1.11' } | ||
|
||
apply plugin: 'release' | ||
|
||
// Ignore release plugin's task because it calls out via GradleBuild. This is a good place to put an email to send out | ||
task release(overwrite: true, dependsOn: commitNewVersion) << { | ||
// This is a good place to put an email to send out | ||
} | ||
commitNewVersion.dependsOn updateVersion | ||
updateVersion.dependsOn createReleaseTag | ||
createReleaseTag.dependsOn preTagCommit | ||
def buildTasks = tasks.matching { it.name =~ /:build/ } | ||
preTagCommit.dependsOn buildTasks | ||
preTagCommit.dependsOn checkSnapshotDependencies | ||
//checkSnapshotDependencies.dependsOn confirmReleaseVersion // Introduced in 1.0, forces readLine | ||
//confirmReleaseVersion.dependsOn unSnapshotVersion | ||
checkSnapshotDependencies.dependsOn unSnapshotVersion // Remove once above is fixed | ||
unSnapshotVersion.dependsOn checkUpdateNeeded | ||
checkUpdateNeeded.dependsOn checkCommitNeeded | ||
checkCommitNeeded.dependsOn initScmPlugin | ||
|
||
// Call out to compile against internal repository | ||
task uploadArtifactory(type: GradleBuild) { | ||
startParameter = project.gradle.startParameter.newInstance() | ||
startParameter.addInitScript( file('gradle/netflix-oss.gradle') ) | ||
startParameter.getExcludedTaskNames().add('check') | ||
tasks = [ 'build', 'artifactoryPublish' ] | ||
} | ||
|
||
apply plugin: no.entitas.gradle.git.GitReleasePlugin // 'gitrelease' | ||
task buildWithArtifactory(type: GradleBuild) { | ||
startParameter = project.gradle.startParameter.newInstance() | ||
startParameter.addInitScript( file('gradle/netflix-oss.gradle') ) | ||
startParameter.getExcludedTaskNames().add('check') | ||
tasks = [ 'build' ] | ||
} | ||
|
||
// Ensure upload happens before taggging but after all pre-checks | ||
uploadArtifactory.dependsOn checkSnapshotDependencies | ||
createReleaseTag.dependsOn uploadArtifactory | ||
gradle.taskGraph.whenReady { taskGraph -> | ||
if ( taskGraph.hasTask(uploadArtifactory) && !taskGraph.hasTask(':release') ) { | ||
throw new GradleException('"release" task has to be run before uploading to Artifactory') | ||
} | ||
} | ||
subprojects.each { project -> | ||
project.uploadMavenCentral.dependsOn rootProject.checkSnapshotDependencies | ||
rootProject.createReleaseTag.dependsOn project.uploadMavenCentral | ||
|
||
gradle.taskGraph.whenReady { taskGraph -> | ||
if ( taskGraph.hasTask(project.uploadMavenCentral) && !taskGraph.hasTask(':release') ) { | ||
throw new GradleException('"release" task has to be run before uploading to Maven Central') | ||
} | ||
} | ||
} | ||
|
||
// Prevent plugin from asking for a version number interactively | ||
ext.'gradle.release.useAutomaticVersion' = "true" | ||
|
||
release { | ||
// http://tellurianring.com/wiki/gradle/release | ||
failOnCommitNeeded=false | ||
failOnPublishNeeded=false | ||
failOnUnversionedFiles=false | ||
failOnUpdateNeeded=false | ||
} |