You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Dan Earfull <ir...@yahoo.com> on 2003/10/01 02:07:33 UTC

Adding vizant tag to ant tag set?

 
 

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

Re: Adding vizant tag to ant tag set?

Posted by Dan Earfull <ir...@yahoo.com>.
Hi,

I followed Jake's advice.
He got me moving in the right direction.

Here is what I saw.

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="vizant" basedir=".">

  <target name="vizant">
    <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="/CD/vizant.jar"/>
    <vizant antfile="build.xml" outfile="build.dot"/>
    <exec executable="dot" failifexecutionfails="false" resultproperty="graphvizSuccess!">
      <arg line="-Tpng build.dot -o build.png"/>
    </exec>
    <fail unless="graphvizSuccess!">
         You probably need to install GraphViz which is a native program,
         not a Java library &gt;&gt;&gt;
         http://www.research.att.com/sw/tools/graphviz/
     </fail>
  </target>

</project>
[root@localhost ant]#





Next, I ran ant:

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

vizant:
     [exec] Error: Could not find/open font : Times in
/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:/usr/common/share/fonts/ttf

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


At first, I was not sure how to troubleshoot this although it was
obvious that I got the vizant tag recognized by ant.




I inspected the directory for build.dot:

[root@localhost ant]# ls -l build.dot
-rw-r--r--    1 root     root           59 Oct  1 17:25 build.dot
[root@localhost ant]# cat build.dot
digraph "G" {
    graph ["rankdir"="LR",];
    "vizant";
}
[root@localhost ant]#

Good; ant created build.dot for me.




I tried the "dot" command line which ant was trying:

[root@localhost ant]# dot -Tpng build.dot -o build.png
Error: Could not find/open font : Times in
/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:/usr/common/share/fonts/ttf
[root@localhost ant]#




I studied my X-windows setup:

[root@localhost ant]# which xterm
/usr/X11R6/bin/xterm
[root@localhost ant]# cd /usr/X11R6
/usr/X11R6
[root@localhost X11R6]# find . -name '*Times*' -print
./man/man3/XtLastTimestampProcessed.3x.gz
[root@localhost X11R6]#

I saw no evidence of a "Times" font which might be tucked away in a corner somewhere.




I studied the dot executable.

[root@localhost X11R6]# dot -h
dot: option -h unrecognized

Usage: dot [-Vv?] [-(GNE)name=val] [-(Tlso)<val>] <dot files>
 -V          - Print version and exit
 -v          - Enable verbose mode
 -Gname=val  - Set graph attribute 'name' to 'val'
 -Nname=val  - Set node attribute 'name' to 'val'
 -Ename=val  - Set edge attribute 'name' to 'val'
 -Tv         - Set output format to 'v'
 -lv         - Use external library 'v'
 -ofile      - Write output to 'file'
 -q[l]       - Set level of message suppression (=1)
 -s[v]       - Scale input by 'v' (=72)
 -y          - Invert y coordinate in output
[root@localhost X11R6]#

I found some online documentation on "dot":
http://www.graphviz.org/cgi-bin/man?dot




I enhanced my "dot" command line:

[root@localhost ant]#
[root@localhost ant]# dot -Nfontname="cour"  -Tpng build.dot -o build.png
[root@localhost ant]#

Oh boy; no error message.

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




I then went back and enhanced my build.xml file and then ran ant.

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

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

  <target name="vizant">
    <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" classpath="/CD/vizant.jar"/>
    <vizant antfile="build.xml" outfile="build.dot"/>
    <exec executable="dot" failifexecutionfails="false" resultproperty="graphvizSuccess!">
      <arg line="-Nfontname=cour -Tpng build.dot -o build.png"/>
    </exec>
    <fail unless="graphvizSuccess!">
         You probably need to install GraphViz which is a native program,
         not a Java library &gt;&gt;&gt;
         http://www.research.att.com/sw/tools/graphviz/
     </fail>
  </target>

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

vizant:

BUILD SUCCESSFUL
Total time: 1 second
[root@localhost ant]# ls -l build.dot build.png build.xml
-rw-r--r--    1 root     root           59 Oct  1 18:11 build.dot
-rw-r--r--    1 root     root          505 Oct  1 18:11 build.png
-rw-r--r--    1 root     root          713 Oct  1 18:10 build.xml
[root@localhost ant]#

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

-Dan


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Adding vizant tag to ant tag set?

Posted by Jacob Kjome <ho...@visi.com>.
At 05:07 PM 9/30/2003 -0700, you wrote:
>If you have made <vizant> work in your build.xml files, and have any tips for
>me, please send me clues.

Sure, how about this...

1.  Download:
http://umn.dl.sourceforge.net/sourceforge/vizant/vizant.jar

2.  Either put vizant.jar in ANT_HOME/lib or create a property called 
"vizant.jar" and use it like I have below in the "classpath" attribute for 
the taskdef.

3.  Run the following target (modified based on what you decide in #2)....

     <target name="vizant">
         <taskdef name="vizant" classname="net.sourceforge.vizant.Vizant" 
classpath="${vizant.jar}"/>
         <vizant antfile="build.xml" outfile="build.dot"/>
         <exec executable="dot" failifexecutionfails="false" 
resultproperty="graphvizSuccess!">
             <arg line="-Tpng build.dot -o build.png"/>
         </exec>
         <fail unless="graphvizSuccess!">
         You probably need to install GraphViz which is a native program,
         not a Java library &gt;&gt;&gt; 
http://www.research.att.com/sw/tools/graphviz/
         </fail>
     </target>

4.  If you get the "fail" message, download the native graphviz program for 
your platform and make sure the executable is in your system path.

After doing the above, everything should work for you.

Jake 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org