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



##########
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 {
+        checksum(sourceTarFile)
+    }
+}
+tasks.findByName("assembleDist").dependsOn(assembleSourceDist)

Review comment:
       What's 'assembleDist'? Where is it defined? findByName is not needed - 
if it's a known task, you can just say
   ```
   assembleDist.dependsOn(assembleSourceDist)
   ```
   but I can't find this task anywhere.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to