Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / October 2003

Tip: Looking for answers? Try searching our database.

Adding vizant tag to ant tag set via taskdef and antviz.jar?

Thread view: 
Equis Uno - 01 Oct 2003 01:53 GMT
Hi,

I'm working with Ant1.5 (according to $ANT_HOME/welcome.html).

I'm trying to extend the tag set of ant.

I've never done it before.

The tag I want to add is <vizant> which corresponds
to a utility for building visualization of build.xml files.

You will see a nice demo here:
http://vizant.sourceforge.net/examples.html

Based on my reading I need to do two things:

1. Find the appropriate .jar file for the <vizant> tag and add the
.jar file to
  $ANT_HOME/lib.

2. Add an appropriate <taskdef> tag to the build file.

So...

I built a AntViz.jar file from an AntViz download.

Here is my copy of AntViz:

[root@localhost dist]# cd /home/dan/AntViz
[root@localhost AntViz]# ls
./           classes/        README.txt
../           dist/        src/
actions.xml       docbook-wrapper.xsl  toc.xml
antvizhelp.xml       dockables.xml    users-guide2002-0803.xml
AntViz.props       index.html        users-guide2002-0803.xsl
build/           lib/        users-guide.xml
build2003-0803.xml  license_dom4j.html    users-guide.xsl
build.xml       LICENSE_jgraph    word-index.xml
changes.txt       LICENSE.txt
[root@localhost AntViz]#

I used ant to create the AntViz.jar file:

[root@localhost AntViz]# ant dist
Buildfile: build.xml

compile:
  [delete] Deleting directory /home/dan/AntViz/classes
   [mkdir] Created dir: /home/dan/AntViz/classes
   [javac] Compiling 28 source files to /home/dan/AntViz/classes
   [javac] /home/dan/AntViz/src/antviz/AntViz.java:863: warning:
getFile() in
org.gjt.sp.jedit.Buffer has been deprecated
   [javac]                 antBuildFileDir =
currentBuffer.getFile().getParent();
   [javac]                                                ^
   [javac] /home/dan/AntViz/src/antviz/debugger/AntPrintStream.java:94:
warning:
print(java.awt.Color,java.lang.String) in console.Console has been
deprecated
   [javac]             console.print(console.getInfoColor(), line);
   [javac]                    ^
   [javac] /home/dan/AntViz/src/antviz/debugger/AntPrintStream.java:96:
warning:
print(java.awt.Color,java.lang.String) in console.Console has been
deprecated
   [javac]             console.print(console.getErrorColor(), line);
   [javac]                    ^
   [javac] /home/dan/AntViz/src/antviz/debugger/AntPrintStream.java:98:
warning:
print(java.awt.Color,java.lang.String) in console.Console has been
deprecated
   [javac]             console.print(null, line);
   [javac]                    ^
   [javac] 4 warnings

dist:
     [jar] Building jar: /home/dan/AntViz/dist/AntViz.jar

BUILD SUCCESSFUL
Total time: 5 seconds
[root@localhost AntViz]#

I inspected the resulting .jar file:

[root@localhost AntViz]# jar tvf /home/dan/AntViz/dist/AntViz.jar
    0 Tue Sep 30 07:47:22 PDT 2003 META-INF/
  104 Tue Sep 30 07:47:20 PDT 2003 META-INF/MANIFEST.MF
    0 Tue Sep 30 07:47:22 PDT 2003 antviz/
  372 Tue Sep 30 07:47:20 PDT 2003 antviz/AntGraphPopupMenu.class
 1266 Tue Sep 30 07:47:20 PDT 2003 antviz/AntViz$1.class
  516 Tue Sep 30 07:47:20 PDT 2003 antviz/AntViz$2.class
 1066 Tue Sep 30 07:47:20 PDT 2003 antviz/AntViz$StreamGobbler.class
18000 Tue Sep 30 07:47:20 PDT 2003 antviz/AntViz.class
  142 Tue Sep 30 07:47:20 PDT 2003 antviz/AntVizActions.class
    0 Tue Sep 30 07:47:22 PDT 2003 antviz/debugger/
 1896 Tue Sep 30 07:47:20 PDT 2003
