Skip to content

Commit 2b31d36

Browse files
author
Justin Ryan
committed
Changes needed for release plugin
1 parent 1954d73 commit 2b31d36

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Thumbs.db
4444
*/target
4545
/build
4646
*/build
47-
#
48-
# # IntelliJ specific files/directories
47+
48+
# IntelliJ specific files/directories
4949
out
5050
.idea
5151
*.ipr

gradle/convention.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ subprojects { project ->
1010
sourceCompatibility = 1.6
1111

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

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

25+
// Ensure output is on a new line
26+
javadoc.doFirst { println "" }
27+
28+
2529
artifacts {
2630
archives sourcesJar
2731
archives javadocJar

gradle/maven.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ subprojects {
2929

3030
// Closure to configure all the POM with extra info, common to all projects
3131
pom.project {
32-
parent {
33-
groupId 'org.sonatype.oss'
34-
artifactId 'oss-parent'
35-
version '7'
36-
}
3732
licenses {
3833
license {
3934
name 'The Apache Software License, Version 2.0'

gradle/release.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
apply plugin: 'release'
32

43
// Ignore release plugin's task because it calls out via GradleBuild. This is a good place to put an email to send out
@@ -25,6 +24,8 @@ task uploadArtifactory(type: GradleBuild) {
2524
startParameter.getExcludedTaskNames().add('check')
2625
tasks = [ 'build', 'artifactoryPublish' ]
2726
}
27+
task releaseArtifactory(dependsOn: [checkSnapshotDependencies, uploadArtifactory])
28+
2829

2930
task buildWithArtifactory(type: GradleBuild) {
3031
startParameter = project.gradle.startParameter.newInstance()
@@ -34,11 +35,11 @@ task buildWithArtifactory(type: GradleBuild) {
3435
}
3536

3637
// Ensure upload happens before taggging but after all pre-checks
37-
uploadArtifactory.dependsOn checkSnapshotDependencies
38-
createReleaseTag.dependsOn uploadArtifactory
38+
releaseArtifactory.dependsOn checkSnapshotDependencies
39+
createReleaseTag.dependsOn releaseArtifactory
3940
gradle.taskGraph.whenReady { taskGraph ->
40-
if ( taskGraph.hasTask(uploadArtifactory) && !taskGraph.hasTask(':release') ) {
41-
throw new GradleException('"release" task has to be run before uploading to Artifactory')
41+
if ( taskGraph.hasTask(uploadArtifactory) && rootProject.status == 'release' && !taskGraph.hasTask(':release') ) {
42+
throw new GradleException('"release" task has to be run before uploading a release to Artifactory')
4243
}
4344
}
4445
subprojects.each { project ->
@@ -61,5 +62,6 @@ release {
6162
failOnPublishNeeded=true
6263
failOnUnversionedFiles=true
6364
failOnUpdateNeeded=true
65+
includeProjectNameInTag=true
6466
requireBranch = null
6567
}

0 commit comments

Comments
 (0)