DO NOT REPLY [Bug 23541] - Enhance error messages of taskdef to say what really is not found...

2003-10-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23541.
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=23541

Enhance error messages of taskdef to say what really is not found...





--- Additional Comments From [EMAIL PROTECTED]  2003-10-11 09:46 ---
Created an attachment (id=8534)
this patch to AntClassLoader.java may save many people a lot of worries!

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



DO NOT REPLY [Bug 23741] New: - mistaken conversion class name into unix-style path - taskdef A class needed by class myTask cannot be found

2003-10-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23741.
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=23741

mistaken conversion class name into unix-style path - taskdef A class needed by 
class myTask cannot be found

   Summary: mistaken conversion class name into unix-style path -
taskdef A class needed by class myTask cannot be found
   Product: Ant
   Version: 1.6Beta
  Platform: Other
   URL: http://ant.apache.org/manual/CoreTasks/taskdef.html
OS/Version: Windows NT/2K
Status: NEW
  Severity: Normal
  Priority: Other
 Component: Core tasks
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]


taskdef name=myTask classpathref=myTaskClasspath.path
   classname=fully.qualified.java.classname.myTask /

produces the following error when running with debug (and the patch of
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23541):
Finding class net.sf.cglib.transform.DumpFieldsTask
Could not find Class fully/qualified/java/classname/myTask.class in
C:\myProj\WEB-INF\classes\fully\qualified\java\classname

=== The dots get converted in a platform dependent way!!!

When I remove the fully qualified name as per
taskdef name=myTask classpathref=myTaskClasspath.path
   classname=myTask /
the same problem occurs when going after the inner class!


build.xml:71: taskdef A class needed by class myTask cannot be found: myTask
(wrong name: fully/qualified/java/classname/myTask)...

== thus again, in windows, fully/qualified/java/classname/ becomes part of
the filename.

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



DO NOT REPLY [Bug 23541] - Enhance error messages of taskdef to say what really is not found...

2003-10-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23541.
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=23541

Enhance error messages of taskdef to say what really is not found...





--- Additional Comments From [EMAIL PROTECTED]  2003-10-11 10:22 ---
similar problems with inner classes are reported in
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23741

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



*USEFUL* Stylesheet to generate a task-dependency graph for ant.

2003-10-11 Thread alec
Dear Ant users,
Here's an XSLT script which will give you a graphical
view of the task dependencies in your ant build file.
See the attached postscript (.ps) file for an example
of the end-result.
The process is as follows:
1. Creating a a build.dot file using the supplied build.xsl script
2. Compile this file with the GraphViz 'dot' program
using the '-Tps' option to produce a PostScript file
which depicts all the dependencies in the build.xml file graphically.
This is very useful to get a quick overview of the buildfile structure.
It requires:
* graphviz -- open source and available from ATT
   (binaries available for windows, linux and many other systems).
* A postscript viewer (like ghostview --
 available for many o/ses including windows and linux).
Would appreciate feedback on other utilities which can do the same thing
possibly using Java only (graphviz is written in C or C++).
I'm aware of a jedit plugin, called AntViz;
I haven't tried it out myself, though.
Suggestions are welcome.
Thanks,
Alec Noronha
==
Save the following into a file called 'build.xsl':
- START BUILD.XSL CODE -
!--
 This stylesheet has been tested on Apache Xalan 2.5.0
--
xsl:stylesheet version=1.1
   xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
   xmlns:str=http://exslt.org/strings;
   extension-element-prefixes=str
 xsl:output method=text/
 !-- Variables for formatting --
 xsl:variable name=top
   xsl:text
digraph build_xml_dependencies{
 size=12,12;
 shape=box;
 start [color=yellowgreen, shape=tripleoctagon, label=START];
/xsl:text
 /xsl:variable
 xsl:variable name=bottom
   xsl:text
}  
   /xsl:text
 /xsl:variable
 xsl:variable name=start_node
