You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/11/06 13:48:46 UTC
svn commit: r592406 - in
/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc:
AntDocTask.java GenerateHTMLDoc.java
Author: vsiveton
Date: Tue Nov 6 04:48:44 2007
New Revision: 592406
URL: http://svn.apache.org/viewvc?rev=592406&view=rev
Log:
o added dotExecutable parameter
o change signature for some getter/setter
Modified:
maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/AntDocTask.java
maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/GenerateHTMLDoc.java
Modified: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/AntDocTask.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/AntDocTask.java?rev=592406&r1=592405&r2=592406&view=diff
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/AntDocTask.java (original)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/AntDocTask.java Tue Nov 6 04:48:44 2007
@@ -41,6 +41,9 @@
/** Destination directory */
private File destDir;
+ /** Graphviz Dot executable file */
+ private File dotExecutable;
+
/** Terminate Ant build */
private boolean failOnError;
@@ -65,6 +68,16 @@
}
/**
+ * Set the the dotExecutable to set
+ *
+ * @param dotExecutable the dotExecutable to set
+ */
+ public void setDotExecutable( File dotExecutable )
+ {
+ this.dotExecutable = dotExecutable;
+ }
+
+ /**
* Set fail on an error.
*
* @param b true to fail on an error.
@@ -100,6 +113,7 @@
try
{
GenerateHTMLDoc generator = new GenerateHTMLDoc( this.antFile, this.destDir );
+ generator.setDotExecutable( this.dotExecutable );
generator.generateDoc();
}
catch ( IllegalArgumentException e )
Modified: maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/GenerateHTMLDoc.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/GenerateHTMLDoc.java?rev=592406&r1=592405&r2=592406&view=diff
==============================================================================
--- maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/GenerateHTMLDoc.java (original)
+++ maven/sandbox/trunk/jxr/maven-jxr/maven-jxr-ant/src/main/java/org/apache/maven/jxr/ant/doc/GenerateHTMLDoc.java Tue Nov 6 04:48:44 2007
@@ -43,7 +43,8 @@
/**
* Generate HTML documentation for <a href="http://ant.apache.org/">Ant</a> file.
* <br/>
- * <b>Note</b>: <a href="http://www.graphviz.org/">Graphviz</a> program should be in the path.
+ * <b>Note</b>: <a href="http://www.graphviz.org/">Graphviz</a> dot program should be in the path or specified
+ * by <code>dotExecutable</code> parameter.
*
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
* @version $Id$
@@ -56,6 +57,9 @@
/** Destination directory */
private File destDir;
+ /** Graphviz Dot executable file */
+ private File dotExecutable;
+
/** Temp xsl file */
private File xml2dot;
@@ -109,6 +113,62 @@
}
/**
+ * @return the Ant file which be parsed.
+ */
+ public File getAntFile()
+ {
+ return this.antFile;
+ }
+
+ /**
+ * @return the dest dir
+ */
+ public File getDestDir()
+ {
+ return this.destDir;
+ }
+
+ /**
+ * Getter for the dotExecutable
+ *
+ * @return the dotExecutable
+ */
+ public File getDotExecutable()
+ {
+ return this.dotExecutable;
+ }
+
+ /**
+ * Setter for the antFile
+ *
+ * @param antFile the antFile to set
+ */
+ public void setAntFile( File antFile )
+ {
+ this.antFile = antFile;
+ }
+
+ /**
+ * Setter for the destDir
+ *
+ * @param destDir the destDir to set
+ */
+ public void setDestDir( File destDir )
+ {
+ this.destDir = destDir;
+ }
+
+ /**
+ * Setter for the dotExecutable
+ *
+ * @param dotExecutable the dotExecutable to set
+ */
+ public void setDotExecutable( File dotExecutable )
+ {
+ this.dotExecutable = dotExecutable;
+ }
+
+ /**
* Generate the documentation.
*
* @throws DotNotPresentInPathException if any
@@ -171,22 +231,6 @@
// ----------------------------------------------------------------------
/**
- * @return the Ant file which be parsed.
- */
- private File getAntFile()
- {
- return this.antFile;
- }
-
- /**
- * @return the dest dir
- */
- private File getDestDir()
- {
- return this.destDir;
- }
-
- /**
* @return xsl temp file.
* @throws IOException if any
*/
@@ -369,7 +413,14 @@
{
String format = dotFormat[i];
- DotUtil.executeDot( getDot(), format, new File( getDestDir(), "vizant." + format ) );
+ if ( getDotExecutable() != null )
+ {
+ DotUtil.executeDot( getDotExecutable(), getDot(), format, new File( getDestDir(), "vizant." + format ) );
+ }
+ else
+ {
+ DotUtil.executeDot( getDot(), format, new File( getDestDir(), "vizant." + format ) );
+ }
}
}