werken 2002/06/27 18:59:35
Modified: . project-ng.xml
src/java/org/apache/maven/project Build.java Project.java
src/plugins/core plugin.jelly
src/plugins/test plugin.jelly
Added: src/java/org/apache/maven/project Resources.java
UnitTest.java
Log:
* Reworked include/exclude for both unit-test patterns and
resources.
Revision Changes Path
1.11 +12 -8 jakarta-turbine-maven/project-ng.xml
Index: project-ng.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/project-ng.xml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- project-ng.xml 27 Jun 2002 21:13:20 -0000 1.10
+++ project-ng.xml 28 Jun 2002 01:59:35 -0000 1.11
@@ -515,9 +515,11 @@
<aspectSourceDirectory></aspectSourceDirectory>
<!-- Unit test classes -->
- <unitTestPatterns>
- <unitTestPattern>**/*Test.java</unitTestPattern>
- </unitTestPatterns>
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </unitTest>
<!-- Integration unit test classes -->
<integrationUnitTestPatterns>
@@ -526,11 +528,13 @@
<!-- J A R R E S O U R C E S -->
<!-- Resources that are packaged up inside the JAR file -->
- <jarResources>
- <jarResource>include = *.dtd</jarResource>
- <jarResource>include = log4j.properties</jarResource>
- <jarResource>include = maven-taskdefs.properties</jarResource>
- </jarResources>
+ <resources>
+ <includes>
+ <include>*.dtd</include>
+ <include>log4j.properties</include>
+ <include>maven-taskdefs.properties</include>
+ </includes>
+ </resources>
<jars>
</jars>
1.10 +35 -1
jakarta-turbine-maven/src/java/org/apache/maven/project/Build.java
Index: Build.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Build.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Build.java 21 Jun 2002 04:17:29 -0000 1.9
+++ Build.java 28 Jun 2002 01:59:35 -0000 1.10
@@ -119,6 +119,12 @@
*/
private String nagEmailAddress;
+ /** Unit test specification patterns. */
+ private UnitTest unitTest;
+
+ /** Jar resources. */
+ private Resources resources;
+
/**
* Constructor for the Build object
*/
@@ -319,5 +325,33 @@
public String getNagEmailAddress()
{
return nagEmailAddress;
+ }
+
+ /**
+ * Add a set of unit test patterns.
+ */
+ public void setUnitTest(UnitTest unitTest)
+ {
+ this.unitTest = unitTest;
+ }
+
+ /**
+ * Retrieve the unit test patterns.
+ *
+ * @return The unit test patterns.
+ */
+ public UnitTest getUnitTest()
+ {
+ return this.unitTest;
+ }
+
+ public void setResources(Resources resources)
+ {
+ this.resources = resources;
+ }
+
+ public Resources getResources()
+ {
+ return this.resources;
}
}
1.30 +1 -2
jakarta-turbine-maven/src/java/org/apache/maven/project/Project.java
Index: Project.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Project.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- Project.java 19 Jun 2002 01:49:15 -0000 1.29
+++ Project.java 28 Jun 2002 01:59:35 -0000 1.30
@@ -175,7 +175,6 @@
* with the distribution objects.
*/
private HashMap versionMap;
-
/**
* Default constructor.
1.1
jakarta-turbine-maven/src/java/org/apache/maven/project/Resources.java
Index: Resources.java
===================================================================
package org.apache.maven.project;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.util.List;
import java.util.ArrayList;
/** Patterns for including or excluding arbitrary resources.
*
* @author <a href="mailto:[EMAIL PROTECTED]">bob mcwhirter</a>
*/
public class Resources
{
/** Inlcude patterns. */
private List includes;
/** Exclude patterns. */
private List excludes;
/** Construct.
*/
public Resources()
{
this.includes = new ArrayList();
this.excludes = new ArrayList();
}
/** Add an include pattern.
*
* @param pattern The include pattern.
*/
public void addInclude(String pattern)
{
this.includes.add( pattern );
}
/** Add an exclude pattern.
*
* @param pattern The exclude pattern.
*/
public void addExclude(String pattern)
{
this.excludes.add( pattern );
}
/** Retrieve a list of include patterns.
*
* @return The list of include patterns.
*/
public List getIncludes()
{
return this.includes;
}
/** Retrieve a list of exclude patterns.
*
* @return The list of exclude patterns.
*/
public List getExcludes()
{
return this.excludes;
}
}
1.1
jakarta-turbine-maven/src/java/org/apache/maven/project/UnitTest.java
Index: UnitTest.java
===================================================================
package org.apache.maven.project;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Maven" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Maven", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* ====================================================================
*/
import java.util.List;
import java.util.ArrayList;
/** Collects unit-test include and exclude patterns.
*
* @author <a href="mailto:[EMAIL PROTECTED]">bob mcwhirter</a>
*/
public class UnitTest extends Resources
{
}
1.3 +8 -2 jakarta-turbine-maven/src/plugins/core/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins/core/plugin.jelly,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- plugin.jelly 28 Jun 2002 01:54:13 -0000 1.2
+++ plugin.jelly 28 Jun 2002 01:59:35 -0000 1.3
@@ -7,6 +7,12 @@
</path>
<patternset id="maven.jar.resources.set">
+ <j:forEach var="res" items="${pom.build.resources.include}">
+ <include name="${res}"/>
+ </j:forEach>
+ <j:forEach var="res" items="${pom.build.resources.exclude}">
+ <exclude name="${res}"/>
+ </j:forEach>
</patternset>
<path id="maven.dependency.classpath">
@@ -82,8 +88,8 @@
-->
<echo>
- Copy resources into destination directory for deployment
- in the JAR.
+ Copy resources into destination directory
+ for deployment in the JAR.
</echo>
<copy todir="${maven.build.dest}">
1.2 +5 -11 jakarta-turbine-maven/src/plugins/test/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins/test/plugin.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- plugin.jelly 28 Jun 2002 01:02:19 -0000 1.1
+++ plugin.jelly 28 Jun 2002 01:59:35 -0000 1.2
@@ -1,15 +1,13 @@
<project xmlns:j="jelly:core">
-<!--
- <patternset id="maven.unit.test.set"
- includes="${pom.build.unitTestPatterns.get(0)}"/>
--->
-
<patternset id="maven.unit.test.set">
- <j:forEach var="pat" items="${pom.build.unitTestPatterns}">
+ <j:forEach var="pat" items="${pom.build.unitTest.includes}">
<include name="${pat}"/>
</j:forEach>
+ <j:forEach var="pat" items="${pom.build.unitTest.excludes}">
+ <exclude name="${pat}"/>
+ </j:forEach>
</patternset>
<goal name="maven:test.prepare-filesystem">
@@ -39,11 +37,7 @@
<goal name="maven:test"
prereqs="maven:compile-test">
-<!--
- <echo>
- Running all JUnit tests in ${pom.build.unitTestSourceDirectory}
- </echo>
--->
+
<junit printSummary="yes"
failureProperty="maven.test.failure"
fork="${maven.junit.fork}"
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>