antviz/debugger/AntPrintStream.class
 4519 Tue Sep 30 07:47:22 PDT 2003 antviz/debugger/DebugGobbler.class
  893 Tue Sep 30 07:47:22 PDT 2003 antviz/debugger/DebugReader.class
  171 Tue Sep 30 07:47:22 PDT 2003
antviz/debugger/StopDebugException.class
 4625 Tue Sep 30 07:47:22 PDT 2003 antviz/debugger/AntListener.class
  730 Tue Sep 30 07:47:22 PDT 2003 antviz/debugger/BufferWait.class
   99 Tue Sep 30 07:47:22 PDT 2003 antviz/debugger/Command.class
 2230 Tue Sep 30 07:47:22 PDT 2003
antviz/debugger/DebugSelectionCommand.class
  613 Tue Sep 30 07:47:22 PDT 2003
antviz/debugger/DebugTargetChangeListener.class
  540 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizToolPanel$1.class
  538 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizToolPanel$2.class
  537 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizToolPanel$3.class
  537 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizToolPanel$4.class
 3327 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizToolPanel.class
 1790 Tue Sep 30 07:47:22 PDT 2003 antviz/JNaviBar.class
    0 Tue Sep 30 07:47:22 PDT 2003 antviz/graph/
 1795 Tue Sep 30 07:47:22 PDT 2003 antviz/graph/AntGraph.class
  474 Tue Sep 30 07:47:22 PDT 2003
antviz/graph/DependencyNodeCell.class
  407 Tue Sep 30 07:47:22 PDT 2003
antviz/graph/DependencyNodeRenderer.class
  581 Tue Sep 30 07:47:22 PDT 2003
antviz/graph/DependencyNodeView.class
 2597 Tue Sep 30 07:47:22 PDT 2003 antviz/DependencyNode.class
 1770 Tue Sep 30 07:47:22 PDT 2003 antviz/NaviBarMouseListener.class
 3131 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizMouseListener.class
 2667 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizOptionPane.class
  852 Tue Sep 30 07:47:22 PDT 2003 antviz/AntVizPlugin.class
 1084 Tue Sep 30 07:47:22 PDT 2003 antviz/PopupActionListener.class
 1425 Tue Sep 30 07:47:22 PDT 2003 antviz/SelectionCommand.class
    0 Tue Sep 30 07:47:22 PDT 2003 antviz/util/
 1440 Tue Sep 30 07:47:22 PDT 2003 antviz/util/FontUtil.class
 2773 Tue Sep 30 07:47:22 PDT 2003 antviz/util/SaxHandler.class
  158 Tue Sep 30 07:47:22 PDT 2003 antviz/util/TextConstans.class
  675 Sat Aug 03 14:06:34 PDT 2002 actions.xml
 1766 Sat Aug 03 14:06:34 PDT 2002 AntViz.props
  214 Sat Aug 03 14:06:34 PDT 2002 dockables.xml
[root@localhost AntViz]#

I copied it to $ANT_HOME/lib:

[root@localhost AntViz]# cp -p /home/dan/AntViz/dist/AntViz.jar
$ANT_HOME/lib

Here is a view of my $ANT_HOME/lib:

