vmassol 2003/06/13 05:24:36 Modified: src/conf driver.jelly src/java/org/apache/maven/project Resource.java src/xsd maven-project.xsd Added: src/plugins-build/examples/simple-filtering .cvsignore maven.xml project.xml src/plugins-build/examples/simple-filtering/src/conf test-nofilter.properties test.properties src/plugins-build/examples/simple-filtering/src/java/org/apache/maven/examples/simplefiltering SimpleJava.java xdocs changes.xml Log: Added support for resource filtering. Note: It's not fully working yet but shouldn't impact anything. Revision Changes Path 1.12 +1 -2 maven/src/conf/driver.jelly Index: driver.jelly =================================================================== RCS file: /home/cvs/maven/src/conf/driver.jelly,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- driver.jelly 4 May 2003 23:43:28 -0000 1.11 +++ driver.jelly 13 Jun 2003 12:24:35 -0000 1.12 @@ -55,7 +55,6 @@ <define:tag name="copy"> <j:forEach var="resource" items="${resources}"> - <j:set var="resourceDirectoryPresent" value="false"/> <util:available file="${resource.directory}"> @@ -72,7 +71,7 @@ </j:otherwise> </j:choose> <copy todir="${targetDirectory}"> - <fileset dir="${resource.directory}"> + <fileset dir="${resource.directory}" filtering="${resource.filtering}"> <j:if test="${resources.includes.isEmpty()}"> <include name="**/**"/> </j:if> 1.9 +23 -2 maven/src/java/org/apache/maven/project/Resource.java Index: Resource.java =================================================================== RCS file: /home/cvs/maven/src/java/org/apache/maven/project/Resource.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Resource.java 12 Apr 2003 00:02:03 -0000 1.8 +++ Resource.java 13 Jun 2003 12:24:35 -0000 1.9 @@ -78,6 +78,11 @@ /** Exclude patterns. */ private List excludes = new ArrayList(); + /** + * Is filtering on? + */ + private boolean isFiltering = false; + /** * Add an include pattern. * @@ -155,11 +160,27 @@ */ public String getTargetPath() { - return targetPath; + return this.targetPath; } public String toString() { - return "[dir = " + dir + "]"; + return "[dir = " + this.dir + "]"; } + + /** + * @param filtering specifies whether filtering is active or not + */ + public void setFiltering( boolean isFiltering ) + { + this.isFiltering = isFiltering; + } + + /** + * @return whether filtering is on or off + */ + public boolean getFiltering() + { + return this.isFiltering; + } } 1.28 +4 -4 maven/src/xsd/maven-project.xsd Index: maven-project.xsd =================================================================== RCS file: /home/cvs/maven/src/xsd/maven-project.xsd,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- maven-project.xsd 11 Jun 2003 22:30:45 -0000 1.27 +++ maven-project.xsd 13 Jun 2003 12:24:35 -0000 1.28 @@ -368,14 +368,14 @@ <xs:complexType> <xs:sequence> <!-- FIXME: I think that this defaults to basedir, need a check --> - <xs:element ref="directory" minOccurs="0" /> - <xs:element ref="targetPath" minOccurs="0" /> + <xs:element ref="directory" minOccurs="0"/> + <xs:element ref="targetPath" minOccurs="0"/> <xs:element ref="includes" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="excludes" minOccurs="0" maxOccurs="unbounded"/> + <xs:element ref="filtering" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType> - </xs:element> - + </xs:element> <xs:element name="reports"> <xs:complexType> 1.1 maven/src/plugins-build/examples/simple-filtering/.cvsignore Index: .cvsignore =================================================================== maven.log target lib velocity.log 1.1 maven/src/plugins-build/examples/simple-filtering/maven.xml Index: maven.xml =================================================================== <project xmlns:j="jelly:core" xmlns:ant="jelly:ant"> <preGoal name="java:jar-resources"> <echo>Creating filters...</echo> <ant:filter token="testFilter" value="it worked!"/> </preGoal> </project> 1.1 maven/src/plugins-build/examples/simple-filtering/project.xml Index: project.xml =================================================================== <?xml version="1.0" encoding="ISO-8859-1"?> <project> <!-- the version of maven's project object model --> <pomVersion>3</pomVersion> <!-- a unique name for this project --> <id>maven-examples-simple-filtering</id> <!-- a short but descriptive name for the project --> <name>Simple Filtering</name> <!-- The version of the project under development, e.g. 1.1, 1.2, 2.0-dev --> <currentVersion>1.0-SNAPSHOT</currentVersion> <!-- details about the organization that 'owns' the project --> <organization> <name>Apache Software Foundation</name> <url>http://jakarta.apache.org/</url> </organization> <!-- the year the project started --> <inceptionYear>2002</inceptionYear> <!-- the top level of java packages that this project defines e.g. if your project contains the packages com.mycompany.accounts.reports, com.mycompany.accounts.reports and com.mycompany.accounts.utils, the package would be 'com.mycompany.accounts' --> <package>org.apache.maven.examples.simplefiltering</package> <!-- a short description of what the project does --> <shortDescription>A simple project showing filtering of resources</shortDescription> <!-- the project home page --> <url>http://maven.apache.org/</url> <!-- the version control repository and http url for online access the connection element has the form: scm:<system>:<system specific connection string> --> <repository> <connection>scm:cvs:pserver:[EMAIL PROTECTED]:/home/cvspublic:maven</connection> <url>http://cvs.apache.org/viewcvs/maven/</url> </repository> <!-- any mailing lists for the project --> <mailingLists/> <!-- who the developers are for the project --> <developers /> <!-- jar files the project is dependent on --> <dependencies/> <!-- build information for the project --> <build> <sourceDirectory>src/java</sourceDirectory> <resources> <resource> <filtering>true</filtering> <directory>src/conf</directory> <includes> <include>test.properties</include> </includes> </resource> <resource> <directory>src/conf</directory> <includes> <include>test-nofilter.properties</include> </includes> </resource> </resources> </build> </project> 1.1 maven/src/plugins-build/examples/simple-filtering/src/conf/test-nofilter.properties Index: test-nofilter.properties =================================================================== # A simple config file that should not be filtered 1.1 maven/src/plugins-build/examples/simple-filtering/src/conf/test.properties Index: test.properties =================================================================== # A simple config file with an Ant filter test.property = @testFilter@ 1.1 maven/src/plugins-build/examples/simple-filtering/src/java/org/apache/maven/examples/simplefiltering/SimpleJava.java Index: SimpleJava.java =================================================================== package org.apache.maven.examples.simplejava; /** * A really simple java class * @author dIon */ public class SimpleJava { /** * Print a message * @param args unused */ public static void main(String[] args) { System.out.println("Hello from Maven's SimpleFiltering"); } } 1.11 +18 -35 maven/xdocs/changes.xml
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]