Skip to content

Commit 48a0a13

Browse files
committed
feat: add axiom release plugin
1 parent 25fd0ca commit 48a0a13

File tree

5 files changed

+110
-79
lines changed

5 files changed

+110
-79
lines changed

build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ buildscript {
2525
classpath "io.github.gradle-nexus:publish-plugin:$nexusPublishPluginVersion"
2626
classpath "com.adarshr:gradle-test-logger-plugin:$testLoggerPluginVersion"
2727
classpath "se.ascp.gradle:gradle-versions-filter:$versionsFilterPluginVersion"
28+
classpath "pl.allegro.tech.build:axion-release-plugin:$axionReleasePluginVersion"
2829
}
2930
}
3031

3132
apply from: "${rootProject.projectDir}/gradle/versions.gradle"
3233
apply from: "${rootProject.projectDir}/gradle/publish.gradle"
34+
apply from: "${rootProject.projectDir}/gradle/release.gradle"
3335

3436
group = 'io.etcd'
3537

@@ -43,8 +45,8 @@ allprojects {
4345
subprojects {
4446
apply from: "${rootProject.projectDir}/gradle/style.gradle"
4547
apply from: "${rootProject.projectDir}/gradle/quality.gradle"
46-
apply from: "${rootProject.projectDir}/gradle/release.gradle"
47-
apply from: "${rootProject.projectDir}/gradle/release-tasks.gradle"
48+
apply from: "${rootProject.projectDir}/gradle/publishing-release.gradle"
49+
apply from: "${rootProject.projectDir}/gradle/publishing-release-tasks.gradle"
4850

4951
apply plugin: 'java-library'
5052
apply plugin: "com.adarshr.test-logger"
@@ -68,3 +70,4 @@ subprojects {
6870
}
6971

7072

73+

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#
22
# project
33
#
4-
version = 999-SNAPSHOT
54
gitProject = 'https://github.com/etcd-io/jetcd'
65
gitURL = 'git@github.com/etcd-io/jetcd.git'
76

@@ -22,6 +21,7 @@ shadowPluginVersion = 7.1.0
2221
testLoggerPluginVersion = 3.1.0
2322
protobufPluginVersion = 0.8.18
2423
nexusPublishPluginVersion = 1.1.0
24+
axionReleasePluginVersion = 1.13.6
2525

2626
#
2727
# gradle

gradle/publishing-release.gradle

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/*
2+
* Copyright 2016-2021 The jetcd authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the 'License');
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an 'AS IS' BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'java-library'
18+
apply plugin: 'maven-publish'
19+
apply plugin: 'signing'
20+
21+
java {
22+
withJavadocJar()
23+
withSourcesJar()
24+
}
25+
26+
publishing {
27+
publications {
28+
"${project.name}"(MavenPublication) {
29+
groupId = rootProject.group
30+
31+
from components.java
32+
33+
pom {
34+
name = project.name
35+
description = project.name
36+
url = "${gitProject}"
37+
38+
scm {
39+
url = "${gitProject}"
40+
connection = "scm:${gitProject}"
41+
developerConnection = "scm:${gitURL}"
42+
}
43+
44+
licenses {
45+
license {
46+
name = 'The Apache Software License, Version 2.0'
47+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
48+
distribution = 'repo'
49+
}
50+
}
51+
52+
developers {
53+
developer {
54+
id = 'lburgazzoli'
55+
name = 'Luca Burgazzoli'
56+
organization = 'Red Hat'
57+
organizationUrl = 'http://redhat.com'
58+
}
59+
developer {
60+
name = 'Fanmin Shi'
61+
organization = 'CoreOS'
62+
organizationUrl = 'http://coreos.com'
63+
}
64+
developer {
65+
name = 'Xiang Li'
66+
organization = 'CoreOS'
67+
organizationUrl = 'http://coreos.com'
68+
}
69+
developer {
70+
name = 'Anthony Romano'
71+
organization = 'CoreOS'
72+
organizationUrl = 'http://coreos.com'
73+
}
74+
}
75+
}
76+
}
77+
}
78+
}
79+
80+
signing {
81+
required {
82+
!version.endsWith('SNAPSHOT')
83+
}
84+
85+
if (!version.endsWith('SNAPSHOT')) {
86+
useGpgCmd()
87+
}
88+
89+
sign publishing.publications."${project.name}"
90+
}
91+
92+
javadoc {
93+
if(JavaVersion.current().isJava9Compatible()) {
94+
options.addBooleanOption('html5', true)
95+
}
96+
}
97+

gradle/release.gradle

Lines changed: 7 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -14,84 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
apply plugin: 'java-library'
18-
apply plugin: 'maven-publish'
19-
apply plugin: 'signing'
17+
apply plugin: "pl.allegro.tech.build.axion-release"
2018

21-
java {
22-
withJavadocJar()
23-
withSourcesJar()
24-
}
25-
26-
publishing {
27-
publications {
28-
"${project.name}"(MavenPublication) {
29-
groupId = rootProject.group
30-
31-
from components.java
32-
33-
pom {
34-
name = project.name
35-
description = project.name
36-
url = "${gitProject}"
37-
38-
scm {
39-
url = "${gitProject}"
40-
connection = "scm:${gitProject}"
41-
developerConnection = "scm:${gitURL}"
42-
}
43-
44-
licenses {
45-
license {
46-
name = 'The Apache Software License, Version 2.0'
47-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
48-
distribution = 'repo'
49-
}
50-
}
51-
52-
developers {
53-
developer {
54-
id = 'lburgazzoli'
55-
name = 'Luca Burgazzoli'
56-
organization = 'Red Hat'
57-
organizationUrl = 'http://redhat.com'
58-
}
59-
developer {
60-
name = 'Fanmin Shi'
61-
organization = 'CoreOS'
62-
organizationUrl = 'http://coreos.com'
63-
}
64-
developer {
65-
name = 'Xiang Li'
66-
organization = 'CoreOS'
67-
organizationUrl = 'http://coreos.com'
68-
}
69-
developer {
70-
name = 'Anthony Romano'
71-
organization = 'CoreOS'
72-
organizationUrl = 'http://coreos.com'
73-
}
74-
}
75-
}
76-
}
77-
}
78-
}
79-
80-
signing {
81-
required {
82-
!version.endsWith('SNAPSHOT')
83-
}
84-
85-
if (!version.endsWith('SNAPSHOT')) {
86-
useGpgCmd()
87-
}
88-
89-
sign publishing.publications."${project.name}"
90-
}
9119

92-
javadoc {
93-
if(JavaVersion.current().isJava9Compatible()) {
94-
options.addBooleanOption('html5', true)
20+
scmVersion {
21+
tag {
22+
prefix = 'jetcd-'
9523
}
9624
}
9725

26+
allprojects {
27+
project.version = scmVersion.version
28+
}

0 commit comments

Comments
 (0)