You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/10/05 19:48:48 UTC

[GitHub] [lucene] dweiss commented on a change in pull request #353: LUCENE-9488 Assemble source tar, with checksum and signing

dweiss commented on a change in pull request #353:
URL: https://github.com/apache/lucene/pull/353#discussion_r722601043



##########
File path: lucene/packaging/build.gradle
##########
@@ -179,6 +179,41 @@ artifacts {
   luceneZip(distZip)
 }
 
+// Source distribution using git export
+def sourceTarFile = file("build/distributions/lucene-${version}-src.tgz")
+import org.apache.commons.codec.digest.DigestUtils
+
+task assembleSourceDist() {
+    def target = sourceTarFile
+
+    outputs.files target

Review comment:
       An input to this task could be the head commit's sha... this way it wouldn't re-run archiving of the same commit. Again - not important for now.

##########
File path: lucene/packaging/build.gradle
##########
@@ -179,6 +179,41 @@ artifacts {
   luceneZip(distZip)
 }
 
+// Source distribution using git export
+def sourceTarFile = file("build/distributions/lucene-${version}-src.tgz")
+import org.apache.commons.codec.digest.DigestUtils
+
+task assembleSourceDist() {
+    def target = sourceTarFile
+
+    outputs.files target
+
+    // TODO: This is copied from distribution.gradle - reuse?
+    def checksum = { file ->
+        String sha512 = new DigestUtils(DigestUtils.sha512Digest).digestAsHex(file).trim()
+        new File(file.parent, file.name + ".sha512").write(sha512 + "  " + file.name, "UTF-8")
+    }
+
+    doFirst {
+        quietExec {
+            executable = project.externalTool("git")
+            workingDir = project.rootDir
+
+            args += [
+                    "archive",
+                    "--format", "tgz",
+                    "--prefix", "lucene-${version}/",
+                    "--output", target,
+                    "HEAD"
+            ]
+        }
+    }
+
+    doLast {

Review comment:
       doLast is unnecessary here - just append it at the end of the doFirst closure (after quietExec). 

##########
File path: lucene/packaging/build.gradle
##########
@@ -179,6 +179,41 @@ artifacts {
   luceneZip(distZip)
 }
 
+// Source distribution using git export
+def sourceTarFile = file("build/distributions/lucene-${version}-src.tgz")
+import org.apache.commons.codec.digest.DigestUtils
+
+task assembleSourceDist() {

Review comment:
       This would be typically an internal task attached to convention-style assemble:
   ```
   assemble.dependsOn assembleSourceDist
   ```
   Since we're using an external tool (git) and the whole process may be costly, I wouldn't worry about this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org