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: [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