start
 /xsl:variable

 xsl:variable name=join
   xsl:text - /xsl:text
 /xsl:variable
 xsl:variable name=two_spaces
   xsl:text  /xsl:text
 /xsl:variable
 xsl:variable name=end_of_sentence
   xsl:text ;
/xsl:text
 /xsl:variable
   !-- Templates --
 xsl:template match=project
   xsl:choose
 xsl:when test=not(function-available('str:tokenize'))
   xsl:message terminate=yes
 ERROR: EXSLT - This stylesheet requires the exslt extension 
strings:tokenize.
   /xsl:message
 /xsl:when
 xsl:otherwise
   xsl:value-of select=$top/
   xsl:apply-templates select=target/
   xsl:value-of select=$bottom/
 /xsl:otherwise
   /xsl:choose
 /xsl:template

 xsl:template match=target
   xsl:choose
 xsl:when test=not(attribute::depends)
   xsl:value-of select=$two_spaces/
   xsl:value-of select=translate( attribute::name, '()-' , '___' )/
   xsl:value-of select=$join/
   xsl:value-of select=$start_node/
   xsl:value-of select=$end_of_sentence/
 /xsl:when
 xsl:otherwise
   xsl:call-template name=dependency_loop
 xsl:with-param name=dependency_list
 select=str:tokenize( translate( @depends, 
'()-' , '___' ), ' ,-' ) /
 xsl:with-param name=task_node
 select=translate( attribute::name, '()-' , 
'___' ) /
   /xsl:call-template
 /xsl:otherwise
   /xsl:choose
 /xsl:template

 xsl:template name=dependency_loop
   xsl:param name=dependency_list/
   xsl:param name=task_node/
   xsl:for-each select=$dependency_list
 xsl:value-of select=$two_spaces/
 xsl:value-of select=$task_node/
 xsl:value-of select=$join/
 xsl:value-of select=./
 xsl:value-of select=$end_of_sentence/
   /xsl:for-each
 /xsl:template
!--
The xsl:value-of select=./ element in the middle of the named 
template will be replaced
by the contents of the current node from which this template was called.
--

/xsl:stylesheet
- END BUILD.XSL CODE -
Incorporate the following code into your 'build.xml' file.
Of course, you need to substitute your own directory names.
Note on the code below: for some reason, I had to place xalan.jar
into the ant/lib directory to get the following working.
- START ANT BUILD.XML CODE -
 target name=view_dependencies
 depends=prepare
 description=Generate and view the dependency graph
   echo message=Generating the dependency dot file .../
   xslt basedir=${basedir}
 destdir=${build_dev_docs_dir}
 extension=.dot
 style=build.xsl
 classpathref=xalan_classpath
 processor=trax
 includes=build.xml /
   echo message=Compiling the dependency dot file .../
   exec executable=${dot_file_compiler}
 dir=${build_dev_docs_dir}
 outputproperty=dotoutput
 resultproperty=dotresult
 failifexecutionfails=true
 failonerror=true
  arg line=-Tps ${build_dev_docs_dir}/build.dot -o 
${build_dev_docs_dir}/build.ps/
   /exec

   echo message=Invoking the gv ps viewer on the dependency file .../
   exec executable=${ps_viewer}
 dir=${build_dev_docs_dir}
 outputproperty=psoutput
 resultproperty=psresult
 

Re: *USEFUL* Stylesheet to generate a task-dependency graph for ant.

2003-10-11 Thread Nicola Ken Barozzi
alec wrote:
Dear Ant users,
Here's an XSLT script which will give you a graphical
view of the task dependencies in your ant build file.
There is a project on SF called vizant that also outputs a java applet 
with the dependencies (see the CVS version, it's more recent).

http://sourceforge.net/projects/vizant/
It has been inactive for a bit now, but I'd be happy to restart to code.
If you or anyone wants to help... :-)
--
Nicola Ken Barozzi   [EMAIL PROTECTED]
- verba volant, scripta manent -
   (discussions get forgotten, just code remains)
-

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