[root@localhost AntViz]# ls -la $ANT_HOME/lib
total 9404
drwxr-xr-x    2 root     root         4096 Sep 29 22:45 ./
drwxr-xr-x    6 root     root         4096 Aug 22 11:20 ../
-rw-r--r--    1 root     root        76933 May  5 21:57 AntFarm.jar
-rw-r--r--    1 root     root       735451 May 30 05:53 ant.jar
-rw-------    1 root     root       654735 Mar 25  2003
ant-optional.jar
-rw-r--r--    1 root     root        41855 Sep 30 07:47 AntViz.jar
-rw-rw-r--    1 root     root        56243 Aug  4  2002
AntVizPlugin.jar
-rw-r--r--    1 root     root        28054 May  5 22:03
CommonControls.jar
-rw-rw-r--    1 root     root       144642 Aug  7 16:07 Console.jar
-rw-rw-rw-    1 root     root       456914 Aug  3  2002 dom4j.jar
-rw-rw-r--    1 root     root        42839 May 30 16:59 ErrorList.jar
-rw-rw-rw-    1 root     root       137141 Aug  3  2002 jgraph.jar
-rw-r--r--    1 root     root         2641 Sep 29 18:58
LatestVersion.jar
-rw-r--r--    1 root     root       424231 May 30 05:54 optional.jar
-rw-r--r--    1 root     root        10627 Sep 29 18:58
QuickNotepad.jar
-rw-rw-r--    1 root     root        35252 Jul  7 15:21 SideKick.jar
-rw-r--r--    1 root     root      5092901 Jul 31 13:29 tools.jar
-rw-r--r--    1 root     root       927669 Jul 31 10:13 xercesImpl.jar
-rw-r--r--    1 root     root       121686 Jul 31 10:13
xercesSamples.jar
-rw-r--r--    1 root     root       123705 Jul 31 10:13 xml-apis.jar
-rw-r--r--    1 root     root        51861 Jul  7 15:25
xml-commons-resolver.jar
-rw-rw-r--    1 root     root       223265 Jul  7 15:25 XML.jar
-rw-r--r--    1 root     root       123705 Jul 31 10:13
xmlParserAPIs.jar
[root@localhost AntViz]#

So I assume that I'm almost done.

All I need to do is add an appropriate <taskdef> tag to the build.xml.

I created a simple build.xml file:

<?xml version="1.0"?>
<!-- A simple build.xml file -->
<project name="bikle build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="antviz.AntViz"/>
     <classpath>
       <path location="/sun1/jwsdp-1.2/apache-ant/lib/AntViz.jar"/>
     </classpath>
   </taskdef>

   <target name="main">
     <vizant antfile="build.xml" outfile="build.dot"/>
     <exec executable="dot" ><arg line="-Tpng build.dot -o
build.png"/></exec>
   </target>
</project>

When I run ant I see this:

[root@localhost ant]# ant
Buildfile: build.xml

BUILD FAILED
file:/home/dan/ptdir2003-0731/TThier/J2EE/ep/ant/build.xml:6: taskdef
class antviz.AntViz cannot
be found

Total time: 1 second
[root@localhost ant]#

I then checked a few things:

[root@localhost ant]# env|grep ANT
ANT_HOME=/sun1/jwsdp-1.2/apache-ant
[root@localhost ant]#

That looks okay.

[root@localhost ant]# jar tf /sun1/jwsdp-1.2/apache-ant/lib/AntViz.jar
META-INF/
META-INF/MANIFEST.MF
antviz/
antviz/AntGraphPopupMenu.class
antviz/AntViz$1.class
antviz/AntViz$2.class
antviz/AntViz$StreamGobbler.class
antviz/AntViz.class
antviz/AntVizActions.class
antviz/debugger/
antviz/debugger/AntPrintStream.class
antviz/debugger/DebugGobbler.class
antviz/debugger/DebugReader.class
antviz/debugger/StopDebugException.class
antviz/debugger/AntListener.class
antviz/debugger/BufferWait.class
antviz/debugger/Command.class
antviz/debugger/DebugSelectionCommand.class
antviz/debugger/DebugTargetChangeListener.class
antviz/AntVizToolPanel$1.class
antviz/AntVizToolPanel$2.class
antviz/AntVizToolPanel$3.class
antviz/AntVizToolPanel$4.class
antviz/AntVizToolPanel.class
antviz/JNaviBar.class
antviz/graph/
antviz/graph/AntGraph.class
antviz/graph/DependencyNodeCell.class
antviz/graph/DependencyNodeRenderer.class
antviz/graph/DependencyNodeView.class
antviz/DependencyNode.class
antviz/NaviBarMouseListener.class
antviz/AntVizMouseListener.class
antviz/AntVizOptionPane.class
antviz/AntVizPlugin.class
antviz/PopupActionListener.class
antviz/SelectionCommand.class
antviz/util/
antviz/util/FontUtil.class
antviz/util/SaxHandler.class
antviz/util/TextConstans.class
actions.xml
AntViz.props
dockables.xml
[root@localhost ant]#

That looks okay.

