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 436C918E3B for ; Sat, 6 Feb 2016 18:07:36 +0000 (UTC) Received: (qmail 3254 invoked by uid 500); 6 Feb 2016 18:07:36 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 3203 invoked by uid 500); 6 Feb 2016 18:07:36 -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 3161 invoked by uid 99); 6 Feb 2016 18:07:36 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Feb 2016 18:07:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 9AC51C0881 for ; Sat, 6 Feb 2016 18:07:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.649 X-Spam-Level: X-Spam-Status: No, score=-3.649 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.429] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id m9dEzGTYrEDr for ; Sat, 6 Feb 2016 18:07:34 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 43B5031AFF for ; Sat, 6 Feb 2016 18:07:32 +0000 (UTC) Received: (qmail 2403 invoked by uid 99); 6 Feb 2016 18:07: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; Sat, 06 Feb 2016 18:07:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F1D35E0B13; Sat, 6 Feb 2016 18:07:30 +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: Sat, 06 Feb 2016 18:07:32 -0000 Message-Id: <4164faa9b6ca4816a7fe3c6634aeb905@git.apache.org> In-Reply-To: <477144c825c044c4acb26315ddda735a@git.apache.org> References: <477144c825c044c4acb26315ddda735a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/15] 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/5e8eed51 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/5e8eed51 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/5e8eed51 Branch: refs/heads/develop Commit: 5e8eed518e97201e48754314a2bddb962dbda229 Parents: 010f5f6 Author: Anthony Baker Authored: Tue Jan 12 08:42:06 2016 -0800 Committer: Anthony Baker Committed: Tue Jan 12 13:15:37 2016 -0800 ---------------------------------------------------------------------- build.gradle | 12 ++++++++++++ gemfire-assembly/build.gradle | 20 ++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/5e8eed51/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index 1f1077c..b9bd12f 100755 --- a/build.gradle +++ b/build.gradle @@ -37,6 +37,7 @@ 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. @@ -110,6 +111,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/5e8eed51/gemfire-assembly/build.gradle ---------------------------------------------------------------------- diff --git a/gemfire-assembly/build.gradle b/gemfire-assembly/build.gradle index 4c74513..54c33c6 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' into ('config') { from defaultCacheConfig @@ -323,7 +339,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"