Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3BB5B185D9 for ; Thu, 14 Jan 2016 21:25:41 +0000 (UTC) Received: (qmail 69163 invoked by uid 500); 14 Jan 2016 21:25:41 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 69144 invoked by uid 500); 14 Jan 2016 21:25:40 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 69135 invoked by uid 99); 14 Jan 2016 21:25:40 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2016 21:25:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7C291180639 for ; Thu, 14 Jan 2016 21:25:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.227 X-Spam-Level: * X-Spam-Status: No, score=1.227 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 8DWAWwBfcTlC for ; Thu, 14 Jan 2016 21:25:32 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 4CF4F43F46 for ; Thu, 14 Jan 2016 21:25:32 +0000 (UTC) Received: (qmail 68962 invoked by uid 99); 14 Jan 2016 21:25:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2016 21:25:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AF734E389C; Thu, 14 Jan 2016 21:25:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: abaker@apache.org To: commits@geode.incubator.apache.org Date: Thu, 14 Jan 2016 21:25:32 -0000 Message-Id: <1d9fc168be364cc3bb7a045c49a3572d@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] incubator-geode git commit: GEODE-775: Add build support to easily sign release files GEODE-775: Add build support to easily sign release files Use the gradle signing plugin to sign jar artifacts and distributions. This is only done for release versions (-SNAPSHOT). Exclude KEYS and signatures from the distributions. Requires a user gradle file with the following properties: signing.keyId= signing.password= signing.secretKeyRingFile= Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/399ce5de Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/399ce5de Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/399ce5de Branch: refs/heads/develop Commit: 399ce5decff6b88d3cb841552d2107b998e03ffa Parents: c158fa5 Author: Anthony Baker Authored: Tue Jan 12 08:42:06 2016 -0800 Committer: Anthony Baker Committed: Thu Jan 14 13:21:40 2016 -0800 ---------------------------------------------------------------------- build.gradle | 13 +++++++++++++ gemfire-assembly/build.gradle | 20 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/399ce5de/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 13b2f33..352594e 100755 --- a/build.gradle +++ b/build.gradle @@ -37,6 +37,8 @@ dependencyVersions.keys().each{ k -> project.ext[k] = dependencyVersions[k]} allprojects { version = versionNumber + '-' + releaseType + ext.isReleaseVersion = !version.endsWith("SNAPSHOT") + // We want to see all test results. This is equivalatent to setting --continue // on the command line. gradle.startParameter.continueOnFailure = true @@ -108,6 +110,17 @@ gradle.taskGraph.whenReady({ graph -> subprojects { apply plugin: 'java' + apply plugin: 'signing' + + // set these properties in ~/.gradle/gradle.properties file: + // signing.keyId + // signing.password + // signing.secretKeyRingFile + if (isReleaseVersion) { + signing { + sign configurations.archives + } + } // apply compiler options gradle.taskGraph.whenReady( { graph -> http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/399ce5de/gemfire-assembly/build.gradle ---------------------------------------------------------------------- diff --git a/gemfire-assembly/build.gradle b/gemfire-assembly/build.gradle index d215742..a3f26a9 100755 --- a/gemfire-assembly/build.gradle +++ b/gemfire-assembly/build.gradle @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact; buildscript { repositories { @@ -30,11 +31,17 @@ apply plugin: 'maven-publish-auth' jar.enabled = false - configurations { archives } +// gradle doesn't automatically remove the jar artifact even though we disabled it +// this causes the signing plugin to fail +configurations.all { + artifacts.removeAll artifacts.findAll { it instanceof ArchivePublishArtifact && !it.archiveTask.enabled } +} + + dependencies { provided project(':gemfire-core') @@ -184,6 +191,13 @@ gradle.taskGraph.whenReady( { graph -> archive.doLast { ant.checksum file:"${archive.archivePath}", algorithm:"md5" ant.checksum file:"${archive.archivePath}", algorithm:"sha-256" + + if (isReleaseVersion) { + signing { + required { isReleaseVersion } + sign archive.archivePath + } + } } } }) @@ -193,6 +207,7 @@ distributions { baseName = 'apache-geode-src' contents { from (rootDir) { + exclude 'KEYS' exclude 'gradlew' exclude 'gradlew.bat' exclude 'gradle/wrapper/gradle-wrapper.jar' @@ -216,6 +231,7 @@ distributions { baseName = 'apache-geode' //TODO rootProject.name contents { duplicatesStrategy 'exclude' + exclude '*.asc' exclude '*.asc' exclude '*-sources.jar' @@ -327,7 +343,7 @@ afterEvaluate { // the ones defined in root ASF pom publishing { repositories { - if (project.version.endsWith('-SNAPSHOT')) { + if (!isReleaseVersion) { // Apache Development Snapshot Repository maven { name "apache.snapshots.https"