[root@localhost ant]# cat
/home/dan/ptdir2003-0731/TThier/J2EE/ep/ant/build.xml
<?xml version="1.0"?>

<!-- A simple build.xml file -->
<project name="bikle build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="antviz.AntViz">
     <classpath>
       <path location="/sun1/jwsdp-1.2/apache-ant/lib/AntViz.jar"/>
     </classpath>
   </taskdef>

   <target name="main">
     <vizant antfile="build.xml" outfile="build.dot"/>
     <exec executable="dot" ><arg line="-Tpng build.dot -o
build.png"/></exec>
   </target>

</project>

That looks okay.

I wonder why ant cannot find "antviz.AntViz" inside of
/sun1/jwsdp-1.2/apache-ant/lib/AntViz.jar
??

Also I tried putting AntViz.jar in my CWD and also changing the
syntax of the <taskdef> tag:

[root@localhost ant]# cat build.xml
<?xml version="1.0"?>

<!-- A simple build.xml file -->
<project name="bikle build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="antviz.AntViz"
classpath="AntViz.jar"/>

   <target name="main">
     <vizant antfile="build.xml" outfile="build.dot"/>
     <exec executable="dot" ><arg line="-Tpng build.dot -o
build.png"/></exec>
   </target>

</project>
[root@localhost ant]#
[root@localhost ant]#
[root@localhost ant]# ant
Buildfile: build.xml

BUILD FAILED
file:/home/dan/ptdir2003-0731/TThier/J2EE/ep/ant/build.xml:6: taskdef
class antviz.AntViz cannot
be found

Total time: 1 second
[root@localhost ant]#

Also I tried changing the name of the <vizant> tag to <AntViz> so that
it would match the class
name:

[root@localhost ant]# cat build.xml
<?xml version="1.0"?>

<!-- A simple build.xml file -->
<project name="bikle build.xml 01" default="main" basedir=".">

   <taskdef name="AntViz" classname="antviz.AntViz"
classpath="AntViz.jar"/>

   <target name="main">
     <AntViz antfile="build.xml" outfile="build.dot"/>
     <exec executable="dot" ><arg line="-Tpng build.dot -o
build.png"/></exec>
   </target>

</project>
[root@localhost ant]# ant
Buildfile: build.xml

BUILD FAILED
file:/home/dan/ptdir2003-0731/TThier/J2EE/ep/ant/build.xml:6: taskdef
class antviz.AntViz cannot
be found

Total time: 1 second
[root@localhost ant]#

If you have made <vizant> work in your build.xml files, and have any
tips for
me, please send me clues.

Thanks,

-Dan
ir4u44@yahoo.com
Michael Amling - 01 Oct 2003 15:03 GMT
> BUILD FAILED
> file:/home/dan/ptdir2003-0731/TThier/J2EE/ep/ant/build.xml:6: taskdef
> class antviz.AntViz cannot
> be found

  While I don't use Ant, I have seen many cases where "class not found"
is the message but the real problem is an exception in class
initialization. To see whether class initialization is working, you can
try something like

  java -classpath AntViz.jar antviz.AntViz

If you get a message like

  Exception in thread "main" java.lang.NoSuchMethodError: main

then class initialization worked and you can look elsewhere for the fault.

--Mike Amling
Equis Uno - 02 Oct 2003 03:11 GMT
Hello again.
Mike gave me a good clue!

I responded to his posting with a simple experiment:

[root@localhost ant]# cd $ANT_HOME/lib
/sun1/jwsdp-1.2/apache-ant/lib
[root@localhost lib]# ls
./                  Console.jar        tools.jar
../                 dom4j.jar          xercesImpl.jar
AntFarm.jar         ErrorList.jar      xercesSamples.jar
ant.jar             jgraph.jar         xml-apis.jar
ant-optional.jar    LatestVersion.jar  xml-commons-resolver.jar
AntViz.jar          optional.jar       XML.jar
AntVizPlugin.jar    QuickNotepad.jar   xmlParserAPIs.jar
CommonControls.jar  SideKick.jar

This put me in a good directory.

Next, I tried the command line from Mike:

