maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources ResourcesMojo.java
Date Tue, 22 Mar 2005 14:26:28 GMT
brett       2005/03/22 06:26:28

  Modified:    maven-core/src/test/resources/projects/base-directory-alignment
                        project-which-needs-directory-alignment.xml
               maven-core-it/it0015 pom.xml
               maven-model maven.mdo
               maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources
                        ResourcesMojo.java
  Log:
  revert <includes> and <excludes> in MDO to old format
  
  Revision  Changes    Path
  1.6       +14 -3     maven-components/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml
  
  Index: project-which-needs-directory-alignment.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/test/resources/projects/base-directory-alignment/project-which-needs-directory-alignment.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project-which-needs-directory-alignment.xml	10 Mar 2005 01:35:16 -0000	1.5
  +++ project-which-needs-directory-alignment.xml	22 Mar 2005 14:26:28 -0000	1.6
  @@ -89,18 +89,29 @@
       <resources>
         <resource>
           <directory>src/test</directory>
  -        <includes>**/*.xml</includes>
  +        <includes>
  +          <include>**/*.xml</include>
  +        </includes>
         </resource>
       </resources>
       <testResources>
         <testResource>
           <directory>src/conf</directory>
  -        <includes>*.xsd,*.dtd,*.mod,log4j.properties,driver.jelly,driver.properties</includes>
  +        <includes>
  +          <include>*.xsd</include>
  +          <include>*.dtd</include>
  +          <include>*.mod</include>
  +          <include>log4j.properties</include>
  +          <include>driver.jelly</include>
  +          <include>driver.properties</include>
  +        </includes>
         </testResource>
         <testResource>
           <directory>src/messages</directory>
           <targetPath>org/apache/maven/messages</targetPath>
  -        <includes>messages*.properties</includes>
  +        <includes>
  +          <include>messages*.properties</include>
  +        </includes>
         </testResource>
       </testResources>
     </build>
  
  
  
  1.7       +3 -1      maven-components/maven-core-it/it0015/pom.xml
  
  Index: pom.xml
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core-it/it0015/pom.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- pom.xml	15 Mar 2005 22:31:54 -0000	1.6
  +++ pom.xml	22 Mar 2005 14:26:28 -0000	1.7
  @@ -34,7 +34,9 @@
         </resource>
         <resource>
           <directory>src/main/scripts</directory>
  -        <includes>**/*.mmld</includes>
  +        <includes>
  +          <include>**/*.mmld</include>
  +        </includes>
         </resource>
       </resources>
     </build>
  
  
  
  1.93      +2 -14     maven-components/maven-model/maven.mdo
  
  Index: maven.mdo
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-model/maven.mdo,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- maven.mdo	22 Mar 2005 10:46:55 -0000	1.92
  +++ maven.mdo	22 Mar 2005 14:26:28 -0000	1.93
  @@ -1443,7 +1443,7 @@
         <fields>
           <field>
             <name>includes</name>
  -          <version>3.0.0</version>
  +          <version>3.0.0+</version>
             <description><![CDATA[the description]]></description>
             <association>
               <type>String</type>
  @@ -1452,25 +1452,13 @@
           </field>
           <field>
             <name>excludes</name>
  -          <version>3.0.0</version>
  +          <version>3.0.0+</version>
             <description><![CDATA[the description]]></description>
             <association>
               <type>String</type>
               <multiplicity>*</multiplicity>
             </association>
           </field>
  -        <field>
  -          <name>includes</name>
  -          <version>4.0.0</version>
  -          <description><![CDATA[the description]]></description>
  -          <type>String</type>
  -        </field>
  -        <field>
  -          <name>excludes</name>
  -          <version>4.0.0</version>
  -          <description><![CDATA[the description]]></description>
  -          <type>String</type>
  -        </field>
         </fields>
         <codeSegments>
           <codeSegment>
  
  
  
  1.15      +17 -26    maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java
  
  Index: ResourcesMojo.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ResourcesMojo.java	22 Mar 2005 13:34:02 -0000	1.14
  +++ ResourcesMojo.java	22 Mar 2005 14:26:28 -0000	1.15
  @@ -20,6 +20,7 @@
   import org.apache.maven.plugin.AbstractPlugin;
   import org.apache.maven.plugin.PluginExecutionException;
   import org.codehaus.plexus.util.FileUtils;
  +import org.codehaus.plexus.util.StringUtils;
   
   import java.io.ByteArrayOutputStream;
   import java.io.File;
  @@ -103,22 +104,29 @@
               // If we only have a directory then we want to include
               // everything we can find within that path.
   
  -            String includes = resource.getIncludes();
  +            String includesAsString = "**/**";
   
  -            if ( includes == null || includes.length() == 0 )
  +            java.util.List includes = resource.getIncludes();
  +            if ( includes != null && includes.size() > 0 )
               {
  -                includes = "**/**";
  +                includesAsString = StringUtils.join( includes.iterator(), "," );
               }
   
  -            String excludes = resource.getExcludes();
  +            List excludes = resource.getExcludes();
   
  -            if ( excludes != null && excludes.length() > 0 )
  +            if ( excludes == null )
               {
  -                excludes += ",";
  +                excludes = resource.getDefaultExcludes();
  +            }
  +            else
  +            {
  +                excludes = new ArrayList( excludes );
  +                excludes.addAll( resource.getDefaultExcludes() );
               }
  -            excludes += listToString( resource.getDefaultExcludes() );
   
  -            List files = FileUtils.getFileNames( resourceDirectory, includes, excludes,
false );
  +            String excludesAsString = StringUtils.join( excludes.iterator(), "," );
  +
  +            List files = FileUtils.getFileNames( resourceDirectory, includesAsString, excludesAsString,
false );
   
               for ( Iterator j = files.iterator(); j.hasNext(); )
               {
  @@ -140,23 +148,6 @@
           return resourceEntries;
       }
   
  -    private String listToString( List list )
  -    {
  -        StringBuffer sb = new StringBuffer();
  -
  -        for ( int i = 0; i < list.size(); i++ )
  -        {
  -            sb.append( list.get( i ) );
  -
  -            if ( i != list.size() - 1 )
  -            {
  -                sb.append( "," );
  -            }
  -        }
  -
  -        return sb.toString();
  -    }
  -
       public static byte[] fileRead( String fileName )
           throws IOException
       {
  
  
  

Mime
View raw message