You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Frot <fr...@lycos.at> on 2002/06/08 14:33:15 UTC

RE: xsl script to generate graphical representation of build.xml

Uhm,

Could someone make all the needed files available somewhere, being both the stylesheet and the tool (including all the needed
libraries) ??

Thanx, Fred

*********** REPLY SEPARATOR  ***********

On 06.06.02 at 16:55 Chris Bailey wrote:

>I should also add, it'd be cool if someone enhanced this so that targets
>that call other targets in the same file (i.e. via <antcall>) are graphed.
>
>-----Original Message-----
>From: Chris Bailey [mailto:chris@codeintensity.com]
>Sent: Thursday, June 06, 2002 4:50 PM
>To: Ant Users List
>Subject: RE: xsl script to generate graphical representation of
>build.xml
>
>
>FYI, I set this up on my Linux box, and needed to change the font specified
>in ant2dot.xsl.  I changed it from "Arial" to "verdana", but you may need
>to
>fiddle around depending on what fonts you have.  I wasn't able to specify a
>font name that had dashes in it (which may just be due to my lack of
>knowing
>how to make that work in the XSL file).
>
>-----Original Message-----
>From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
>Sent: Thursday, June 06, 2002 2:10 PM
>To: ant-user@jakarta.apache.org
>Subject: Re: xsl script to generate graphical representation of
>build.xml
>
>
>Very cool, thanks Nascif.
>
>I've whipped up a simple build file to automate this:
>
><project name="diagram" default="main">
>
>  <target name="build-dot">
>    <xslt in="build.xml"
>          style="${ant.home}/etc/ant2dot.xsl"
>          out="dotfile.dot"
>    />
>  </target>
>
>  <target name="diagram" depends="build-dot">
>    <exec executable="c:\tools\graphviz\bin\dot.exe">
>      <arg value="-Tpng"/>
>      <arg file="dotfile.dot"/>
>      <arg value="-obuild.png"/>
>    </exec>
>  </target>
>
>  <target name="main" depends="diagram"/>
></project>
>
>Of course hard-coded paths and such need to be factored out to properties,
>but thats not high on my to-do list!  :)  I call it like this from any
>directory:
>
>    ant -f <path to this file>/diagram.xml -Dbasedir=.
>
>and it diagrams the build.xml in my current directory.
>
>I, as you can tell, put the XSL file in ANT_HOME/etc.  Do folks want this
>file in Ant's codebase and distribution? Any objections?  Stefan?
>
>    Erik
>
>
>
>----- Original Message -----
>From: "Nascif Abousalh-Neto" <na...@nortelnetworks.com>
>To: "Erik Hatcher" <ja...@ehatchersolutions.com>; "Ant Users List"
><an...@jakarta.apache.org>
>Cc: <s....@webmacher.de>
>Sent: Thursday, June 06, 2002 4:10 PM
>Subject: RE: xsl script to generate graphical representation of build.xml
>
>
>> That is really cool! I tried Erik's version and found some small
>problems:
>>  - It was not supressing text inside tags, like you would have in
>embedded
>> scripts and the project description. The XSL default is to print text
>> elements, and that was breaking dot.
>>  - The arrow orientation was counter-intuitive, so I inverted then. IMHO
>it
>> makes more sense if the dependent points to its depency, specially when a
>a
>> node depends on many others (like an "all" target).
>>
>> The attached .xsl file solves both problems. Also attached some examples.
>>
>> Enjoy,
>> Nascif
>>
>>
>> > -----Original Message-----
>> > From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
>> > Sent: Wednesday, June 05, 2002 8:27 PM
>> > To: Ant Users List
>> > Subject: Re: xsl script to generate graphical representation of
>> > build.xml
>> >
>> >
>> > Eager to see what this thing could do with my build files, I
>> > *gasp* read the
>> > docs and found exactly what I needed.  Attached is a slightly modified
>> > version of Stefan's original XSL file - all I did was enclose
>> > all the node
>> > names with double quotes.
>> >
>> > Let me know if you want this contributed to Ant's CVS.  This
>> > would even make
>> > a handy custom Ant task, to wrap calling dot.exe - although
>> > I'll get by with
>> > <xslt> and <exec> for now.
>> >
>> > Very nice, Stefan.
>> >
>> > Thanks,
>> >     Erik
>> >
>> > ----- Original Message -----
>> > From: "Erik Hatcher" <ja...@ehatchersolutions.com>
>> > To: "Ant Users List" <an...@jakarta.apache.org>
>> > Sent: Wednesday, June 05, 2002 7:58 PM
>> > Subject: Re: xsl script to generate graphical representation
>> > of build.xml
>> >
>> >
>> > > This looks pretty slick.  I tried it out and got this while
>> > running 'dot'
>> > >
>> > > graph parser: syntax error near line 18
>> > > context:    >>>  do- <<< common [label="do-common\n"];
>> > >
>> > > Looks like it doesn't like dashes in target names.  Is
>> > there a way to have
>> > > them escaped in the .dot files?  Would you modify it so
>> > that it could work
>> > > in such cases?  It still generated a .png, but it looked incomplete.
>> > >
>> > > Many thanks for this contribution.  Would you mind this
>> > being committed to
>> > > Ant's CVS for inclusion into Ant 1.6?  If so, let me know.
>> > >
>> > >     Erik
>> > >
>> > > ----- Original Message -----
>> > > From: "Stefan Kost" <s....@webmacher.de>
>> > > To: "Ant Users List" <an...@jakarta.apache.org>
>> > > Cc: <an...@jakarta.apache.org>
>> > > Sent: Wednesday, June 05, 2002 4:50 AM
>> > > Subject: xsl script to generate graphical representation of
>> > build.xml
>> > >
>> > >
>> > > > hi,
>> > > >
>> > > > attached you find a xsl script, which generates a .dot out of a
>> > > > build.xml file. The dot file can be rendered using the
>> > dot command (from
>> > > > the graphviz package, see http://www.graphviz.org/) to
>> > lots of formats
>> > > > like ps or png.
>> > > > Minimal instructions are in the xsl file.
>> > > >
>> > > > Stefan
>> > > > --
>> > > >
>> > > >  < W E B M A C H E R >
>> > > > EDV+INTERNETSERVICE GMBH
>> > > >
>> > > > POST: August Bebel Str. 69
>> > > >       04275 Leipzig
>> > > >
>> > > > FON:  +49 341 30 34 833
>> > > > FAX:  +49 341 30 34 840
>> > > > WEB:  www.webmacher.de
>> > > >
>> > >
>> > >
>> > >
>> > --------------------------------------------------------------
>> > ------------
>> > --
>> > > ----
>> > >
>> > >
>> > > > --
>> > > > To unsubscribe, e-mail:
>> > <ma...@jakarta.apache.org>
>> > > > For additional commands, e-mail:
>> > <ma...@jakarta.apache.org>
>> > >
>> > >
>> > > --
>> > > To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> > For additional commands, e-mail:
><ma...@jakarta.apache.org>
>> >
>> >
>>
>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: xsl script to generate graphical representation of build.xml

Posted by Stefan Kost <s....@webmacher.de>.
Hi Fred,
> Uhm,
> 
> Could someone make all the needed files available somewhere, being both the stylesheet and the tool (including all the needed
> libraries) ??
You don't need additional libraries. Graphiviz is availsable for
download at www.graphviz.org (it's a c-package) and it compiles find
under both ;-) systems linux and windows (I run it under solaris and
even amigaos!).

Stefan
> 
> Thanx, Fred
> 
> *********** REPLY SEPARATOR  ***********
> 
> On 06.06.02 at 16:55 Chris Bailey wrote:
> 
> >I should also add, it'd be cool if someone enhanced this so that targets
> >that call other targets in the same file (i.e. via <antcall>) are graphed.
> >
> >-----Original Message-----
> >From: Chris Bailey [mailto:chris@codeintensity.com]
> >Sent: Thursday, June 06, 2002 4:50 PM
> >To: Ant Users List
> >Subject: RE: xsl script to generate graphical representation of
> >build.xml
> >
> >
> >FYI, I set this up on my Linux box, and needed to change the font specified
> >in ant2dot.xsl.  I changed it from "Arial" to "verdana", but you may need
> >to
> >fiddle around depending on what fonts you have.  I wasn't able to specify a
> >font name that had dashes in it (which may just be due to my lack of
> >knowing
> >how to make that work in the XSL file).
> >
> >-----Original Message-----
> >From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> >Sent: Thursday, June 06, 2002 2:10 PM
> >To: ant-user@jakarta.apache.org
> >Subject: Re: xsl script to generate graphical representation of
> >build.xml
> >
> >
> >Very cool, thanks Nascif.
> >
> >I've whipped up a simple build file to automate this:
> >
> ><project name="diagram" default="main">
> >
> >  <target name="build-dot">
> >    <xslt in="build.xml"
> >          style="${ant.home}/etc/ant2dot.xsl"
> >          out="dotfile.dot"
> >    />
> >  </target>
> >
> >  <target name="diagram" depends="build-dot">
> >    <exec executable="c:\tools\graphviz\bin\dot.exe">
> >      <arg value="-Tpng"/>
> >      <arg file="dotfile.dot"/>
> >      <arg value="-obuild.png"/>
> >    </exec>
> >  </target>
> >
> >  <target name="main" depends="diagram"/>
> ></project>
> >
> >Of course hard-coded paths and such need to be factored out to properties,
> >but thats not high on my to-do list!  :)  I call it like this from any
> >directory:
> >
> >    ant -f <path to this file>/diagram.xml -Dbasedir=.
> >
> >and it diagrams the build.xml in my current directory.
> >
> >I, as you can tell, put the XSL file in ANT_HOME/etc.  Do folks want this
> >file in Ant's codebase and distribution? Any objections?  Stefan?
> >
> >    Erik
> >
> >
> >
> >----- Original Message -----
> >From: "Nascif Abousalh-Neto" <na...@nortelnetworks.com>
> >To: "Erik Hatcher" <ja...@ehatchersolutions.com>; "Ant Users List"
> ><an...@jakarta.apache.org>
> >Cc: <s....@webmacher.de>
> >Sent: Thursday, June 06, 2002 4:10 PM
> >Subject: RE: xsl script to generate graphical representation of build.xml
> >
> >
> >> That is really cool! I tried Erik's version and found some small
> >problems:
> >>  - It was not supressing text inside tags, like you would have in
> >embedded
> >> scripts and the project description. The XSL default is to print text
> >> elements, and that was breaking dot.
> >>  - The arrow orientation was counter-intuitive, so I inverted then. IMHO
> >it
> >> makes more sense if the dependent points to its depency, specially when a
> >a
> >> node depends on many others (like an "all" target).
> >>
> >> The attached .xsl file solves both problems. Also attached some examples.
> >>
> >> Enjoy,
> >> Nascif
> >>
> >>
> >> > -----Original Message-----
> >> > From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> >> > Sent: Wednesday, June 05, 2002 8:27 PM
> >> > To: Ant Users List
> >> > Subject: Re: xsl script to generate graphical representation of
> >> > build.xml
> >> >
> >> >
> >> > Eager to see what this thing could do with my build files, I
> >> > *gasp* read the
> >> > docs and found exactly what I needed.  Attached is a slightly modified
> >> > version of Stefan's original XSL file - all I did was enclose
> >> > all the node
> >> > names with double quotes.
> >> >
> >> > Let me know if you want this contributed to Ant's CVS.  This
> >> > would even make
> >> > a handy custom Ant task, to wrap calling dot.exe - although
> >> > I'll get by with
> >> > <xslt> and <exec> for now.
> >> >
> >> > Very nice, Stefan.
> >> >
> >> > Thanks,
> >> >     Erik
> >> >
> >> > ----- Original Message -----
> >> > From: "Erik Hatcher" <ja...@ehatchersolutions.com>
> >> > To: "Ant Users List" <an...@jakarta.apache.org>
> >> > Sent: Wednesday, June 05, 2002 7:58 PM
> >> > Subject: Re: xsl script to generate graphical representation
> >> > of build.xml
> >> >
> >> >
> >> > > This looks pretty slick.  I tried it out and got this while
> >> > running 'dot'
> >> > >
> >> > > graph parser: syntax error near line 18
> >> > > context:    >>>  do- <<< common [label="do-common\n"];
> >> > >
> >> > > Looks like it doesn't like dashes in target names.  Is
> >> > there a way to have
> >> > > them escaped in the .dot files?  Would you modify it so
> >> > that it could work
> >> > > in such cases?  It still generated a .png, but it looked incomplete.
> >> > >
> >> > > Many thanks for this contribution.  Would you mind this
> >> > being committed to
> >> > > Ant's CVS for inclusion into Ant 1.6?  If so, let me know.
> >> > >
> >> > >     Erik
> >> > >
> >> > > ----- Original Message -----
> >> > > From: "Stefan Kost" <s....@webmacher.de>
> >> > > To: "Ant Users List" <an...@jakarta.apache.org>
> >> > > Cc: <an...@jakarta.apache.org>
> >> > > Sent: Wednesday, June 05, 2002 4:50 AM
> >> > > Subject: xsl script to generate graphical representation of
> >> > build.xml
> >> > >
> >> > >
> >> > > > hi,
> >> > > >
> >> > > > attached you find a xsl script, which generates a .dot out of a
> >> > > > build.xml file. The dot file can be rendered using the
> >> > dot command (from
> >> > > > the graphviz package, see http://www.graphviz.org/) to
> >> > lots of formats
> >> > > > like ps or png.
> >> > > > Minimal instructions are in the xsl file.
> >> > > >
> >> > > > Stefan
> >> > > > --
> >> > > >
> >> > > >  < W E B M A C H E R >
> >> > > > EDV+INTERNETSERVICE GMBH
> >> > > >
> >> > > > POST: August Bebel Str. 69
> >> > > >       04275 Leipzig
> >> > > >
> >> > > > FON:  +49 341 30 34 833
> >> > > > FAX:  +49 341 30 34 840
> >> > > > WEB:  www.webmacher.de
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > --------------------------------------------------------------
> >> > ------------
> >> > --
> >> > > ----
> >> > >
> >> > >
> >> > > > --
> >> > > > To unsubscribe, e-mail:
> >> > <ma...@jakarta.apache.org>
> >> > > > For additional commands, e-mail:
> >> > <ma...@jakarta.apache.org>
> >> > >
> >> > >
> >> > > --
> >> > > To unsubscribe, e-mail:
> >> <ma...@jakarta.apache.org>
> >> > For additional commands, e-mail:
> ><ma...@jakarta.apache.org>
> >> >
> >> >
> >>
> >>
> >
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> >For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
-- 

 < W E B M A C H E R > 
EDV+INTERNETSERVICE GMBH

POST: August Bebel Str. 69
      04275 Leipzig

FON:  +49 341 30 34 833
FAX:  +49 341 30 34 840
WEB:  www.webmacher.de


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>