Browse Source

It is now possible to build Ant without BSF and then run using JSR scripting.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@483672 13f79535-47bb-0310-9956-ffa450edef68
master
Jesse N. Glick 18 years ago
parent
commit
c8df6694d7
2 changed files with 9 additions and 10 deletions
  1. +2
    -5
      build.xml
  2. +7
    -5
      src/main/org/apache/tools/ant/types/optional/ScriptFilter.java

+ 2
- 5
build.xml View File

@@ -241,11 +241,8 @@


<selector id="needs.apache-bsf"> <selector id="needs.apache-bsf">
<or> <or>
<filename name="${optional.package}/Script*"/>
<filename name="${optional.package}/script/**/*"/>
<filename name="${optional.type.package}/*Script*"/>
<filename name="${util.package}/Script*"/>
<filename name="${util.package}/optional/Script*"/>
<filename name="${util.package}/ScriptRunner.*"/>
<filename name="${util.package}/optional/ScriptRunner*"/>
</or> </or>
</selector> </selector>




+ 7
- 5
src/main/org/apache/tools/ant/types/optional/ScriptFilter.java View File

@@ -15,13 +15,14 @@
* limitations under the License. * limitations under the License.
* *
*/ */

package org.apache.tools.ant.types.optional; package org.apache.tools.ant.types.optional;


import org.apache.tools.ant.filters.TokenFilter; import org.apache.tools.ant.filters.TokenFilter;
import java.io.File; import java.io.File;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.util.optional.ScriptRunner;
import org.apache.tools.ant.util.ScriptRunnerBase;
import org.apache.tools.ant.util.ScriptRunnerHelper;


/** /**
* Most of this is CAP (Cut And Paste) from the Script task * Most of this is CAP (Cut And Paste) from the Script task
@@ -40,7 +41,7 @@ public class ScriptFilter extends TokenFilter.ChainableReaderFilter {
/** the token used by the script */ /** the token used by the script */
private String token; private String token;


private ScriptRunner runner = new ScriptRunner();
private ScriptRunnerHelper runner = new ScriptRunnerHelper();


/** /**
* Defines the language (required). * Defines the language (required).
@@ -61,7 +62,6 @@ public class ScriptFilter extends TokenFilter.ChainableReaderFilter {
return; return;
} }
initialized = true; initialized = true;
runner.bindToComponent(this);
} }


/** /**
@@ -93,7 +93,9 @@ public class ScriptFilter extends TokenFilter.ChainableReaderFilter {
public String filter(String token) { public String filter(String token) {
init(); init();
setToken(token); setToken(token);
runner.executeScript("ant_filter");
ScriptRunnerBase srb = runner.getScriptRunner();
srb.bindToComponent(this);
srb.executeScript("ant_filter");
return getToken(); return getToken();
} }




Loading…
Cancel
Save