Browse Source

added uriroot and uribase options

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269804 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 23 years ago
parent
commit
1fabe3a610
2 changed files with 54 additions and 1 deletions
  1. +46
    -0
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  2. +8
    -1
      src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java

+ 46
- 0
src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java View File

@@ -118,6 +118,20 @@ public class JspC extends MatchingTask
private int verbose = 0;
protected Vector compileList = new Vector();
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,
*/
private File uriroot;
private static final String FAIL_MSG
= "Compile failed, messages should have been provided.";
/* ------------------------------------------------------------ */
@@ -198,6 +212,38 @@ public class JspC extends MatchingTask
{
mapped = mapped_;
}
/**
* -uribase. the uri context of relative URI
* references in the JSP pages. If it does not
* exist then it is derived from the location of the file
* relative to the declared or derived value of -uriroot.
*
* @param uribase The new Uribase value
*/
public void setUribase(File uribase) {
this.uribase = uribase;
}

public File getUribase() {
return uriroot;
}

/**
* -uriroot <dir>The root directory that uri files should be resolved
* against, (Default is the directory jspc is invoked from)
*
* @param uriroot The new Uribase value
*/
public void setUriroot(File uriroot) {
this.uriroot = uriroot;
}

public File getUriroot() {
return uriroot;
}
/* ------------------------------------------------------------ */
/** Set the classpath to be used for this compilation */
public void setClasspath(Path cp) {


+ 8
- 1
src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/JasperC.java View File

@@ -120,7 +120,14 @@ public class JasperC extends DefaultCompilerAdapter
cmd.createArgument().setValue("-ieplugin");
cmd.createArgument().setValue(jspc.getIeplugin());
}

if (jspc.getUriroot() != null){
cmd.createArgument().setValue("-uriroot");
cmd.createArgument().setValue(jspc.getUriroot().toString());
}
if (jspc.getUribase() != null){
cmd.createArgument().setValue("-uribase");
cmd.createArgument().setValue(jspc.getUribase().toString());
}
logAndAddFilesToCompile(getJspc(), getJspc().getCompileList(), cmd);
return cmd;
}


Loading…
Cancel
Save