diff --git a/build.gradle b/build.gradle index 66ee3474c..479d6f5d5 100644 --- a/build.gradle +++ b/build.gradle @@ -25,11 +25,13 @@ buildscript { classpath "io.github.gradle-nexus:publish-plugin:$nexusPublishPluginVersion" classpath "com.adarshr:gradle-test-logger-plugin:$testLoggerPluginVersion" classpath "se.ascp.gradle:gradle-versions-filter:$versionsFilterPluginVersion" + classpath "pl.allegro.tech.build:axion-release-plugin:$axionReleasePluginVersion" } } apply from: "${rootProject.projectDir}/gradle/versions.gradle" apply from: "${rootProject.projectDir}/gradle/publish.gradle" +apply from: "${rootProject.projectDir}/gradle/release.gradle" group = 'io.etcd' @@ -43,8 +45,8 @@ allprojects { subprojects { apply from: "${rootProject.projectDir}/gradle/style.gradle" apply from: "${rootProject.projectDir}/gradle/quality.gradle" - apply from: "${rootProject.projectDir}/gradle/release.gradle" - apply from: "${rootProject.projectDir}/gradle/release-tasks.gradle" + apply from: "${rootProject.projectDir}/gradle/publishing-release.gradle" + apply from: "${rootProject.projectDir}/gradle/publishing-release-tasks.gradle" apply plugin: 'java-library' apply plugin: "com.adarshr.test-logger" @@ -68,3 +70,4 @@ subprojects { } + diff --git a/gradle.properties b/gradle.properties index 9b267bdcb..71741e917 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,6 @@ # # project # -version = 999-SNAPSHOT gitProject = 'https://github.com/etcd-io/jetcd' gitURL = 'git@github.com/etcd-io/jetcd.git' @@ -22,6 +21,7 @@ shadowPluginVersion = 7.1.0 testLoggerPluginVersion = 3.1.0 protobufPluginVersion = 0.8.18 nexusPublishPluginVersion = 1.1.0 +axionReleasePluginVersion = 1.13.6 # # gradle diff --git a/gradle/release-tasks.gradle b/gradle/publishing-release-tasks.gradle similarity index 100% rename from gradle/release-tasks.gradle rename to gradle/publishing-release-tasks.gradle diff --git a/gradle/publishing-release.gradle b/gradle/publishing-release.gradle new file mode 100644 index 000000000..c7d5839ca --- /dev/null +++ b/gradle/publishing-release.gradle @@ -0,0 +1,97 @@ +/* + * Copyright 2016-2021 The jetcd authors + * + * Licensed under the Apache License, Version 2.0 (the 'License'); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an 'AS IS' BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'java-library' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + "${project.name}"(MavenPublication) { + groupId = rootProject.group + + from components.java + + pom { + name = project.name + description = project.name + url = "${gitProject}" + + scm { + url = "${gitProject}" + connection = "scm:${gitProject}" + developerConnection = "scm:${gitURL}" + } + + licenses { + license { + name = 'The Apache Software License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution = 'repo' + } + } + + developers { + developer { + id = 'lburgazzoli' + name = 'Luca Burgazzoli' + organization = 'Red Hat' + organizationUrl = 'http://redhat.com' + } + developer { + name = 'Fanmin Shi' + organization = 'CoreOS' + organizationUrl = 'http://coreos.com' + } + developer { + name = 'Xiang Li' + organization = 'CoreOS' + organizationUrl = 'http://coreos.com' + } + developer { + name = 'Anthony Romano' + organization = 'CoreOS' + organizationUrl = 'http://coreos.com' + } + } + } + } + } +} + +signing { + required { + !version.endsWith('SNAPSHOT') + } + + if (!version.endsWith('SNAPSHOT')) { + useGpgCmd() + } + + sign publishing.publications."${project.name}" +} + +javadoc { + if(JavaVersion.current().isJava9Compatible()) { + options.addBooleanOption('html5', true) + } +} + diff --git a/gradle/release.gradle b/gradle/release.gradle index c7d5839ca..ad2593557 100644 --- a/gradle/release.gradle +++ b/gradle/release.gradle @@ -14,84 +14,15 @@ * limitations under the License. */ -apply plugin: 'java-library' -apply plugin: 'maven-publish' -apply plugin: 'signing' +apply plugin: "pl.allegro.tech.build.axion-release" -java { - withJavadocJar() - withSourcesJar() -} - -publishing { - publications { - "${project.name}"(MavenPublication) { - groupId = rootProject.group - - from components.java - - pom { - name = project.name - description = project.name - url = "${gitProject}" - - scm { - url = "${gitProject}" - connection = "scm:${gitProject}" - developerConnection = "scm:${gitURL}" - } - - licenses { - license { - name = 'The Apache Software License, Version 2.0' - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution = 'repo' - } - } - - developers { - developer { - id = 'lburgazzoli' - name = 'Luca Burgazzoli' - organization = 'Red Hat' - organizationUrl = 'http://redhat.com' - } - developer { - name = 'Fanmin Shi' - organization = 'CoreOS' - organizationUrl = 'http://coreos.com' - } - developer { - name = 'Xiang Li' - organization = 'CoreOS' - organizationUrl = 'http://coreos.com' - } - developer { - name = 'Anthony Romano' - organization = 'CoreOS' - organizationUrl = 'http://coreos.com' - } - } - } - } - } -} - -signing { - required { - !version.endsWith('SNAPSHOT') - } - - if (!version.endsWith('SNAPSHOT')) { - useGpgCmd() - } - - sign publishing.publications."${project.name}" -} -javadoc { - if(JavaVersion.current().isJava9Compatible()) { - options.addBooleanOption('html5', true) +scmVersion { + tag { + prefix = 'jetcd-' } } +allprojects { + project.version = scmVersion.version +} \ No newline at end of file