You are viewing a plain text version of this content. The canonical link for it is here.
Posted to m2-dev@maven.apache.org by jv...@apache.org on 2005/03/14 08:24:23 UTC

cvs commit: maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter ArtifactFilter.java ExclusionSetFilter.java

jvanzyl     2005/03/13 23:24:23

  Modified:    maven-artifact/src/main/java/org/apache/maven/artifact
                        DefaultArtifact.java
               maven-artifact/src/main/java/org/apache/maven/artifact/resolver
                        DefaultArtifactResolver.java
               maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter
                        ArtifactFilter.java ExclusionSetFilter.java
  Log:
  o change the signature of the filter so that the filter has full access to
    the artifact for basing decisions.
  
  Revision  Changes    Path
  1.10      +7 -3      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
  
  Index: DefaultArtifact.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultArtifact.java	9 Mar 2005 05:48:30 -0000	1.9
  +++ DefaultArtifact.java	14 Mar 2005 07:24:23 -0000	1.10
  @@ -46,14 +46,18 @@
       /**
        * @todo this should be replaced by type handler
        */
  -    public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type,
  -                            String extension )
  +    public DefaultArtifact( String groupId, String artifactId, String version, String scope, String type, String extension )
       {
           this.groupId = groupId;
  +
           this.artifactId = artifactId;
  +
           this.version = version;
  +
           this.type = type;
  +
           this.scope = scope;
  +
           this.extension = extension;
       }
   
  
  
  
  1.16      +1 -1      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
  
  Index: DefaultArtifactResolver.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DefaultArtifactResolver.java	9 Mar 2005 05:48:30 -0000	1.15
  +++ DefaultArtifactResolver.java	14 Mar 2005 07:24:23 -0000	1.16
  @@ -212,7 +212,7 @@
                       // It's the first time we have encountered this artifact
                       // ----------------------------------------------------------------------
   
  -                    if ( filter != null && !filter.include( newArtifact.getArtifactId() ) )
  +                    if ( filter != null && !filter.include( newArtifact ) )
                       {
                           continue;
                       }
  
  
  
  1.2       +6 -2      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter/ArtifactFilter.java
  
  Index: ArtifactFilter.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter/ArtifactFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ArtifactFilter.java	6 Oct 2004 01:57:59 -0000	1.1
  +++ ArtifactFilter.java	14 Mar 2005 07:24:23 -0000	1.2
  @@ -1,5 +1,7 @@
   package org.apache.maven.artifact.resolver.filter;
   
  +import org.apache.maven.artifact.Artifact;
  +
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -22,5 +24,7 @@
    */
   public interface ArtifactFilter
   {
  -    boolean include( String artifactId );
  +    //TODO(JVZ): change the signature of this to filter(Artifact) where the meaning of filter is
  +    // to exclude. I did this backward and it's confusing.
  +    boolean include( Artifact artifact );
   }
  
  
  
  1.2       +5 -3      maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java
  
  Index: ExclusionSetFilter.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/filter/ExclusionSetFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExclusionSetFilter.java	6 Oct 2004 01:57:59 -0000	1.1
  +++ ExclusionSetFilter.java	14 Mar 2005 07:24:23 -0000	1.2
  @@ -16,6 +16,8 @@
    * limitations under the License.
    */
   
  +import org.apache.maven.artifact.Artifact;
  +
   import java.util.Arrays;
   import java.util.HashSet;
   import java.util.Set;
  @@ -39,9 +41,9 @@
           this.excludes = excludes;
       }
   
  -    public boolean include( String artifactId )
  +    public boolean include( Artifact artifact )
       {
  -        if ( excludes.contains( artifactId ) )
  +        if ( excludes.contains( artifact.getArtifactId() ) )
           {
               return false;
           }