DO NOT REPLY [Bug 22428] - PATCH - option to run tasks inside a loop

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22428

PATCH - option to run tasks inside a loop





--- Additional Comments From [EMAIL PROTECTED]  2003-10-08 00:31 ---
test

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 22428] - PATCH - option to run tasks inside a loop

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22428

PATCH - option to run tasks inside a loop





--- Additional Comments From [EMAIL PROTECTED]  2003-10-08 00:34 ---
testing my email agains spam - please disconsider...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs MacroInstance.java

2003-10-08 Thread peterreilly
peterreilly2003/10/08 01:44:46

  Modified:src/main/org/apache/tools/ant/taskdefs MacroInstance.java
  Log:
  upgrade protected access to public for setMacroDef for macroinstance object
  
  Revision  ChangesPath
  1.7   +1 -1  
ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
  
  Index: MacroInstance.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MacroInstance.java23 Sep 2003 13:55:52 -  1.6
  +++ MacroInstance.java8 Oct 2003 08:44:46 -   1.7
  @@ -90,7 +90,7 @@
*
* @param macroDef a MacroDef value
*/
  -protected void setMacroDef(MacroDef macroDef) {
  +public void setMacroDef(MacroDef macroDef) {
   this.macroDef = macroDef;
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/src/main/org/apache/tools/ant/taskdefs MacroInstance.java

2003-10-08 Thread peterreilly
peterreilly2003/10/08 01:46:48

  Modified:src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
MacroInstance.java
  Log:
  upgrade protected access to public for setMacroDef for macroinstance object
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.5.2.2   +1 -1  
ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java
  
  Index: MacroInstance.java
  ===
  RCS file: 
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/MacroInstance.java,v
  retrieving revision 1.5.2.1
  retrieving revision 1.5.2.2
  diff -u -r1.5.2.1 -r1.5.2.2
  --- MacroInstance.java23 Sep 2003 13:56:44 -  1.5.2.1
  +++ MacroInstance.java8 Oct 2003 08:46:48 -   1.5.2.2
  @@ -90,7 +90,7 @@
*
* @param macroDef a MacroDef value
*/
  -protected void setMacroDef(MacroDef macroDef) {
  +public void setMacroDef(MacroDef macroDef) {
   this.macroDef = macroDef;
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Can´t understand message

2003-10-08 Thread Jan . Materne
When using -debug a message is printed when properties are set.
E.g.

  Setting ro project property: ant.version -> Apache Ant version 1...
  ^^

What should the "ro" mean?


oata.PropertyHelper.setUserProperty():line 406

public synchronized void setUserProperty(String ns, String name,
 Object value) {
project.log("Setting ro project property: " + name + " -> "
+ value, Project.MSG_DEBUG);
userProperties.put(name, value);




Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



AW: Can´t understand message

2003-10-08 Thread Antoine Lévy-Lambert
ro means probably readonly.
Antoine

-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet: Mittwoch, 8. Oktober 2003 14:03
An: [EMAIL PROTECTED]
Betreff: Can´t understand message


When using -debug a message is printed when properties are set.
E.g.

  Setting ro project property: ant.version -> Apache Ant version 1...
  ^^

What should the "ro" mean?


oata.PropertyHelper.setUserProperty():line 406

public synchronized void setUserProperty(String ns, String name,
 Object value) {
project.log("Setting ro project property: " + name + " -> "
+ value, Project.MSG_DEBUG);
userProperties.put(name, value);




Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Can´t understand message

2003-10-08 Thread Stefan Bodewig
On Wed, 8 Oct 2003, Jan Materne <[EMAIL PROTECTED]> wrote:

> What should the "ro" mean?

"read only"

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Can´t understand message

2003-10-08 Thread Adam Hardy
read-only?
On 10/08/2003 02:02 PM [EMAIL PROTECTED] wrote:
When using -debug a message is printed when properties are set.
E.g.
  Setting ro project property: ant.version -> Apache Ant version 1...
  ^^
What should the "ro" mean?
oata.PropertyHelper.setUserProperty():line 406
public synchronized void setUserProperty(String ns, String name,
 Object value) {
project.log("Setting ro project property: " + name + " -> "
+ value, Project.MSG_DEBUG);
userProperties.put(name, value);

Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
ant 1.6beta1 + java 1.4.2 on Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Can´t understand message

2003-10-08 Thread Phil Weighill-Smith
"Read-only"?

On Wed, 2003-10-08 at 13:02, [EMAIL PROTECTED] wrote:

> When using -debug a message is printed when properties are set.
> E.g.
> 
>   Setting ro project property: ant.version -> Apache Ant version 1...
>   ^^
> 
> What should the "ro" mean?
> 
> 
> oata.PropertyHelper.setUserProperty():line 406
> 
> public synchronized void setUserProperty(String ns, String name,
>  Object value) {
> project.log("Setting ro project property: " + name + " -> "
> + value, Project.MSG_DEBUG);
> userProperties.put(name, value);
> 
> 
> 
> 
> Jan
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Phil Weighill-Smith <[EMAIL PROTECTED]>
Volantis Systems


RE: Can´t understand message

2003-10-08 Thread Jan . Materne
ok, but all properties are "read-only".
So why
- delete that characters
or
- write that out?


Jan

> -Original Message-
> From: Phil Weighill-Smith [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 08, 2003 2:05 PM
> To: Ant Developers List
> Subject: Re: Can´t understand message
> 
> 
> "Read-only"?
> 
> On Wed, 2003-10-08 at 13:02, [EMAIL PROTECTED] wrote:
> 
> > When using -debug a message is printed when properties are set.
> > E.g.
> > 
> >   Setting ro project property: ant.version -> Apache Ant 
> version 1...
> >   ^^
> > 
> > What should the "ro" mean?
> > 
> > 
> > oata.PropertyHelper.setUserProperty():line 406
> > 
> > public synchronized void setUserProperty(String ns, String name,
> >  Object value) {
> > project.log("Setting ro project property: " + name + " -> "
> > + value, Project.MSG_DEBUG);
> > userProperties.put(name, value);
> > 
> > 
> > 
> > 
> > Jan
> > 
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -- 
> Phil Weighill-Smith <[EMAIL PROTECTED]>
> Volantis Systems
> 


Re: Can´t understand message

2003-10-08 Thread Stefan Bodewig
On Wed, 8 Oct 2003, Jan Materne <[EMAIL PROTECTED]> wrote:

> ok, but all properties are "read-only".

Not true.  setProperty will overwrite properties, but not the ones set
via setUserProperty (where the message comes from).  setNewProperty
won't overwrite an existing property, but they are writable in
general.

Stefan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can´t understand message

2003-10-08 Thread Jan . Materne
> > ok, but all properties are "read-only".
> 
> Not true.  setProperty will overwrite properties, but not the ones set
> via setUserProperty (where the message comes from).  setNewProperty
> won't overwrite an existing property, but they are writable in
> general.
> 
> Stefan


So I think writing that out would be better.
My first thought was a spell error "of" instead of "ro".


Jan


RE: failonerror; general solution

2003-10-08 Thread Jose Alberto Fernandez
Would it be easier for you to change antcontrib so it ships as
an ANTLIB, and then just get an agreement on ANT shipping a binary
distribution?

There would be no copyright involved in that case (since we are talking
about binaries). 

With that the only detail in ANTCORE would be whether we try to autoload
this tasks at 
startup or the user needs to enable them.

It seems like a good solution to me, this code is very stable and has
not change in a long time.

Jose Alberto

> -Original Message-
> From: Stefan Bodewig [mailto:[EMAIL PROTECTED] 
> Sent: 07 October 2003 16:46
> To: [EMAIL PROTECTED]
> Subject: Re: failonerror; general solution
> 
> 
> On Tue, 07 Oct 2003, Dale Anson <[EMAIL PROTECTED]> wrote:
> 
> > The source for ant-contrib's  has your name as 
> the author, 
> > so "them" is "you"??!
> 
> "I" am part of "them" and have already agreed to sign all 
> papers that are needed (if that is needed at all, given I've 
> already signed a couple of other papers with the ASF).
> 
> But there is one other author of that task who'd have to sign 
> a software-grant.
> 
> And there is the Ant-Contrib project as such.  The license 
> states that the Ant-Contrib project would hold the copyright, 
> whatever that could mean for a bunch of hackers having commit 
> access to a common CVS module at sourceforge (the project 
> legally isn't more than that).  I'd love to have clearance by 
> Matt and Curt before proceeding.
> 
> I'm not as eager to see the tasks in Ant proper as others, 
> that's why I haven't taken any initiative here (in Apache 
> speak, that's the difference between my +0 and the +1s that 
> have been cast by others).
> 
> Stefan
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/docs/manual develop.html

2003-10-08 Thread peterreilly
peterreilly2003/10/08 06:29:55

  Modified:docs/manual develop.html
  Log:
  attempt to describe the new add introspection rules
  
  Revision  ChangesPath
  1.14  +103 -1ant/docs/manual/develop.html
  
  Index: develop.html
  ===
  RCS file: /home/cvs/ant/docs/manual/develop.html,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- develop.html  17 Feb 2003 14:12:10 -  1.13
  +++ develop.html  8 Oct 2003 13:29:55 -   1.14
  @@ -188,7 +188,9 @@
   For the options 2 and 3, Ant has to create an instance of
   NestedInner before it can pass it to the task, this
   means, NestedInner must have a public no-arg
  -constructor.  This is the only difference between options 1 and 2.
  +  constructor or a public one-arg constructor
  +  taking a Project class as a parameter.
  +This is the only difference between options 1 and 2.
   
   The difference between 2 and 3 is what Ant has done to the object
   before it passes it to the method.  addInner will receive
  @@ -201,6 +203,106 @@
   the methods will be called, but we don't know which, this depends on
   the implementation of your Java virtual machine.
   
  +  Nested Types
  +If your task needs to nest an arbitary type that has been defined
  +  using  you have two options.
  +  
  +public void add(Type type)
  +public void addConfigured(Type type)
  +  
  +  The difference between 1 and 2 is the same as between 2 and 3 in the
  +  previous section.
  +  
  +For example suppose one wanted to handle objects object of type
  +org.apache.tools.ant.taskdefs.condition.Condition, one may
  +have a class:
  +  
  +  
  +  
  +public class MyTask extends Task {
  +private List conditions = new ArrayList();
  +public void add(Condition c) {
  +conditions.add(c);
  +}
  +public void execute() {
  + // iterator over the conditions
  +}
  +}
  +  
  +  
  +  
  +One may define and use this class like this:
  +  
  +  
  +
  +
  +
  +
  +
  +
  +
  +  
  +  
  +A more complicated example follows:
  +  
  +  
  +
  +public class Sample {
  +public static class MyFileSelector implements FileSelector {
  + public void setAttrA(int a) {}
  + public void setAttrB(int b) {}
  + public void add(Path path) {}
  + public boolean isSelected(File basedir, String filename, File file) 
{
  + return true;
  + }
  + }
  +
  +interface MyInterface {
  +void setVerbose(boolean val);
  +}
  +
  +public static class BuildPath extends Path {
  +public BuildPath(Project project) {
  +super(project);
  +}
  +
  +public void add(MyInterface inter) {}
  +public void setUrl(String url) {}
  +}
  +
  +public static class XInterface implements MyInterface {
  +public void setVerbose(boolean x) {}
  +public void setCount(int c) {}
  +}
  +}
  +
  +  
  +  
  +This class defines a number of static classes that implement/extend
  +Path, MyFileSelector and MyInterface. These may be defined and used
  +as follows:
  +  
  +  
  +
  +
  +
  +
  +
  +
  +   
  +  
  + 
  +
  + 
  +  
  +   
  +
  +
  +  
   TaskContainer
   
   The TaskContainer consists of a single method,
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: ant/docs/manual develop.html

2003-10-08 Thread peterreilly
peterreilly2003/10/08 06:33:24

  Modified:docs/manual Tag: ANT_16_BRANCH develop.html
  Log:
  attempt to describe the new add introspection rules
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.13.2.1  +103 -1ant/docs/manual/develop.html
  
  Index: develop.html
  ===
  RCS file: /home/cvs/ant/docs/manual/develop.html,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- develop.html  17 Feb 2003 14:12:10 -  1.13
  +++ develop.html  8 Oct 2003 13:33:24 -   1.13.2.1
  @@ -188,7 +188,9 @@
   For the options 2 and 3, Ant has to create an instance of
   NestedInner before it can pass it to the task, this
   means, NestedInner must have a public no-arg
  -constructor.  This is the only difference between options 1 and 2.
  +  constructor or a public one-arg constructor
  +  taking a Project class as a parameter.
  +This is the only difference between options 1 and 2.
   
   The difference between 2 and 3 is what Ant has done to the object
   before it passes it to the method.  addInner will receive
  @@ -201,6 +203,106 @@
   the methods will be called, but we don't know which, this depends on
   the implementation of your Java virtual machine.
   
  +  Nested Types
  +If your task needs to nest an arbitary type that has been defined
  +  using  you have two options.
  +  
  +public void add(Type type)
  +public void addConfigured(Type type)
  +  
  +  The difference between 1 and 2 is the same as between 2 and 3 in the
  +  previous section.
  +  
  +For example suppose one wanted to handle objects object of type
  +org.apache.tools.ant.taskdefs.condition.Condition, one may
  +have a class:
  +  
  +  
  +  
  +public class MyTask extends Task {
  +private List conditions = new ArrayList();
  +public void add(Condition c) {
  +conditions.add(c);
  +}
  +public void execute() {
  + // iterator over the conditions
  +}
  +}
  +  
  +  
  +  
  +One may define and use this class like this:
  +  
  +  
  +
  +
  +
  +
  +
  +
  +
  +  
  +  
  +A more complicated example follows:
  +  
  +  
  +
  +public class Sample {
  +public static class MyFileSelector implements FileSelector {
  + public void setAttrA(int a) {}
  + public void setAttrB(int b) {}
  + public void add(Path path) {}
  + public boolean isSelected(File basedir, String filename, File file) 
{
  + return true;
  + }
  + }
  +
  +interface MyInterface {
  +void setVerbose(boolean val);
  +}
  +
  +public static class BuildPath extends Path {
  +public BuildPath(Project project) {
  +super(project);
  +}
  +
  +public void add(MyInterface inter) {}
  +public void setUrl(String url) {}
  +}
  +
  +public static class XInterface implements MyInterface {
  +public void setVerbose(boolean x) {}
  +public void setCount(int c) {}
  +}
  +}
  +
  +  
  +  
  +This class defines a number of static classes that implement/extend
  +Path, MyFileSelector and MyInterface. These may be defined and used
  +as follows:
  +  
  +  
  +
  +
  +
  +
  +
  +
  +   
  +  
  + 
  +
  + 
  +  
  +   
  +
  +
  +  
   TaskContainer
   
   The TaskContainer consists of a single method,
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 23679] New: - support for preservelastmodified in fixcrlf task

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23679

support for preservelastmodified in fixcrlf task

   Summary: support for preservelastmodified in fixcrlf task
   Product: Ant
   Version: 1.5.3
  Platform: Other
OS/Version: Other
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Core tasks
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Is it possible to support preservelastmodified attribute in  task ? 
What that means is - even if the fixcrlf resulted in a modified file, the 
lastmodified-date be preserved as original ...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 23679] - support for preservelastmodified in fixcrlf task

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23679

support for preservelastmodified in fixcrlf task

[EMAIL PROTECTED] changed:

   What|Removed |Added

   Severity|Normal  |Enhancement

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 23649] - Requirement for a method to not make entries in the xml reports.

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23649

Requirement for a method to not make entries in the xml reports.





--- Additional Comments From [EMAIL PROTECTED]  2003-10-08 18:48 ---
Perhaps you should just style sheet the xml directly rather than convert to
html? You could use display:none to hide anything that way. (no, I havn't done
this, with the XMLJunitFormatter output, but it should be possible at least in
principle).

Then there is the possiblity that your conversion to HTML could be tweaked or
pre-processed with another conversion to omit the undesireables along the way.
While this could be solved in ant, it also could be solved on the outside. Just
cause we give you the data doesn't mean you have to use it...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 23649] - Requirement for a method to not make entries in the xml reports.

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23649

Requirement for a method to not make entries in the xml reports.





--- Additional Comments From [EMAIL PROTECTED]  2003-10-08 18:56 ---
Franckly, I've also wondered about the properties being repeated for every 
single test in the XML output. It's quite heavyweight, and an attribute to not 
generate this in the XML at all seems entirely reasonnable to me, and would 
speed up both the generation of the XML, and the transformation to HTML later 
on. Having these properties once in the XML would be fine, but for every single 
test, that's just a waste IMHO. --DD

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Questions: A Cocoon Ant task

2003-10-08 Thread Upayavira
I am attempting to craft an Ant task for Apache Cocoon's command line 
interface.

Cocoon's CLI can be configured with an XML xconf file. I want to move 
this configuration information into the Ant build script itself.

Is there any way I can share the code to interpret this XML 
configuration information between Cocoon and Ant? In Cocoon's CLI I use 
a DOM to parse the XML, but in Ant I seem to have to create objects for 
nested elements, and have Ant handle it using introspection.

Is there any other way, or do I just have to accept that I've got to 
maintain two sets of code - one for use from the command line, and one 
from Ant?

I hope I'm clear enough.
Thanks for any help.
Regards,
Upayavira


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: failonerror; general solution

2003-10-08 Thread Gus Heck

I'm not as eager to see the tasks in Ant proper as others, that's why
I haven't taken any initiative here (in Apache speak, that's the
difference between my +0 and the +1s that have been cast by others).
 

Are we talking about all ant-contrib tasks or just try/catch? I thought 
just try/catch...

-Gus
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Questions: A Cocoon Ant task

2003-10-08 Thread Dominique Devienne
You can use DynamicConfigurator to intercept attribute/elements, and build
the DOM tree yourself, which you can then feed to Cocoon's CLI I guess.

The code below should get you a leg up. Provided with no warranties
whatsoever ;-) I wrote this a long time ago, on a weekend, with little Ant
experience. --DD

package com.lgc.buildmagic;

import java.io.IOException;
import java.io.ByteArrayOutputStream;

import org.w3c.dom.Node;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.NodeList;
import org.w3c.dom.DOMException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DynamicConfigurator;

import org.apache.tools.ant.types.DataType;
//import org.apache.tools.ant.util.DOMElementWriter;

/**
 * Base class for those classes that can appear inside the build file
 * as stand alone data types.  
 *
 * My very first data type ;-)
 *
 * @author mailto:[EMAIL PROTECTED]">Dominique Devienne 
 */
public class XmlFragment
 extends DataType
 implements DynamicConfigurator {

/**
 * A dyna'tor for each element.
 */
private static class ElementWrapper
 implements DynamicConfigurator {

/** The XML DOM node */
private Node _node;

/** Instantiate a root wrapper */
private ElementWrapper(Node node) {
_node = node; // Could be a Document or DocumentFragment
}

/** Instantiate a child wrapper */
private ElementWrapper(Node parent, String childName) {
Document document = parent.getOwnerDocument();
if (document == null) {
  document = (Document)parent; // Node is the document!
}
_node = document.createElement(childName);
parent.appendChild(_node);
}

public String toString() {
ByteArrayOutputStream ostream = new ByteArrayOutputStream();
// This will fail, since the DocFragment is not an Element!
// DOMElementWriter needs to be fixed to take a node, not an
Element.
try {
new DOMElementWriter().write(_node, ostream);
return ostream.toString();
}
catch (IOException e) {
throw new BuildException(e);
}
}


//
// interface DynamicConfigurator
//

public void setDynamicAttribute(String name, String value)
throws BuildException {
// Never called for anything by Element wrappers
Element element = (Element)_node;
element.setAttribute(name, value);
}

public Object createDynamicElement(String name)
  throws BuildException {
return new ElementWrapper(_node, name);
}

} // END class XmlFragment.ElementWrapper


private DocumentFragment _fragment;
private ElementWrapper _wrapper;

/**
 * Instanciate a new DOM document fragment wrapped in an Ant data type.
 */
public XmlFragment() {
try {
DocumentBuilder builder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
_fragment = builder.newDocument().createDocumentFragment();
_wrapper = new ElementWrapper(_fragment);
}
catch (ParserConfigurationException e) {
throw new BuildException(e);
}
}

/**
 * Sets the name of the top-level DOM node, the xml fragment, to use.
 *
 * @param  name the xml fragment node name. Defaults to "xmlfragment".
public void setName(String name) {
_wrapper._tagname = name;
}
 */

public String toString() {
return _wrapper.toString();
}


//
// interface DynamicConfigurator
//

public void setDynamicAttribute(String name, String value)
throws BuildException {
// The root only supports explicit 'normal' attributes!
throw new BuildException("attribute "+name+" not supported!");
}

public Object createDynamicElement(String name)
  throws BuildException {
return _wrapper.createDynamicElement(name);
}

} // END class XmlFragment

> -Original Message-
> From: Upayavira [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 08, 2003 1:49 PM
> To: [EMAIL PROTECTED]
> Subject: Questions: A Cocoon Ant task
> 
> I am attempting to craft an Ant task for Apache Cocoon's command line
> interface.
> 
> Cocoon's CLI can be configured with an XML xconf file. I want to move
> this configuration information into the Ant build script itself.
> 
> Is there any way I can share the code to interpret this XML
> configuration information between Cocoon and Ant? In Cocoon's CLI I us

DO NOT REPLY [Bug 23686] New: - doesn't work well with interactive programs

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23686

 doesn't work well with interactive programs

   Summary:  doesn't work well with interactive programs
   Product: Ant
   Version: 1.6Beta
  Platform: Other
OS/Version: Other
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Core tasks
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


Using the exec task to execute an interactive program doesn't
seem to have its input stream set up correctly.  If I explicitly add
an input="/dev/tty" to the task it will stop and wait for input, but
the output won't show up until after the input is read.  Without the
input= the external program just gets eof on input.
Example, using external ftp program (yes, I know there's a ftp task):


   
   
   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 23688] New: - Provide a method to get the ant logging level for the log4j appender

2003-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23688

Provide a method to get the ant logging level for the log4j appender

   Summary: Provide a method to get the ant logging level for the
log4j appender
   Product: Ant
   Version: 1.5.1
  Platform: All
OS/Version: All
Status: NEW
  Severity: Enhancement
  Priority: Other
 Component: Optional Tasks
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


I am using the the code that follows to set up an appender to ant log file from
the log4j events.  The only problem is I cannot set the log4j logging level
according to the ant logging level because there is no method to get the ant
logging level.  In order to see the logging then I must set logging in log4j to
all and then let ant logging filter but this can really hurt performance if
there is alot of logging.

// redirect log4j to ant logger
Appender appender = Log4jToAnt.getAppenderForTask( this);
Logger rootLogger = LogManager.getRootLogger();
Level savedRootLoggerLevel = rootLogger.getLevel();
if( log4jDebug ) {
rootLogger.setLevel( Level.ALL); // turn on all logging and let ant 
filter
} else {
rootLogger.setLevel( Level.ERROR); // turn off logging for improved 
speed
}
// TODO: performance improvement: find out way to detect ant logging 
level and
set appropriately.
// Note: Ant does not expose the logging value so we would need to 
modify ant
!!! arg
BasicConfigurator.configure( appender);


public static final int getAntMsgInt( Level level ) {
if( level == Level.DEBUG ) {
return Project.MSG_DEBUG;
} else if( level == Level.INFO ) {
return Project.MSG_VERBOSE;
} else if( level == Level.WARN ) {
return Project.MSG_WARN;
} else if( level == Level.ERROR ) {
return Project.MSG_ERR;
} else if( level == Level.FATAL ) {
return Project.MSG_ERR;
} else {
return Project.MSG_VERBOSE;
}
}

public static final Appender getAppenderForTask( final Task task) {
return new AppenderSkeleton() {
Task _task = task;
{
_task.log( "Started redirect of log4j to ant logger", 
Project.MSG_VERBOSE );
}
public void append(LoggingEvent event) {
_task.log( event.getLoggerName().substring(
event.getLoggerName().lastIndexOf( ".")+1) + " " + event.getRenderedMessage(),
getAntMsgInt( event.getLevel()));
}
public void close() {
}
public boolean requiresLayout() { 
return false; 
}
};
}

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



dev@ant.apache.org

2003-10-08 Thread Shatzer, Larry
With the beta for 1.6 I get this when using a javascript