You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2019/06/06 05:44:29 UTC

[lucene-solr] 03/04: SOLR-13452: Change JarChecksum to not copy all deps to a tmp folder.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 616e5d849ee1fbd469d8ac28be751c1251349511
Author: markrmiller <ma...@apache.org>
AuthorDate: Wed Jun 5 15:04:55 2019 -0500

    SOLR-13452: Change JarChecksum to not copy all deps to a tmp folder.
---
 .../org/apache/lucene/gradle/JarChecksum.groovy     | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/buildSrc/src/main/groovy/org/apache/lucene/gradle/JarChecksum.groovy b/buildSrc/src/main/groovy/org/apache/lucene/gradle/JarChecksum.groovy
index aa17f95..1095797 100644
--- a/buildSrc/src/main/groovy/org/apache/lucene/gradle/JarChecksum.groovy
+++ b/buildSrc/src/main/groovy/org/apache/lucene/gradle/JarChecksum.groovy
@@ -40,11 +40,7 @@ class JarChecksum extends DefaultTask {
   @Inject
   public JarChecksum(File inputDir,  File target) {
     
-    
     doLast({
-      File tmpDir = File.createTempDir()
-      tmpDir.deleteOnExit()
-      tmpDir.mkdirs()
       
       Set<File> deps = new HashSet<>()
       project.allprojects.each { p ->
@@ -62,15 +58,6 @@ class JarChecksum extends DefaultTask {
               }
             }
             deps = deps - ourJars
-            
-            // copy files to tmp dir
-            deps.each {
-              def file = it
-              File destFile = new File(tmpDir, file.name)
-              if (file.name.endsWith(".jar") && file.exists() && !destFile.exists()) {
-                Files.copy(file.toPath(), destFile.toPath())
-              }
-            }
           }
         }
       }
@@ -78,11 +65,13 @@ class JarChecksum extends DefaultTask {
       project.delete project.fileTree(dir: target.getAbsolutePath(), include: '**/*.jar.sha1')
       
       ant.checksum(algorithm: "SHA1", fileext: ".sha1", todir: target.getAbsolutePath()) {
-        ant.fileset(dir: tmpDir.getAbsolutePath())
+        for (File file : deps) {
+          if (file.getName().endsWith(".jar")) {
+            ant.fileset(file: file.getAbsolutePath())
+          }
+        }
       }
       
-      project.delete(tmpDir)
-      
       ant.fixcrlf(srcdir: target.getAbsolutePath(), includes: "**/*.jar.sha1", eol: "lf", fixlast: "true", encoding: "US-ASCII")
       
     })