bodewig 2002/08/13 13:06:49
Modified: docs Tag: ANT_15_BRANCH external.html
src/main/org/apache/tools/ant/taskdefs/optional/jsp Tag:
ANT_15_BRANCH JspC.java
src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers
Tag: ANT_15_BRANCH DefaultJspCompilerAdapter.java
JasperC.java JspCompilerAdapterFactory.java
xdocs Tag: ANT_15_BRANCH external.xml
Log:
Merge in Steve's changes from HEAD
Revision Changes Path
No revision
No revision
1.48.2.8 +146 -60 jakarta-ant/docs/external.html
Index: external.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/external.html,v
retrieving revision 1.48.2.7
retrieving revision 1.48.2.8
diff -u -r1.48.2.7 -r1.48.2.8
--- external.html 22 Jul 2002 12:55:25 -0000 1.48.2.7
+++ external.html 13 Aug 2002 20:06:48 -0000 1.48.2.8
@@ -1272,6 +1272,66 @@
<table border="0" cellspacing="0"
cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="Jing Task"><strong>Jing Task</strong></a>
+ </font>
+ </td></tr>
+ <tr><td>
+ <blockquote>
+ <p> Validates XML files against the RELAX NG
alternative to XML Schema.
+ The Jing task for Ant allows you to efficiently validate
+ multiple files against multiple RELAX NG patterns and integrate
+ RELAX NG validation with other XML processing.</p>
+ <table>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Compatibility:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Ant 1.4 and later
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ URL:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ <a href="http://www.thaiopensource.com/relaxng/jing-ant.html">
+ http://www.thaiopensource.com/relaxng/jing-ant.html</a>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ License:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ BSD-like
+ </font>
+ </td>
+ </tr>
+ </table>
+ </blockquote>
+ </td></tr>
+ </table>
+ <table border="0" cellspacing="0"
cellpadding="2" width="100%">
+ <tr><td bgcolor="#828DA6">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
<a name="jMetra"><strong>jMetra</strong></a>
</font>
</td></tr>
@@ -1354,6 +1414,92 @@
<table border="0" cellspacing="0"
cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
+ <a name="JNI"><strong>JNI</strong></a>
+ </font>
+ </td></tr>
+ <tr><td>
+ <blockquote>
+ <p>
+
+ JNI is a free toolkit that makes easy work of
+ integrating Java and C through the Java Native
+ Interface (JNI). It includes a code generator that
+ generates both Java "proxy" classes to access C
+ "peer" classes, and C "proxy" classes to access
+ Java "peer" classes or interfaces. It also
+ includes a core library with a simplified JVM
+ interface as well as "helper" classes to ease
+ working with the JNI data types. The code
+ generation is driven by an XML project file that
+ can be created with the assistance of the GUI
+ Project Manager. The code generation can be
+ invoked either from Ant or from the
+ GUI. Includes a comprehensive printable PDF User
+ Guide and plenty of examples.</p>
+ <table>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Compatibility:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Ant 1.4
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ URL:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ <a href="http://jnipp.sf.net/">http://jnipp.sf.net/</a>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Contact:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ <a href="mailto:[EMAIL PROTECTED]">Phillip E. Trewhella</a>
+ </font>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#039acc" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ License:
+ </font>
+ </td>
+ <td bgcolor="#a0ddf0" colspan="" rowspan=""
+ valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ GNU LGPL
+ </font>
+ </td>
+ </tr>
+ </table>
+ </blockquote>
+ </td></tr>
+ </table>
+ <table border="0" cellspacing="0"
cellpadding="2" width="100%">
+ <tr><td bgcolor="#828DA6">
+ <font color="#ffffff" face="arial,helvetica,sanserif">
<a name="PMD"><strong>PMD</strong></a>
</font>
</td></tr>
@@ -1929,66 +2075,6 @@
valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
GNU General Public License
- </font>
- </td>
- </tr>
- </table>
- </blockquote>
- </td></tr>
- </table>
- <table border="0" cellspacing="0"
cellpadding="2" width="100%">
- <tr><td bgcolor="#828DA6">
- <font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="Jing Task"><strong>Jing Task</strong></a>
- </font>
- </td></tr>
- <tr><td>
- <blockquote>
- <p> Validates XML files against the RELAX NG
alternative to XML Schema.
- The Jing task for Ant allows you to efficiently validate
- multiple files against multiple RELAX NG patterns and integrate
- RELAX NG validation with other XML processing.</p>
- <table>
- <tr>
- <td bgcolor="#039acc" colspan="" rowspan=""
- valign="top" align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- Compatibility:
- </font>
- </td>
- <td bgcolor="#a0ddf0" colspan="" rowspan=""
- valign="top" align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- Ant 1.4 and later
- </font>
- </td>
- </tr>
- <tr>
- <td bgcolor="#039acc" colspan="" rowspan=""
- valign="top" align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- URL:
- </font>
- </td>
- <td bgcolor="#a0ddf0" colspan="" rowspan=""
- valign="top" align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- <a href="http://www.thaiopensource.com/relaxng/jing-ant.html">
- http://www.thaiopensource.com/relaxng/jing-ant.html</a>
- </font>
- </td>
- </tr>
- <tr>
- <td bgcolor="#039acc" colspan="" rowspan=""
- valign="top" align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- License:
- </font>
- </td>
- <td bgcolor="#a0ddf0" colspan="" rowspan=""
- valign="top" align="left">
- <font color="#000000" size="-1" face="arial,helvetica,sanserif">
- BSD-like
</font>
</td>
</tr>
No revision
No revision
1.16.2.4 +97 -61
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
retrieving revision 1.16.2.3
retrieving revision 1.16.2.4
diff -u -r1.16.2.3 -r1.16.2.4
--- JspC.java 22 Jun 2002 23:40:23 -0000 1.16.2.3
+++ JspC.java 13 Aug 2002 20:06:48 -0000 1.16.2.4
@@ -56,18 +56,15 @@
import java.io.File;
import java.util.Date;
-
-import java.util.Vector;
import java.util.Enumeration;
-
+import java.util.Vector;
+import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
-
import org.apache.tools.ant.taskdefs.MatchingTask;
import
org.apache.tools.ant.taskdefs.optional.jsp.compilers.JspCompilerAdapter;
import
org.apache.tools.ant.taskdefs.optional.jsp.compilers.JspCompilerAdapterFactory;
-
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
@@ -111,6 +108,7 @@
public class JspC extends MatchingTask {
/* ------------------------------------------------------------ */
private Path classpath;
+ private Path compilerClasspath;
private Path src;
private File destDir;
private String packageName ;
@@ -130,17 +128,10 @@
* flag to control action on execution trouble
*/
protected boolean failOnError = true;
-
- /**
- * -uribase <dir> The uri directory compilations should be
relative to
- * (Default is "/")
- */
-
- private File uribase;
/**
* -uriroot <dir> The root directory that uri files should be
resolved
- * against,
+ * against,
*/
private File uriroot;
@@ -161,7 +152,7 @@
protected WebAppParameter webApp;
-
+
private static final String FAIL_MSG
= "Compile failed, messages should have been provided.";
/* ------------------------------------------------------------ */
@@ -201,7 +192,7 @@
public String getPackage(){
return packageName;
}
-
+
/* ------------------------------------------------------------ */
/**
* Set the verbose level of the compiler
@@ -212,10 +203,11 @@
public int getVerbose(){
return verbose;
}
-
+
/* ------------------------------------------------------------ */
/**
- * should the build halt if compilation fails? default=true
+ * Whether or not the build should halt if compilation fails.
+ * Defaults to <code>true</code>.
*/
public void setFailonerror(boolean fail) {
failOnError = fail;
@@ -236,7 +228,12 @@
public void setIeplugin(String iepluginid_) {
iepluginid = iepluginid_;
}
- /* ------------------------------------------------------------ */
+
+ /**
+ * If true, generate separate write() calls for each HTML line
+ * in the JSP.
+ * @return mapping status
+ */
public boolean isMapped() {
return mapped;
}
@@ -247,7 +244,7 @@
public void setMapped(boolean mapped_) {
mapped = mapped_;
}
-
+
/**
* The URI context of relative URI references in the JSP pages.
* If it does not exist then it is derived from the location
@@ -256,7 +253,7 @@
* @param uribase The new Uribase value
*/
public void setUribase(File uribase) {
- this.uribase = uribase;
+ log( "Uribase is currently an unused parameter", Project.MSG_WARN);
}
public File getUribase() {
@@ -276,9 +273,8 @@
public File getUriroot() {
return uriroot;
}
-
-
- /* ------------------------------------------------------------ */
+
+
/**
* Set the classpath to be used for this compilation.
*/
@@ -295,7 +291,7 @@
*/
public Path createClasspath() {
if (classpath == null) {
- classpath = new Path(project);
+ classpath = new Path(getProject());
}
return classpath.createPath();
}
@@ -311,6 +307,34 @@
}
/**
+ * Set the classpath to be used to find this compiler adapter
+ */
+ public void setCompilerclasspath(Path cp) {
+ if (compilerClasspath == null) {
+ compilerClasspath = cp;
+ } else {
+ compilerClasspath.append(cp);
+ }
+ }
+
+ /**
+ * get the classpath used to find the compiler adapter
+ */
+ public Path getCompilerclasspath(){
+ return compilerClasspath;
+ }
+
+ /**
+ * Support nested compiler classpath, used to locate compiler adapter
+ */
+ public Path createCompilerclasspath() {
+ if (compilerClasspath == null) {
+ compilerClasspath = new Path(getProject());
+ }
+ return compilerClasspath.createPath();
+ }
+
+ /**
* Filename for web.xml.
*
* @param webxml The new Webxml value
@@ -319,10 +343,14 @@
this.webxml = webxml;
}
+ /**
+ * Filename for web.xml.
+ * @return
+ */
public File getWebxml() {
return this.webxml;
}
-
+
/**
* output filename for the fraction of web.xml that lists
* servlets.
@@ -331,17 +359,17 @@
public void setWebinc(File webinc) {
this.webinc = webinc;
}
-
+
public File getWebinc() {
return this.webinc;
}
-
+
/**
* Adds a single webapp.
*
* @param webappParam add a web app parameter
*/
- public void addWebApp(WebAppParameter webappParam)
+ public void addWebApp(WebAppParameter webappParam)
throws BuildException {
//demand create vector of filesets
if (webApp == null) {
@@ -368,36 +396,44 @@
public Vector getCompileList(){
return compileList;
}
-
+
/**
* execute by building up a list of files that
* have changed and hand them off to a jsp compiler
*/
public void execute()
throws BuildException {
- // first off, make sure that we've got a srcdir
- if (src == null) {
- throw new BuildException("srcdir attribute must be set!",
- location);
- }
- String [] list = src.list();
- if (list.length == 0) {
- throw new BuildException("srcdir attribute must be set!",
- location);
- }
-
if (destDir != null && !destDir.isDirectory()) {
throw new
BuildException("destination directory \"" + destDir +
"\" does not exist or is not a directory",
- location);
+ getLocation());
}
File dest = getActualDestDir();
//bind to a compiler
JspCompilerAdapter compiler =
- JspCompilerAdapterFactory.getCompiler(compilerName, this);
+ JspCompilerAdapterFactory.getCompiler(compilerName, this,
+ new AntClassLoader(getProject(), compilerClasspath));
+
+ //if we are a webapp, hand off to the compiler, which had better
handle it
+ if(webApp!=null) {
+ doCompilation(compiler);
+ return;
+ }
+
+ // make sure that we've got a srcdir
+ if (src == null) {
+ throw new BuildException("srcdir attribute must be set!",
+ location);
+ }
+ String [] list = src.list();
+ if (list.length == 0) {
+ throw new BuildException("srcdir attribute must be set!",
+ location);
+ }
+
// if the compiler does its own dependency stuff, we just call it
right now
if (compiler.implementsOwnDependencyChecking()) {
@@ -413,10 +449,10 @@
resetFileLists();
int filecount = 0;
for (int i = 0; i < list.length; i++) {
- File srcDir = (File) project.resolveFile(list[i]);
+ File srcDir = (File) getProject().resolveFile(list[i]);
if (!srcDir.exists()) {
throw new BuildException("srcdir \"" + srcDir.getPath() +
- "\" does not exist!", location);
+ "\" does not exist!",
getLocation());
}
DirectoryScanner ds = this.getDirectoryScanner(srcDir);
String[] files = ds.getIncludedFiles();
@@ -472,14 +508,13 @@
// finally, lets execute the compiler!!
if (!compiler.execute()) {
if (failOnError) {
- throw new BuildException(FAIL_MSG, location);
+ throw new BuildException(FAIL_MSG, getLocation());
} else {
log(FAIL_MSG, Project.MSG_ERR);
}
}
}
- /* ------------------------------------------------------------ */
/**
* Clear the list of files to be compiled and copied..
*/
@@ -487,7 +522,6 @@
compileList.removeAllElements();
}
- /* ------------------------------------------------------------ */
/**
* Scans the directory looking for source files to be compiled.
* The results are returned in the class variable compileList
@@ -500,6 +534,9 @@
String filename = files[i];
File srcFile = new File(srcDir, filename);
File javaFile = mapToJavaFile(mangler, srcFile, srcDir, dest);
+ if(javaFile==null) {
+ continue;
+ }
if (srcFile.lastModified() > now) {
log("Warning: file modified in the future: " + filename,
@@ -515,7 +552,7 @@
}
/**
- * Test whether or not compilation is needed. A return value of
+ * Test whether or not compilation is needed. A return value of
* <code>true<code> means yes, <code>false</code> means
* our tests do not indicate this, but as the TLDs are
* not used for dependency checking this is not guaranteed.
@@ -534,20 +571,20 @@
boolean shouldCompile = false;
if (!javaFile.exists()) {
shouldCompile = true;
- log("Compiling " + srcFile.getPath()
- + " because java file " + javaFile.getPath()
+ log("Compiling " + srcFile.getPath()
+ + " because java file " + javaFile.getPath()
+ " does not exist", Project.MSG_VERBOSE);
} else {
if (srcFile.lastModified() > javaFile.lastModified()) {
shouldCompile = true;
- log("Compiling " + srcFile.getPath()
- + " because it is out of date with respect to "
+ log("Compiling " + srcFile.getPath()
+ + " because it is out of date with respect to "
+ javaFile.getPath(),
Project.MSG_VERBOSE);
} else {
if (javaFile.length() == 0) {
shouldCompile = true;
- log("Compiling " + srcFile.getPath()
+ log("Compiling " + srcFile.getPath()
+ " because java file " + javaFile.getPath()
+ " is empty", Project.MSG_VERBOSE);
}
@@ -567,7 +604,6 @@
}
String javaFileName = mangler.mapJspToJavaName(srcFile);
// String srcFileDir=srcFile.getParent();
- String packageNameIn = srcFile.getAbsolutePath();
return new File(dest, javaFileName);
}
@@ -593,7 +629,7 @@
* static inner class used as a parameter element
*/
public static class WebAppParameter {
-
+
/**
* the sole option
*/
@@ -602,18 +638,18 @@
/**
* query current directory
*/
-
+
public File getDirectory() {
return directory;
}
-
- /**
- * set directory; alternate syntax
- */
+
+ /**
+ * set directory; alternate syntax
+ */
public void setBaseDir(File directory) {
this.directory = directory;
}
- //end inner class
+ //end inner class
}
No revision
No revision
1.4.2.2 +3 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java
Index: DefaultJspCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -r1.4.2.1 -r1.4.2.2
--- DefaultJspCompilerAdapter.java 7 May 2002 00:28:23 -0000 1.4.2.1
+++ DefaultJspCompilerAdapter.java 13 Aug 2002 20:06:49 -0000 1.4.2.2
@@ -54,15 +54,13 @@
package org.apache.tools.ant.taskdefs.optional.jsp.compilers;
+import java.io.File;
+import java.util.Enumeration;
+import java.util.Vector;
import org.apache.tools.ant.Project;
-
import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
import org.apache.tools.ant.types.CommandlineJava;
-import java.util.Vector;
-import java.util.Enumeration;
-import java.io.File;
-
/**
* This is the default implementation for the JspCompilerAdapter interface.
* This is currently very light on the ground since only one compiler type is
@@ -73,10 +71,8 @@
public abstract class DefaultJspCompilerAdapter
implements JspCompilerAdapter {
- /* ------------------------------------------------------------ */
private static String lSep = System.getProperty("line.separator");
- /* ------------------------------------------------------------ */
/**
* Logs the compilation parameters, adds the files to compile and logs
the
* "niceSourceList"
1.8.2.2 +9 -7
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java
Index: JasperC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -r1.8.2.1 -r1.8.2.2
--- JasperC.java 7 May 2002 00:28:23 -0000 1.8.2.1
+++ JasperC.java 13 Aug 2002 20:06:49 -0000 1.8.2.2
@@ -54,17 +54,15 @@
package org.apache.tools.ant.taskdefs.optional.jsp.compilers;
+import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.CommandlineJava;
-import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.taskdefs.Java;
import org.apache.tools.ant.taskdefs.optional.jsp.JspC;
import org.apache.tools.ant.taskdefs.optional.jsp.JspMangler;
import org.apache.tools.ant.taskdefs.optional.jsp.JspNameMangler;
-import org.apache.tools.ant.taskdefs.Java;
-import org.apache.tools.ant.taskdefs.ExecuteJava;
-
-import java.io.File;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.Path;
/**
* The implementation of the jasper compiler.
@@ -106,10 +104,13 @@
// REVISIT. ugly.
Java java = (Java) (getProject().createTask("java"));
if (getJspc().getClasspath() != null) {
+ getProject().log("using user supplied classpath:
"+getJspc().getClasspath(),
+ Project.MSG_DEBUG);
java.setClasspath(getJspc().getClasspath());
} else {
Path classpath=new Path(getProject());
- classpath.concatSystemClasspath();
+ classpath=classpath.concatSystemClasspath("only");
+ getProject().log("using system classpath: "+classpath,
Project.MSG_DEBUG);
java.setClasspath(classpath);
}
java.setDir(getProject().getBaseDir());
@@ -123,6 +124,7 @@
//we are forking here to be sure that if JspC calls
//System.exit() it doesn't halt the build
java.setFork(true);
+ java.setTaskName("jasperc");
java.execute();
return true;
} catch (Exception ex) {
1.2.2.1 +30 -3
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java
Index: JspCompilerAdapterFactory.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JspCompilerAdapterFactory.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- JspCompilerAdapterFactory.java 15 Apr 2002 12:11:48 -0000 1.2
+++ JspCompilerAdapterFactory.java 13 Aug 2002 20:06:49 -0000 1.2.2.1
@@ -53,6 +53,7 @@
*/
package org.apache.tools.ant.taskdefs.optional.jsp.compilers;
+import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
@@ -87,13 +88,37 @@
*/
public static JspCompilerAdapter getCompiler(String compilerType, Task
task)
throws BuildException {
+ return getCompiler(compilerType, task,
+ new AntClassLoader(task.getProject(), null));
+ }
+
+ /**
+ * Based on the parameter passed in, this method creates the necessary
+ * factory desired.
+ *
+ * The current mapping for compiler names are as follows:
+ * <ul><li>jasper = jasper compiler (the default)
+ * <li><i>a fully quallified classname</i> = the name of a jsp compiler
+ * adapter
+ * </ul>
+ *
+ * @param compilerType either the name of the desired compiler, or the
+ * full classname of the compiler's adapter.
+ * @param task a task to log through.
+ * @param loader AntClassLoader with which the compiler should be loaded
+ * @throws BuildException if the compiler type could not be resolved into
+ * a compiler adapter.
+ */
+ public static JspCompilerAdapter getCompiler(String compilerType, Task
task,
+ AntClassLoader loader)
+ throws BuildException {
/* If I've done things right, this should be the extent of the
* conditional statements required.
*/
if (compilerType.equalsIgnoreCase("jasper")) {
return new JasperC();
}
- return resolveClassName(compilerType);
+ return resolveClassName(compilerType, loader);
}
/**
@@ -101,13 +126,15 @@
* Throws a fit if it can't.
*
* @param className The fully qualified classname to be created.
+ * @param classloader Classloader with which to load the class
* @throws BuildException This is the fit that is thrown if className
* isn't an instance of JspCompilerAdapter.
*/
- private static JspCompilerAdapter resolveClassName(String className)
+ private static JspCompilerAdapter resolveClassName(String className,
+ AntClassLoader
classloader)
throws BuildException {
try {
- Class c = Class.forName(className);
+ Class c = classloader.findClass(className);
Object o = c.newInstance();
return (JspCompilerAdapter) o;
} catch (ClassNotFoundException cnfe) {
No revision
No revision
1.35.2.9 +65 -23 jakarta-ant/xdocs/external.xml
Index: external.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/xdocs/external.xml,v
retrieving revision 1.35.2.8
retrieving revision 1.35.2.9
diff -u -r1.35.2.8 -r1.35.2.9
--- external.xml 22 Jul 2002 12:55:25 -0000 1.35.2.8
+++ external.xml 13 Aug 2002 20:06:49 -0000 1.35.2.9
@@ -443,6 +443,30 @@
</table>
</subsection>
+ <subsection name="Jing Task">
+
+ <p> Validates XML files against the RELAX NG alternative to XML
Schema.
+ The Jing task for Ant allows you to efficiently validate
+ multiple files against multiple RELAX NG patterns and integrate
+ RELAX NG validation with other XML processing.</p>
+
+ <table>
+ <tr>
+ <th>Compatibility:</th>
+ <td>Ant 1.4 and later</td>
+ </tr>
+ <tr>
+ <th>URL:</th>
+ <td><a
href="http://www.thaiopensource.com/relaxng/jing-ant.html">
+ http://www.thaiopensource.com/relaxng/jing-ant.html</a></td>
+ </tr>
+ <tr>
+ <th>License:</th>
+ <td>BSD-like</td>
+ </tr>
+ </table>
+ </subsection>
+
<subsection name="jMetra">
<p>jMetra is a tool for collecting code metrics across a
@@ -481,6 +505,47 @@
</table>
</subsection>
+ <subsection name="JNI">
+
+ <p>
+
+ JNI is a free toolkit that makes easy work of
+ integrating Java and C through the Java Native
+ Interface (JNI). It includes a code generator that
+ generates both Java "proxy" classes to access C
+ "peer" classes, and C "proxy" classes to access
+ Java "peer" classes or interfaces. It also
+ includes a core library with a simplified JVM
+ interface as well as "helper" classes to ease
+ working with the JNI data types. The code
+ generation is driven by an XML project file that
+ can be created with the assistance of the GUI
+ Project Manager. The code generation can be
+ invoked either from Ant or from the
+ GUI. Includes a comprehensive printable PDF User
+ Guide and plenty of examples.</p>
+
+ <table>
+ <tr>
+ <th>Compatibility:</th>
+ <td>Ant 1.4</td>
+ </tr>
+ <tr>
+ <th>URL:</th>
+ <td><a href="http://jnipp.sf.net/">http://jnipp.sf.net/</a></td>
+ </tr>
+ <tr>
+ <th>Contact:</th>
+ <td><a href="mailto:[EMAIL PROTECTED]">Phillip E.
Trewhella</a></td>
+ </tr>
+ <tr>
+ <th>License:</th>
+ <td>GNU LGPL</td>
+ </tr>
+ </table>
+ </subsection>
+
+
<subsection name="PMD">
<p>PMD checks Java source code for unused variables,
@@ -707,29 +772,6 @@
</table>
</subsection>
- <subsection name="Jing Task">
-
- <p> Validates XML files against the RELAX NG alternative to XML
Schema.
- The Jing task for Ant allows you to efficiently validate
- multiple files against multiple RELAX NG patterns and integrate
- RELAX NG validation with other XML processing.</p>
-
- <table>
- <tr>
- <th>Compatibility:</th>
- <td>Ant 1.4 and later</td>
- </tr>
- <tr>
- <th>URL:</th>
- <td><a
href="http://www.thaiopensource.com/relaxng/jing-ant.html">
- http://www.thaiopensource.com/relaxng/jing-ant.html</a></td>
- </tr>
- <tr>
- <th>License:</th>
- <td>BSD-like</td>
- </tr>
- </table>
- </subsection>
</section>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>