Git Product home page Git Product logo

grand's Introduction

Description
-----------

Grand is a tool to create visual representation of Ant target dependencies.
It works by taking a Ant build file and creating a DOT language file. This
file needs to be post-processed with Graphviz to produce the actual graph.


Usage
-----

Grand's front end is an Ant task that must be defined with the following line:

   <typedef resource="net/ggtools/grand/antlib.xml"/>

You may have to add attribute classpath="path_to_grand.jar" if the grand jar
isn't already in the classpath.

The grand task takes the following attributes:

  output            name of the output file (mandatory).

  buildfile         name of the build file to graph. If omitted, the current
                    build file will be used.

  outputconfigfile  a property file to configure the output.

  showgraphname     if true, the generated graph will have the Ant project's
                    name displayed a the graph label.

  inheritall        If true, the properties of the current build file will be
                    passed to the graphed build file. The default is not to
                    pass the properties to the graphed project.

Beside these attributes, the task can take as nested elements: property,
propertyset and filter. The first two are the standard Ant elements and are
used to pass properties to the graphed project.

The filter element is used to apply filter on the full graph. The filter
element accepts the following attributes:

  name      filter name. Can be one of isolatednode, missingnode,
            fromnode, tonode, connected or prefixed; mandatory.

  node      node name. Depending of the selected filter, this attribute
            can have different meanings and may or may not be mandatory.

Isolated node
    Removes isolated nodes (i.e.: nodes with no links) from the graph. The
    node attribute is not used by this filter.

Missing node
    Removes nodes created when a link make reference to a nonexistent one.
    The node attribute is not used by this filter.

From node
    Keeps only a selected node and the nodes it depends upon. The node
    parameter is the name of the node to start from.

To node
    Keeps only a selected node and the nodes depending upon it. The node
    parameter is the name of the node to start from.

Connected
    Keeps only a selected node and the nodes connected to it. The node
    parameter is the name of the node to start from.

Prefixed
    Removes prefixed nodes created by <import/> in Ant 1.8+ that may
    clutter the graph. The node attribute is not used by this filter.


Examples
--------

The simplest form:

	<grand output="build.dot"/>

Create a build.dot graph file using the current build file. Add a buildfile
attribute to process another file:

	<grand output="build.dot" buildfile="ant-build.xml"/>

A two filter example:

	<grand output="build.dot" buildfile="ant-build.xml">
	    <filter name="fromnode" node="dist"/>
	    <filter name="tonode" node="prepare"/>
	</grand>


Known issues
------------

Subant dependencies on tasks not yet processed before invoking the grand task.
For instance in the following pseudo-build.xml:

    <target name="subant-task-1">
        <subant .../>
    </target>

    <target name="subant-task-2">
        <subant .../>
    </target>

	<target name="dograph">
		<grand .../>
	</target>

Running "ant dograph" will get all the subant dependencies, while running
"ant subant-task-1 dograph" will only get dependencies from "subant-task-2"
and running "ant subant-task-1 subant-task-2 dograph" won't get any subant
dependencies at all.


More information
----------------

The Grand web site (https://ant-grand.github.io/Grand/grand.html) contains the full
documentation for Grand with some illustrated examples and the latest version.

You can contact me at [email protected].


Licensing
---------
 
This software is licensed under the terms you may find in the file
named "LICENSE" in this directory.

grand's People

Contributors

dependabot[bot] avatar ggtools avatar pendor avatar twogee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grand's Issues

Black-on-black Main nodes w/ Graphviz dot command (Warning: lime is not a known color)

Using the Graphviz dot command from at least Graphviz versions 2.26.3 (20100126.1600) and 2.38.0 (20140413.2041) on a Grand generated dot file gives the error "Warning: lime is not a known color" and results in all Main nodes rendered as black text on a black background.

Graphviz's dot command uses the x11 color scheme by default, but the color 'lime' is only available in the svg color scheme. Declaring colorscheme=svg in the dot file would fix this, but as the svg scheme isn't available in older versions of Graphviz, switching the color declaration to 'limegreen' would work with the default x11 color scheme on all versions of Graphviz.

Note: Platform is Mac OS X 10.10 w/ Graphviz installed via Gentoo portage (2.26.3) and then via HomeBrew (2.38.0) with identical results on both.

Loading build file with javascript task fails with "Unable to create javax script engine for javascript"

Opening a build file that includes a javascript task (using <scriptdef>), fails with "Unable to create javax script engine for javascript".

Sample output (from error dialog details):

Cannot open graph
Cannot open project file C:\source\trunk\src\build\build.xml
  Cannot open project file C:\source\trunk\src\build\build.xml
  Cannot open project file C:\source\trunk\src\build\build.xml
  The following error occurred while executing this line:
C:\source\trunk\src\build\build-common\build-common.xml:62: Unable to create javax script engine for javascript
  The following error occurred while executing this line:
C:\source\trunk\src\build\build-common\build-common.xml:62: Unable to create javax script engine for javascript
  Unable to create javax script engine for javascript
  Unable to create javax script engine for javascript

I tried with Java 17 (OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing)) and Java 1.8 (OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.282-b08, mixed mode))

Also note that the javascript task definition and the first execution is in an "included" ant file.

subant doesn't support the nested "target" element.

hello Christophe:

I want to get ant target dependencies of android project "build.xml" script, then get into trouble, RT

This is my build script (and my android sdk version is "adt-bundle-linux-x86_64-20130522")

<?xml version="1.0" encoding="UTF-8"?>

<project name="create-and-diagram" default="create-diagram">

  <target name="create-diagram"> 
    <property name="grand.home" value="/home/luogw/dev-tool/grand-1.8" />
    <property name="grand.output.file" value="build.dot" />
    <property name="file.type" value="pdf"/> 

    <taskdef name="grand" classname="net.ggtools.grand.tasks.GrandTask" classpath ="${grand.home}/grand-1.8.jar" />
    <!-- build.xml copy from [sdk.home]/tools/ant -->
    <grand output="${grand.output.file}" buildfile="build.xml"/> 
    <exec executable="dot"> 
      <arg line="-T${file.type} -Gsize=11.69,8.27 -Grotate=90 -o build.${file.type} ${grand.output.file}"/> 
    </exec> 
  </target> 

</project>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.