Skip to content

Commit

Permalink
Changes needed for release plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Ryan committed Sep 6, 2012
1 parent 1954d73 commit 2b31d36
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Thumbs.db
*/target
/build
*/build
#
# # IntelliJ specific files/directories

# IntelliJ specific files/directories
out
.idea
*.ipr
Expand Down
6 changes: 5 additions & 1 deletion gradle/convention.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ subprojects { project ->
sourceCompatibility = 1.6

// GRADLE-2087 workaround, perform after java plugin
status = version.contains('-SNAPSHOT')?'snapshot':'release'
status = rootProject.status

task sourcesJar(type: Jar, dependsOn:classes) {
classifier = 'sources'
Expand All @@ -22,6 +22,10 @@ subprojects { project ->
from javadoc.destinationDir
}

// Ensure output is on a new line
javadoc.doFirst { println "" }


artifacts {
archives sourcesJar
archives javadocJar
Expand Down
5 changes: 0 additions & 5 deletions gradle/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ subprojects {

// Closure to configure all the POM with extra info, common to all projects
pom.project {
parent {
groupId 'org.sonatype.oss'
artifactId 'oss-parent'
version '7'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
Expand Down
12 changes: 7 additions & 5 deletions gradle/release.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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
Expand All @@ -25,6 +24,8 @@ task uploadArtifactory(type: GradleBuild) {
startParameter.getExcludedTaskNames().add('check')
tasks = [ 'build', 'artifactoryPublish' ]
}
task releaseArtifactory(dependsOn: [checkSnapshotDependencies, uploadArtifactory])


task buildWithArtifactory(type: GradleBuild) {
startParameter = project.gradle.startParameter.newInstance()
Expand All @@ -34,11 +35,11 @@ task buildWithArtifactory(type: GradleBuild) {
}

// Ensure upload happens before taggging but after all pre-checks
uploadArtifactory.dependsOn checkSnapshotDependencies
createReleaseTag.dependsOn uploadArtifactory
releaseArtifactory.dependsOn checkSnapshotDependencies
createReleaseTag.dependsOn releaseArtifactory
gradle.taskGraph.whenReady { taskGraph ->
if ( taskGraph.hasTask(uploadArtifactory) && !taskGraph.hasTask(':release') ) {
throw new GradleException('"release" task has to be run before uploading to Artifactory')
if ( taskGraph.hasTask(uploadArtifactory) && rootProject.status == 'release' && !taskGraph.hasTask(':release') ) {
throw new GradleException('"release" task has to be run before uploading a release to Artifactory')
}
}
subprojects.each { project ->
Expand All @@ -61,5 +62,6 @@ release {
failOnPublishNeeded=true
failOnUnversionedFiles=true
failOnUpdateNeeded=true
includeProjectNameInTag=true
requireBranch = null
}

0 comments on commit 2b31d36

Please sign in to comment.