felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsav...@apache.org
Subject svn commit: r829748 - in /felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy: FindUtil.java ProjectRepository.java
Date Mon, 26 Oct 2009 10:37:56 GMT
Author: dsavage
Date: Mon Oct 26 10:37:56 2009
New Revision: 829748

URL: http://svn.apache.org/viewvc?rev=829748&view=rev
Log:
Ensure **sigil.properties pattern matches sigil.properties in top level dir (FELIX-1794)
Also patch FindUtil to make unit testing easier

Modified:
    felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/FindUtil.java
    felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java

Modified: felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/FindUtil.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/FindUtil.java?rev=829748&r1=829747&r2=829748&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/FindUtil.java (original)
+++ felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/FindUtil.java Mon Oct 26
10:37:56 2009
@@ -27,11 +27,11 @@
 
 public class FindUtil
 {
-    static final String WILD_ANY = "[^.].*";
-    static final String WILD_ONE = "[^.][^;]*"; // WILD_ONE.endsWith(WILD_ANY) == false
-
+    static final String WILD_ANY = "[^.]?.*";
+    static final String WILD_ONE = "[^.]?[^;]*"; // WILD_ONE.endsWith(WILD_ANY) == false
+    
     // example pattern: ${repository}/projects/abc*/*/project.sigil
-    public static Collection<File> findFiles(String pattern) throws IOException
+    public static Collection<File> findFiles(File workingDir, String pattern) throws
IOException
     {
         int star = pattern.indexOf("*");
         if (star == -1)
@@ -49,7 +49,7 @@
         String[] patterns = regex.split("/");
 
         TreeSet<File> list = new TreeSet<File>();
-        File root = new File(slash == -1 ? "." : pattern.substring(0, slash));
+        File root = slash == -1 ? workingDir : new File(pattern.substring(0, slash)).getAbsoluteFile();
 
         if (root.isDirectory())
         {
@@ -66,7 +66,7 @@
     private static void findFiles(File dir, int level, String[] patterns,
         Collection<File> list)
     {
-        final String filePattern = patterns[patterns.length - 1];
+        final String filePattern = patterns[patterns.length - 1] + "$";
         final String dirPattern;
 
         if (level < patterns.length - 1)

Modified: felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java
URL: http://svn.apache.org/viewvc/felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java?rev=829748&r1=829747&r2=829748&view=diff
==============================================================================
--- felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java (original)
+++ felix/trunk/sigil/ivy/resolver/src/org/apache/felix/sigil/ivy/ProjectRepository.java Mon
Oct 26 10:37:56 2009
@@ -159,7 +159,7 @@
         {
             try
             {
-                Collection<File> files = FindUtil.findFiles(pattern);
+                Collection<File> files = FindUtil.findFiles(new File(""), pattern);
                 if (files.isEmpty())
                 {
                     Log.warn("ProjectRepository: no projects match: " + pattern);



Mime
View raw message