|
|
@@ -77,6 +77,7 @@ public class JspC extends MatchingTask { |
|
|
private String iepluginid; |
|
|
private String iepluginid; |
|
|
private boolean mapped; |
|
|
private boolean mapped; |
|
|
private int verbose = 0; |
|
|
private int verbose = 0; |
|
|
|
|
|
// CheckStyle:VisibilityModifier OFF - bc |
|
|
protected Vector compileList = new Vector(); |
|
|
protected Vector compileList = new Vector(); |
|
|
Vector javaFiles = new Vector(); |
|
|
Vector javaFiles = new Vector(); |
|
|
|
|
|
|
|
|
@@ -112,8 +113,11 @@ public class JspC extends MatchingTask { |
|
|
private static final String FAIL_MSG |
|
|
private static final String FAIL_MSG |
|
|
= "Compile failed, messages should have been provided."; |
|
|
= "Compile failed, messages should have been provided."; |
|
|
|
|
|
|
|
|
|
|
|
// CheckStyle:VisibilityModifier ON |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set the path for source JSP files. |
|
|
* Set the path for source JSP files. |
|
|
|
|
|
* @param srcDir the source path. |
|
|
*/ |
|
|
*/ |
|
|
public void setSrcDir(Path srcDir) { |
|
|
public void setSrcDir(Path srcDir) { |
|
|
if (src == null) { |
|
|
if (src == null) { |
|
|
@@ -122,6 +126,11 @@ public class JspC extends MatchingTask { |
|
|
src.append(srcDir); |
|
|
src.append(srcDir); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the source dir. |
|
|
|
|
|
* @return the source path. |
|
|
|
|
|
*/ |
|
|
public Path getSrcDir() { |
|
|
public Path getSrcDir() { |
|
|
return src; |
|
|
return src; |
|
|
} |
|
|
} |
|
|
@@ -129,31 +138,48 @@ public class JspC extends MatchingTask { |
|
|
/** |
|
|
/** |
|
|
* Set the destination directory into which the JSP source |
|
|
* Set the destination directory into which the JSP source |
|
|
* files should be compiled. |
|
|
* files should be compiled. |
|
|
|
|
|
* @param destDir the destination directory. |
|
|
*/ |
|
|
*/ |
|
|
public void setDestdir(File destDir) { |
|
|
public void setDestdir(File destDir) { |
|
|
this.destDir = destDir; |
|
|
this.destDir = destDir; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the destination directory. |
|
|
|
|
|
* @return the directory. |
|
|
|
|
|
*/ |
|
|
public File getDestdir() { |
|
|
public File getDestdir() { |
|
|
return destDir; |
|
|
return destDir; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set the name of the package the compiled jsp files should be in. |
|
|
* Set the name of the package the compiled jsp files should be in. |
|
|
|
|
|
* @param pkg the name of the package. |
|
|
*/ |
|
|
*/ |
|
|
public void setPackage(String pkg) { |
|
|
public void setPackage(String pkg) { |
|
|
this.packageName = pkg; |
|
|
this.packageName = pkg; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the name of the package. |
|
|
|
|
|
* @return the package. |
|
|
|
|
|
*/ |
|
|
public String getPackage() { |
|
|
public String getPackage() { |
|
|
return packageName; |
|
|
return packageName; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set the verbose level of the compiler |
|
|
* Set the verbose level of the compiler |
|
|
|
|
|
* @param i the verbose level to use. |
|
|
*/ |
|
|
*/ |
|
|
public void setVerbose(int i) { |
|
|
public void setVerbose(int i) { |
|
|
verbose = i; |
|
|
verbose = i; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the verbose level. |
|
|
|
|
|
* @return the level. |
|
|
|
|
|
*/ |
|
|
public int getVerbose() { |
|
|
public int getVerbose() { |
|
|
return verbose; |
|
|
return verbose; |
|
|
} |
|
|
} |
|
|
@@ -161,22 +187,29 @@ public class JspC extends MatchingTask { |
|
|
/** |
|
|
/** |
|
|
* Whether or not the build should halt if compilation fails. |
|
|
* Whether or not the build should halt if compilation fails. |
|
|
* Defaults to <code>true</code>. |
|
|
* Defaults to <code>true</code>. |
|
|
|
|
|
* @param fail a <code>boolean</code> value. |
|
|
*/ |
|
|
*/ |
|
|
public void setFailonerror(boolean fail) { |
|
|
public void setFailonerror(boolean fail) { |
|
|
failOnError = fail; |
|
|
failOnError = fail; |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* Gets the failonerror flag. |
|
|
* Gets the failonerror flag. |
|
|
|
|
|
* @return the flag. |
|
|
*/ |
|
|
*/ |
|
|
public boolean getFailonerror() { |
|
|
public boolean getFailonerror() { |
|
|
return failOnError; |
|
|
return failOnError; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the IE CLASSID value. |
|
|
|
|
|
* @return the value. |
|
|
|
|
|
*/ |
|
|
public String getIeplugin() { |
|
|
public String getIeplugin() { |
|
|
return iepluginid; |
|
|
return iepluginid; |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
* Java Plugin CLASSID for Internet Explorer |
|
|
* Java Plugin CLASSID for Internet Explorer |
|
|
|
|
|
* @param iepluginid the id to use. |
|
|
*/ |
|
|
*/ |
|
|
public void setIeplugin(String iepluginid) { |
|
|
public void setIeplugin(String iepluginid) { |
|
|
this.iepluginid = iepluginid; |
|
|
this.iepluginid = iepluginid; |
|
|
@@ -194,6 +227,7 @@ public class JspC extends MatchingTask { |
|
|
/** |
|
|
/** |
|
|
* If true, generate separate write() calls for each HTML line |
|
|
* If true, generate separate write() calls for each HTML line |
|
|
* in the JSP. |
|
|
* in the JSP. |
|
|
|
|
|
* @param mapped a <code>boolean</code> value. |
|
|
*/ |
|
|
*/ |
|
|
public void setMapped(boolean mapped) { |
|
|
public void setMapped(boolean mapped) { |
|
|
this.mapped = mapped; |
|
|
this.mapped = mapped; |
|
|
@@ -210,6 +244,10 @@ public class JspC extends MatchingTask { |
|
|
log("Uribase is currently an unused parameter", Project.MSG_WARN); |
|
|
log("Uribase is currently an unused parameter", Project.MSG_WARN); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the uri base value. |
|
|
|
|
|
* @return the value. |
|
|
|
|
|
*/ |
|
|
public File getUribase() { |
|
|
public File getUribase() { |
|
|
return uriroot; |
|
|
return uriroot; |
|
|
} |
|
|
} |
|
|
@@ -224,6 +262,10 @@ public class JspC extends MatchingTask { |
|
|
this.uriroot = uriroot; |
|
|
this.uriroot = uriroot; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the uri root value. |
|
|
|
|
|
* @return the value. |
|
|
|
|
|
*/ |
|
|
public File getUriroot() { |
|
|
public File getUriroot() { |
|
|
return uriroot; |
|
|
return uriroot; |
|
|
} |
|
|
} |
|
|
@@ -231,6 +273,7 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set the classpath to be used for this compilation. |
|
|
* Set the classpath to be used for this compilation. |
|
|
|
|
|
* @param cp the path to be used. |
|
|
*/ |
|
|
*/ |
|
|
public void setClasspath(Path cp) { |
|
|
public void setClasspath(Path cp) { |
|
|
if (classpath == null) { |
|
|
if (classpath == null) { |
|
|
@@ -242,6 +285,7 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Adds a path to the classpath. |
|
|
* Adds a path to the classpath. |
|
|
|
|
|
* @return a path to be configured. |
|
|
*/ |
|
|
*/ |
|
|
public Path createClasspath() { |
|
|
public Path createClasspath() { |
|
|
if (classpath == null) { |
|
|
if (classpath == null) { |
|
|
@@ -252,16 +296,23 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Adds a reference to a classpath defined elsewhere |
|
|
* Adds a reference to a classpath defined elsewhere |
|
|
|
|
|
* @param r a reference to a classpath. |
|
|
*/ |
|
|
*/ |
|
|
public void setClasspathRef(Reference r) { |
|
|
public void setClasspathRef(Reference r) { |
|
|
createClasspath().setRefid(r); |
|
|
createClasspath().setRefid(r); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the classpath. |
|
|
|
|
|
* @return the classpath. |
|
|
|
|
|
*/ |
|
|
public Path getClasspath() { |
|
|
public Path getClasspath() { |
|
|
return classpath; |
|
|
return classpath; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Set the classpath to be used to find this compiler adapter |
|
|
* Set the classpath to be used to find this compiler adapter |
|
|
|
|
|
* @param cp the compiler classpath. |
|
|
*/ |
|
|
*/ |
|
|
public void setCompilerclasspath(Path cp) { |
|
|
public void setCompilerclasspath(Path cp) { |
|
|
if (compilerClasspath == null) { |
|
|
if (compilerClasspath == null) { |
|
|
@@ -273,6 +324,7 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* get the classpath used to find the compiler adapter |
|
|
* get the classpath used to find the compiler adapter |
|
|
|
|
|
* @return the compiler classpath. |
|
|
*/ |
|
|
*/ |
|
|
public Path getCompilerclasspath() { |
|
|
public Path getCompilerclasspath() { |
|
|
return compilerClasspath; |
|
|
return compilerClasspath; |
|
|
@@ -280,6 +332,7 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Support nested compiler classpath, used to locate compiler adapter |
|
|
* Support nested compiler classpath, used to locate compiler adapter |
|
|
|
|
|
* @return a path to be configured. |
|
|
*/ |
|
|
*/ |
|
|
public Path createCompilerclasspath() { |
|
|
public Path createCompilerclasspath() { |
|
|
if (compilerClasspath == null) { |
|
|
if (compilerClasspath == null) { |
|
|
@@ -314,6 +367,10 @@ public class JspC extends MatchingTask { |
|
|
this.webinc = webinc; |
|
|
this.webinc = webinc; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the webinc attribute. |
|
|
|
|
|
* @return the webinc attribute. |
|
|
|
|
|
*/ |
|
|
public File getWebinc() { |
|
|
public File getWebinc() { |
|
|
return this.webinc; |
|
|
return this.webinc; |
|
|
} |
|
|
} |
|
|
@@ -322,6 +379,7 @@ public class JspC extends MatchingTask { |
|
|
* Adds a single webapp. |
|
|
* Adds a single webapp. |
|
|
* |
|
|
* |
|
|
* @param webappParam add a web app parameter |
|
|
* @param webappParam add a web app parameter |
|
|
|
|
|
* @throws BuildException if more than one webapp is specified. |
|
|
*/ |
|
|
*/ |
|
|
public void addWebApp(WebAppParameter webappParam) |
|
|
public void addWebApp(WebAppParameter webappParam) |
|
|
throws BuildException { |
|
|
throws BuildException { |
|
|
@@ -333,12 +391,17 @@ public class JspC extends MatchingTask { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the web app. |
|
|
|
|
|
* @return the web app attribute. |
|
|
|
|
|
*/ |
|
|
public WebAppParameter getWebApp() { |
|
|
public WebAppParameter getWebApp() { |
|
|
return webApp; |
|
|
return webApp; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Class name of a JSP compiler adapter. |
|
|
* Class name of a JSP compiler adapter. |
|
|
|
|
|
* @param compiler the compiler class name. |
|
|
*/ |
|
|
*/ |
|
|
public void setCompiler(String compiler) { |
|
|
public void setCompiler(String compiler) { |
|
|
this.compilerName = compiler; |
|
|
this.compilerName = compiler; |
|
|
@@ -346,6 +409,7 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* get the list of files to compile |
|
|
* get the list of files to compile |
|
|
|
|
|
* @return the list of files. |
|
|
*/ |
|
|
*/ |
|
|
public Vector getCompileList() { |
|
|
public Vector getCompileList() { |
|
|
return compileList; |
|
|
return compileList; |
|
|
@@ -354,6 +418,7 @@ public class JspC extends MatchingTask { |
|
|
/** |
|
|
/** |
|
|
* execute by building up a list of files that |
|
|
* execute by building up a list of files that |
|
|
* have changed and hand them off to a jsp compiler |
|
|
* have changed and hand them off to a jsp compiler |
|
|
|
|
|
* @throws BuildException on error. |
|
|
*/ |
|
|
*/ |
|
|
public void execute() |
|
|
public void execute() |
|
|
throws BuildException { |
|
|
throws BuildException { |
|
|
@@ -484,8 +549,13 @@ public class JspC extends MatchingTask { |
|
|
/** |
|
|
/** |
|
|
* Scans the directory looking for source files to be compiled. |
|
|
* Scans the directory looking for source files to be compiled. |
|
|
* The results are returned in the class variable compileList |
|
|
* The results are returned in the class variable compileList |
|
|
|
|
|
* @param srcDir the source directory. |
|
|
|
|
|
* @param dest the destination directory. |
|
|
|
|
|
* @param mangler the jsp filename mangler. |
|
|
|
|
|
* @param files the file names to mangle. |
|
|
*/ |
|
|
*/ |
|
|
protected void scanDir(File srcDir, File dest, JspMangler mangler, String files[]) { |
|
|
|
|
|
|
|
|
protected void scanDir( |
|
|
|
|
|
File srcDir, File dest, JspMangler mangler, String[] files) { |
|
|
|
|
|
|
|
|
long now = (new Date()).getTime(); |
|
|
long now = (new Date()).getTime(); |
|
|
|
|
|
|
|
|
@@ -554,7 +624,11 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* get a filename from our jsp file |
|
|
|
|
|
|
|
|
* get a filename from our jsp file. |
|
|
|
|
|
* @param mangler the jsp filename managler. |
|
|
|
|
|
* @param srcFile the source file. |
|
|
|
|
|
* @param srcDir the source directory. |
|
|
|
|
|
* @param dest the destination directory. |
|
|
* @todo support packages and subdirs |
|
|
* @todo support packages and subdirs |
|
|
*/ |
|
|
*/ |
|
|
protected File mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest) { |
|
|
protected File mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest) { |
|
|
@@ -596,14 +670,15 @@ public class JspC extends MatchingTask { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* query current directory |
|
|
* query current directory |
|
|
|
|
|
* @return the directory. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
public File getDirectory() { |
|
|
public File getDirectory() { |
|
|
return directory; |
|
|
return directory; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* set directory; alternate syntax |
|
|
* set directory; alternate syntax |
|
|
|
|
|
* @param directory the base dir. |
|
|
*/ |
|
|
*/ |
|
|
public void setBaseDir(File directory) { |
|
|
public void setBaseDir(File directory) { |
|
|
this.directory = directory; |
|
|
this.directory = directory; |
|
|
|