geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Baker (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-775) Build should create checksum for distributions
Date Tue, 12 Jan 2016 00:31:39 GMT

    [ https://issues.apache.org/jira/browse/GEODE-775?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15093005#comment-15093005
] 

Anthony Baker commented on GEODE-775:
-------------------------------------


{code}
diff --git a/gemfire-assembly/build.gradle b/gemfire-assembly/build.gradle
index ad466de..e214640 100755
--- a/gemfire-assembly/build.gradle
+++ b/gemfire-assembly/build.gradle
@@ -177,6 +177,25 @@ task gfshDepsJar (type: Jar, dependsOn: ':gemfire-core:classes') {
   }
 }
 
+def hash(file, type) {
+  java.security.MessageDigest md = java.security.MessageDigest.getInstance(type);
+  file.eachByte(1024*1024) { buffer, read ->
+    md.update(buffer, 0, read);
+  }
+  return md.digest().collect { String.format "%02x", it }.join();
+}
+
+gradle.taskGraph.whenReady( { graph ->
+  tasks.withType(AbstractArchiveTask).findAll {
+    it.name.toLowerCase().contains("dist")
+  }.each { archive ->
+    archive.doLast {
+      file("${archive.archivePath}.md5").write(hash(archive.archivePath, 'md5') + System.lineSeparator())
+      file("${archive.archivePath}.sha1").write(hash(archive.archivePath, 'sha-1') + System.lineSeparator())
+    }
+  }
+})
+
 distributions {
   src {
     baseName = 'apache-geode-src'

{code}

> Build should create checksum for distributions
> ----------------------------------------------
>
>                 Key: GEODE-775
>                 URL: https://issues.apache.org/jira/browse/GEODE-775
>             Project: Geode
>          Issue Type: Improvement
>          Components: build
>            Reporter: Anthony Baker
>
> When the build generates a distribution (source or binary), we should also create matching
checksum files.  These checksums are needed for publishing releases.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message