[root@localhost lib]# java -classpath AntViz.jar antviz.AntViz
Exception in thread "main" java.lang.NoClassDefFoundError:
org/gjt/sp/jedit/EBComponent
       at java.lang.ClassLoader.defineClass0(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
       at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
       at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[root@localhost lib]#

I then went looking for the class: org/gjt/sp/jedit/EBComponent

[root@localhost 4.2pre5]# cd /usr/local/share/jedit/4.2pre5
/usr/local/share/jedit/4.2pre5
[root@localhost 4.2pre5]# ls
./   AntViz.jar  jars/      macros/  properties/
../  doc/        jedit.jar  modes/   startup/
[root@localhost lib]# jar -tf jedit.jar|grep EBComponent
org/gjt/sp/jedit/EBComponent.class
[root@localhost lib]#

This is good; it looks like I found it.
I retried the command line:

[root@localhost 4.2pre5]# cp -p  jedit.jar $ANT_HOME/lib
[root@localhost 4.2pre5]# cd $ANT_HOME/lib
/sun1/jwsdp-1.2/apache-ant/lib
[root@localhost lib]# java -classpath AntViz.jar:jedit.jar
antviz.AntViz
Exception in thread "main" java.lang.NoClassDefFoundError:
com/jgraph/graph/DefaultGraphCell
[root@localhost lib]#

It looks like I am making progress!

I added another .jar to the command line's classpath:

[root@localhost lib]# java -classpath AntViz.jar:jedit.jar:jgraph.jar
antviz.AntViz
Exception in thread "main" java.lang.NoClassDefFoundError:
org/dom4j/Node
[root@localhost lib]#

I added another .jar:

[root@localhost lib]# java -classpath
AntViz.jar:jedit.jar:jgraph.jar:dom4j.jar antviz.AntViz
Exception in thread "main" java.lang.NoSuchMethodError: main
[root@localhost lib]#

So, it appears that I need these jar files in my classpath:

AntViz.jar
jedit.jar
jgraph.jar
dom4j.jar

I made sure the above jar files are located in $ANT_HOME/lib.

Then, I retried the ant command which had failed before:

[root@localhost ant]# cat build.xml
<?xml version="1.0"?>
<!-- A simple build.xml file -->
<project name="x build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="antviz.AntViz"/>
     <classpath>
       <path location="/sun1/jwsdp-1.2/apache-ant/lib/AntViz.jar"/>
     </classpath>
   </taskdef>

   <target name="main">
     <vizant antfile="build.xml" outfile="build.dot"/>
     <exec executable="dot" ><arg line="-Nfontname=cour -Tpng
build.dot -o build.png"/></exec>
   </target>
</project>
[root@localhost ant]# ant
Buildfile: build.xml
No public no-arg constructor in class antviz.AntViz

BUILD FAILED
No public no-arg constructor in class antviz.AntViz

Total time: 1 second
[root@localhost ant]#

I then looked at the antviz.AntViz class; I found only one
constructor:

   public AntViz(View view, String position) {
       super(new BorderLayout());

       console = getConsole(view, false);
       aps = new AntPrintStream(System.out, console.getView());

       javaHome = System.getProperty("java.home");
       AntViz.log("JDK HOME: " + javaHome);

       this.view = view;
       this.floating =
position.equals(DockableWindowManager.FLOATING);

       readOptions();

       toolPanel = new AntVizToolPanel(this);
       add(BorderLayout.NORTH, this.toolPanel);

       if (floating) {
           this.setPreferredSize(new Dimension(500, 250));
       }
   }

According to my IDE a "View" type is actually this:
org.gjt.sp.jedit.View

I'm not sure how to pass a
org.gjt.sp.jedit.View

type object to this constructor via ant so I gave up on using this jar
file.

I suspect that AntViz.jar could be used to connect jEdit to both ant
and
antviz which I might be interested in doing someday.

Right now I just wanted to get a vizant tag working in my build.xml.

I found another vizant jar file here:
http://umn.dl.sourceforge.net/sourceforge/vizant/vizant.jar

I inspected it after I copied it to $ANT_HOME/lib.

[root@localhost ant]# jar tf /sun1/jwsdp-1.2/apache-ant/lib/vizant.jar
META-INF/
META-INF/MANIFEST.MF
net/
net/sourceforge/
net/sourceforge/vizant/
net/sourceforge/vizant/Vizant$VizFileWriter.class
net/sourceforge/vizant/Vizant.class
net/sourceforge/vizant/VizASType.class
net/sourceforge/vizant/VizAttr.class
net/sourceforge/vizant/VizAttrStmt.class
net/sourceforge/vizant/VizPrinter$IDTable.class
net/sourceforge/vizant/VizPrinter.class
net/sourceforge/vizant/VizProject.class
net/sourceforge/vizant/VizProjectLoader.class
net/sourceforge/vizant/VizProjectLoaderImpl$SAXHandler.class
net/sourceforge/vizant/VizProjectLoaderImpl.class
net/sourceforge/vizant/VizReference.class
net/sourceforge/vizant/VizSubgraph.class
net/sourceforge/vizant/VizTarget.class
net/sourceforge/vizant/VizWriter.class
[root@localhost ant]#
[root@localhost ant]#

I edited and then I inspected my build.xml file:

[root@localhost ant]# cat build.xml
<?xml version="1.0"?>
<!-- A simple build.xml file -->
<project name="build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant"/>
     <classpath>
       <path location="/sun1/jwsdp-1.2/apache-ant/lib/vizant.jar"/>
     </classpath>
   </taskdef>

   <target name="main">
     <vizant antfile="build.xml" outfile="build.dot"/>
     <exec executable="/usr/local/bin/dot" ><arg
line="-Nfontname=cour -Tpng build.dot -o build.png"/></exec>
   </target>
</project>
[root@localhost ant]#
[root@localhost ant]#

Then I ran ant.

[root@localhost ant]#
[root@localhost ant]# ant
Buildfile: build.xml

BUILD FAILED
file:/home/dan/ptdir2003-0731/TThier/J2EE/ep/ant/build.xml:6:
Unexpected element "classpath"

Total time: 1 second
[root@localhost ant]#

I enhanced my invalid build.xml file:

[root@localhost ant]# cat  build.xml
<?xml version="1.0"?>
<!-- A simple build.xml file -->
<project name="build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant">
     <classpath>
       <path location="/sun1/jwsdp-1.2/apache-ant/lib/vizant.jar"/>
     </classpath>
   </taskdef>

   <target name="main">
     <vizant antfile="build.xml" outfile="build.dot"/>
     <exec executable="/usr/local/bin/dot" ><arg
line="-Nfontname=cour -Tpng build.dot -o build.png"/></exec>
   </target>
</project>

And then I ran ant:

[root@localhost ant]# ant
Buildfile: build.xml

main:

BUILD SUCCESSFUL
Total time: 1 second
[root@localhost ant]#

According to ant documentation, I did not need to specify a classpath.
I only needed to ensure that all necessary jar files resided in
$ANT_HOME/lib.
So, I enhnaced the build.xml and then ran ant again.

[root@localhost ant]#
[root@localhost ant]# cat build.xml
<?xml version="1.0"?>

<!-- A simple build.xml file -->

<project name="build.xml 01" default="main" basedir=".">

   <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant"/>

   <target name="main">

     <vizant antfile="build.xml" outfile="build.dot"/>

     <exec executable="/usr/local/bin/dot" >
       <arg line="-Nfontname=cour -Tpng build.dot -o build.png"/>
     </exec>

   </target>

</project>
[root@localhost ant]#
[root@localhost ant]#
[root@localhost ant]#
[root@localhost ant]# ant
Buildfile: build.xml

main:

BUILD SUCCESSFUL
Total time: 1 second
[root@localhost ant]#
[root@localhost ant]#

Next, I inspected build.dot and build.png.

[root@localhost ant]#
[root@localhost ant]# cat build.dot
digraph "G" {
   graph ["rankdir"="LR",];
   "main";
}
[root@localhost ant]#
[root@localhost ant]# ls -l build.png
-rw-r--r--    1 root     root          420 Oct  1 19:05 build.png
[root@localhost ant]#

I looked at build.png with my mozilla browser; it showed me a pretty
ellipse containing the string "vizant".

I was happy.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.