svn commit: r718542 - in /ant/core/trunk/src/main/org/apache/tools/ant/types/resources: ContentTransformingResource.java MappedResource.java ResourceDecorator.java

2008-11-18 Thread bodewig
Author: bodewig
Date: Tue Nov 18 02:10:57 2008
New Revision: 718542

URL: http://svn.apache.org/viewvc?rev=718542&view=rev
Log:
extract a common base class for resource decorators

Added:

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ResourceDecorator.java
   (with props)
Modified:

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java

ant/core/trunk/src/main/org/apache/tools/ant/types/resources/MappedResource.java

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java?rev=718542&r1=718541&r2=718542&view=diff
==
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/ContentTransformingResource.java
 Tue Nov 18 02:10:57 2008
@@ -22,8 +22,6 @@
 import java.io.OutputStream;
 
 import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Resource;
-import org.apache.tools.ant.types.Reference;
 import org.apache.tools.ant.types.ResourceCollection;
 import org.apache.tools.ant.util.FileUtils;
 
@@ -36,12 +34,10 @@
  *
  * @since Ant 1.8
  */
-public abstract class ContentTransformingResource extends Resource {
+public abstract class ContentTransformingResource extends ResourceDecorator {
 
 private static final int BUFFER_SIZE = 8192;
 
-private Resource resource;
-
 /** no arg constructor */
 public ContentTransformingResource() {
 }
@@ -51,91 +47,7 @@
  * @param other the resource to wrap.
  */
 public ContentTransformingResource(ResourceCollection other) {
-addConfigured(other);
-}
-
-/**
- * Sets the resource to wrap using a single-element collection.
- * @param a the resource to wrap as a single element Resource collection.
- */
-public void addConfigured(ResourceCollection a) {
-checkChildrenAllowed();
-if (resource != null) {
-throw new BuildException("you must not specify more than one 
resource");
-}
-if (a.size() != 1) {
-throw new BuildException("only single argument resource 
collections are supported");
-}
-resource = (Resource) a.iterator().next();
-}
-
-/**
- * Get the name of the resource.
- * @return the name of the wrapped resource.
- */
-public String getName() {
-return getResource().getName();
-}
-
-/**
- * Overridden, not allowed to set the name of the resource.
- * @param name not used.
- * @throws BuildException always.
- */
-public void setName(String name) throws BuildException {
-throw new BuildException("you can't change the name of a " + 
getDataTypeName());
-}
-
-/**
- * The exists attribute tells whether a file exists.
- * @return true if this resource exists.
- */
-public boolean isExists() {
-return getResource().isExists();
-}
-
-/**
- * Set the exists attribute.
- * @param exists if true, this resource exists.
- */
-public void setExists(boolean exists) {
-throw new BuildException("you can't change the exists state of a " + 
getDataTypeName());
-}
-
-/**
- * Tells the modification time in milliseconds since 01.01.1970 .
- *
- * @return 0 if the resource does not exist to mirror the behavior
- * of [EMAIL PROTECTED] java.io.File File}.
- */
-public long getLastModified() {
-return getResource().getLastModified();
-}
-
-/**
- * Override setLastModified.
- * @param lastmodified not used.
- * @throws BuildException always.
- */
-public void setLastModified(long lastmodified) throws BuildException {
-throw new BuildException("you can't change the timestamp of a " + 
getDataTypeName());
-}
-
-/**
- * Tells if the resource is a directory.
- * @return boolean flag indicating if the resource is a directory.
- */
-public boolean isDirectory() {
-return getResource().isDirectory();
-}
-
-/**
- * Override setDirectory.
- * @param directory not used.
- * @throws BuildException always.
- */
-public void setDirectory(boolean directory) throws BuildException {
-throw new BuildException("you can't change the directory state of a " 
+ getDataTypeName());
+super(other);
 }
 
 /**
@@ -167,40 +79,6 @@
 }
 
 /**
- * Override setSize.
- * @param size not used.
- * @throws BuildException always.
- */
-public void setSize(long size) throws BuildException {
-throw new BuildException("you can't change the size of a " + 
getDataTypeName());
-}
-
-/**
- * Delegates to a comparison of

svn commit: r718551 - in /ant/antlibs/antunit/trunk: changes.xml src/main/org/apache/ant/antunit/AssertionFailedException.java src/main/org/apache/ant/antunit/ExpectFailureTask.java

2008-11-18 Thread gscokart
Author: gscokart
Date: Tue Nov 18 02:58:47 2008
New Revision: 718551

URL: http://svn.apache.org/viewvc?rev=718551&view=rev
Log:
expectfailure report the original build exception chained when failing

Modified:
ant/antlibs/antunit/trunk/changes.xml

ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AssertionFailedException.java

ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/ExpectFailureTask.java

Modified: ant/antlibs/antunit/trunk/changes.xml
URL: 
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/changes.xml?rev=718551&r1=718550&r2=718551&view=diff
==
--- ant/antlibs/antunit/trunk/changes.xml (original)
+++ ant/antlibs/antunit/trunk/changes.xml Tue Nov 18 02:58:47 2008
@@ -37,6 +37,12 @@
 Apache AntUnit
   
 
+  
+
+  expectfailure report the original build exception chained when failing
+
+  
+  
   
 
   assertFileExists example wrong, should use @file instead of @name

Modified: 
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AssertionFailedException.java
URL: 
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AssertionFailedException.java?rev=718551&r1=718550&r2=718551&view=diff
==
--- 
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AssertionFailedException.java
 (original)
+++ 
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/AssertionFailedException.java
 Tue Nov 18 02:58:47 2008
@@ -38,4 +38,8 @@
 public AssertionFailedException(String message, Location loc) {
 super(message, loc);
 }
+
+public AssertionFailedException(String message, BuildException e) {
+super(message , e);
+}
 }

Modified: 
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/ExpectFailureTask.java
URL: 
http://svn.apache.org/viewvc/ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/ExpectFailureTask.java?rev=718551&r1=718550&r2=718551&view=diff
==
--- 
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/ExpectFailureTask.java
 (original)
+++ 
ant/antlibs/antunit/trunk/src/main/org/apache/ant/antunit/ExpectFailureTask.java
 Tue Nov 18 02:58:47 2008
@@ -66,9 +66,9 @@
 + "with message '"
 + expectedMessage
 + "' but was '"
-+ caughtMessage + "'");
++ caughtMessage + "'" , e);
 } else {
-throw new AssertionFailedException(message);
+throw new AssertionFailedException(message, e);
 }
 }
 }




DO NOT REPLY [Bug 46228] New: includesfile is case sensitive

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46228

   Summary: includesfile is case sensitive
   Product: Ant
   Version: 1.7.0
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: Core tasks
AssignedTo: notifications@ant.apache.org
ReportedBy: [EMAIL PROTECTED]







Parameter includesfile does case sensitive matching on Windows, which is bad,
because Windows filesystems are not case sensitive.

It's bad, because  is NOT case sensitive and it leads to
inconsistency.

I have a task, wchich checks all the includes.lst entries for existence using
 (in a for loop). The check has passed, but some of files were not
copied, because the actual directory name was different than in includes.lst.

Another solution would be to add "casesensitive" option to .


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 46228] includesfile is case sensitive

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46228


Stefan Bodewig <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Comment #1 from Stefan Bodewig <[EMAIL PROTECTED]>  2008-11-18 04:49:08 PST 
---
filesets are case sensitive, no matter how you specify the patterns.  This
behavior is by design and it is documented.

Use fileset's casesensitive attribute and set it to false, no reason to fiddle
with available.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


svn commit: r718633 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTypes/resources.html src/tests/antunit/taskdefs/war-test.xml

2008-11-18 Thread bodewig
Author: bodewig
Date: Tue Nov 18 07:24:38 2008
New Revision: 718633

URL: http://svn.apache.org/viewvc?rev=718633&view=rev
Log:
document mappedresources

Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/CoreTypes/resources.html
ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=718633&r1=718632&r2=718633&view=diff
==
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Nov 18 07:24:38 2008
@@ -534,6 +534,11 @@
operating systems repsectively.
Bugzilla Report 7624.
 
+ * a new resource collection  generalizes the prefix
+   and fullpath attributes of  to arbitrary mappers that
+   can be applied to arbitrary resource collections.
+   Bugzilla Report 4240.
+
 Changes from Ant 1.7.0 TO Ant 1.7.1
 =
 

Modified: ant/core/trunk/docs/manual/CoreTypes/resources.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTypes/resources.html?rev=718633&r1=718632&r2=718633&view=diff
==
--- ant/core/trunk/docs/manual/CoreTypes/resources.html (original)
+++ ant/core/trunk/docs/manual/CoreTypes/resources.html Tue Nov 18 07:24:38 2008
@@ -346,6 +346,9 @@
 of nested resource collections
   difference - set difference
 of nested resource collections
+  mappedresources - generic
+resource collection wrapper that maps the names of the nested
+resources using a mapper.
 
 resources
 A generic resource collection, designed for use with
@@ -1017,7 +1020,60 @@
   
 
 
+mappedresources
 
+Wraps another resource collection and maps the names of the nested
+  resources using a mapper.
+
+Even if mappedresources wraps a resource collection that
+  consists of file-system based resources, mappedresources
+  will not appear to be file-system based.  This means you can't
+  use mappedresources with tasks that only allow file-system
+  based resources.
+
+mappedresources doesn't support any attributes.
+
+
+  Parameters specified as nested elements
+  A single resource collection is required.
+  A single mapper can be used to map
+names.  If no mapper has been given (which doesn't make any sense,
+honestly), an identity mapper will be used.
+
+  Examples
+
+  Copies all files from a given directory to a target directory
+adding ".bak" as an extension.  Note this could be done with a
+mapper nested into copy directly as well.
+
+  
+
+  
+
+
+  
+
+  
+
+  Creates a WAR archive adding all CLASSPATH entries that are files
+to the WEB-INF/lib directory without keeping their
+files-system structure.
+
+  
+
+  
+
+  
+  
+
+
+  
+  
+
+  
+
+  
+
 
 
 

Modified: ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml?rev=718633&r1=718632&r2=718633&view=diff
==
--- ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/war-test.xml Tue Nov 18 07:24:38 
2008
@@ -168,4 +168,22 @@
 
   
 
+  
+
+
+
+  
+
+  
+  
+
+
+  
+  
+
+  
+
+
+
+  
 




DO NOT REPLY [Bug 4240] create a resource collection that uses a nested mapper

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=4240


Stefan Bodewig <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #11 from Stefan Bodewig <[EMAIL PROTECTED]>  2008-11-18 07:25:18 
PST ---
after some refactorings and documentation it's time to close this with svn
revision 718633 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=718633 )


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.


[jira] Created: (IVYDE-133) The decorators can throw a NPE at startup

2008-11-18 Thread JIRA
The decorators can throw a NPE at startup
-

 Key: IVYDE-133
 URL: https://issues.apache.org/jira/browse/IVYDE-133
 Project: IvyDE
  Issue Type: Bug
Affects Versions: 2.0
Reporter: Nicolas Lalevée
Assignee: Nicolas Lalevée
Priority: Minor


When launching Eclipse, and if there are some failing resolve job, a NPE can be 
raised:
{noformat}
java.lang.NullPointerException
at 
org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.setConfStatus(IvyClasspathContainerConfiguration.java:329)
at 
org.apache.ivyde.eclipse.cpcontainer.IvyClasspathContainerConfiguration.getModuleDescriptor(IvyClasspathContainerConfiguration.java:634)
at 
org.apache.ivyde.eclipse.cpcontainer.IvyResolveJob.run(IvyResolveJob.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
{noformat}

This may be due to the way the decorator listeners are accessed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



DO NOT REPLY [Bug 46230] New: apt task should respect "executable" attribute

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46230

   Summary: apt task should respect "executable" attribute
   Product: Ant
   Version: 1.7.0
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Core tasks
AssignedTo: notifications@ant.apache.org
ReportedBy: [EMAIL PROTECTED]


The  task can take a "executable" attribute to use a javac that is not
in the path.  The  task should be able to do this same thing.  Thanks.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 46236] New: BigProjectLogger breaks basedir calculations

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46236

   Summary: BigProjectLogger breaks basedir calculations
   Product: Ant
   Version: 1.7.1
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: major
  Priority: P2
 Component: Build Process
AssignedTo: notifications@ant.apache.org
ReportedBy: [EMAIL PROTECTED]


tmp$ cat bigprojectlogger.xml 



tmp$ cat sub/bigprojectlogger.xml 


Running in: ${basedir}


tmp$ ant -f bigprojectlogger.xml
Buildfile: bigprojectlogger.xml

run:
Running in: /tmp/sub

BUILD SUCCESSFUL
Total time: 0 seconds
tmp$ ant -f bigprojectlogger.xml -logger
org.apache.tools.ant.listener.BigProjectLogger
Buildfile: bigprojectlogger.xml

==
Entering project 
In /tmp
==

run:
Running in: /tmp

==
Exiting project 
==

BUILD SUCCESSFUL - at 11/18/08 8:34 PM
Total time: 0 seconds
tmp$ ant -f bigprojectlogger.xml -listener
org.apache.tools.ant.listener.BigProjectLogger
Buildfile: bigprojectlogger.xml

BUILD FAILED
java.lang.NullPointerException
at
org.apache.tools.ant.DefaultLogger.printMessage(DefaultLogger.java:339)
at
org.apache.tools.ant.listener.BigProjectLogger.subBuildStarted(BigProjectLogger.java:124)
at
org.apache.tools.ant.listener.BigProjectLogger.buildStarted(BigProjectLogger.java:80)
at org.apache.tools.ant.Project.fireBuildStarted(Project.java:2020)
at org.apache.tools.ant.Main.runBuild(Main.java:706)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 0 seconds
java.lang.NullPointerException
at
org.apache.tools.ant.DefaultLogger.printMessage(DefaultLogger.java:339)
at
org.apache.tools.ant.listener.BigProjectLogger.subBuildFinished(BigProjectLogger.java:152)
at
org.apache.tools.ant.listener.BigProjectLogger.buildFinished(BigProjectLogger.java:89)
at org.apache.tools.ant.Project.fireBuildFinished(Project.java:2037)
at org.apache.tools.ant.Main.runBuild(Main.java:778)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
tmp$


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 46236] BigProjectLogger breaks basedir calculations

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=46236


Stefan Bodewig <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE
   Target Milestone|--- |1.8.0




--- Comment #1 from Stefan Bodewig <[EMAIL PROTECTED]>  2008-11-18 20:45:10 PST 
---


*** This bug has been marked as a duplicate of bug 45607 ***


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.


DO NOT REPLY [Bug 45607] BigProjectLogger screws up basedir.

2008-11-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45607


Stefan Bodewig <[EMAIL PROTECTED]> changed:

   What|Removed |Added

 CC||[EMAIL PROTECTED]




--- Comment #3 from Stefan Bodewig <[EMAIL PROTECTED]>  2008-11-18 20:45:10 PST 
---
*** Bug 46236 has been marked as a duplicate of this bug. ***


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.