lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sar...@apache.org
Subject svn commit: r1562554 - /lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java
Date Wed, 29 Jan 2014 19:20:13 GMT
Author: sarowe
Date: Wed Jan 29 19:20:12 2014
New Revision: 1562554

URL: http://svn.apache.org/r1562554
Log:
LUCENE-5420: stop re-compiling the internal module dependency regex for every dependency

Modified:
    lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java

Modified: lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java?rev=1562554&r1=1562553&r2=1562554&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java
(original)
+++ lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java
Wed Jan 29 19:20:12 2014
@@ -115,6 +115,7 @@ public class GetMavenDependenciesTask ex
      = new HashMap<String,SortedSet<ExternalDependency>>();
   private final DocumentBuilder documentBuilder;
   private File ivyCacheDir;
+  private Pattern internalJarPattern;
 
 
   /**
@@ -180,6 +181,12 @@ public class GetMavenDependenciesTask ex
    */
   @Override
   public void execute() throws BuildException {
+    // Local:   lucene/build/analysis/common/lucene-analyzers-common-5.0-SNAPSHOT.jar
+    // Jenkins: lucene/build/analysis/common/lucene-analyzers-common-5.0-2013-10-31_18-52-24.jar
+    // Also support any custom version, which won't necessarily conform to any predefined
pattern.
+    internalJarPattern = Pattern.compile(".*(lucene|solr)([^/]*?)-"
+        + Pattern.quote(getProject().getProperty("version")) + "\\.jar");
+
     setInternalDependencyProperties();            // side-effect: all modules' internal deps
are recorded
     setExternalDependencyProperties();            // side-effect: all modules' external deps
are recorded
     setGrandparentDependencyManagementProperty(); // uses deps recorded in above two methods
@@ -485,7 +492,7 @@ public class GetMavenDependenciesTask ex
 
   /**
    * Sets the internal dependencies compile and test properties to be inserted 
-   * into modules' POMs.                                                                
         k
+   * into modules' POMs.
    * 
    * Also collects shared external dependencies, 
    * e.g. solr-core wants all of solrj's external dependencies 
@@ -614,15 +621,10 @@ public class GetMavenDependenciesTask ex
       }
       artifactId.append(artifact);
     } else {
-      // Local:   lucene/build/analysis/common/lucene-analyzers-common-5.0-SNAPSHOT.jar
-      // Jenkins: lucene/build/analysis/common/lucene-analyzers-common-5.0-2013-10-31_18-52-24.jar
-      // Also support any custom version, which won't necessarily conform to any predefined
pattern.
-      Pattern internalJarPattern = Pattern.compile(".*(lucene|solr)([^/]*?)-"
-                                 + Pattern.quote(getProject().getProperty("version")) + "\\.jar");
-
       matcher = internalJarPattern.matcher(dependency);
       if (matcher.matches()) {
-        // Pattern.compile(".*(lucene|solr)([^/]*?)-(?:\\d\\.)+\\d(?:-SNAPSHOT)?\\.jar)")
+        // internalJarPattern is /.*(lucene|solr)([^/]*?)-<version>\.jar/,
+        // where <version> is the value of the Ant "version" property
         artifactId.append(matcher.group(1));
         artifactId.append(matcher.group(2));
       } else {



Mime
View raw message