Add groovy to the BSF supported tasks Change the script names to remove <> to allow current Groovy implementation to work git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276076 13f79535-47bb-0310-9956-ffa450edef68master
@@ -58,7 +58,7 @@ public class Script extends Task { | |||||
runner.addBean("project", getProject()); | runner.addBean("project", getProject()); | ||||
runner.addBean("self", this); | runner.addBean("self", this); | ||||
runner.executeScript("<ANT>"); | |||||
runner.executeScript("ANT"); | |||||
} | } | ||||
/** | /** | ||||
@@ -314,7 +314,7 @@ public class ScriptDef extends DefBase { | |||||
runner.addBean("attributes", attributes); | runner.addBean("attributes", attributes); | ||||
runner.addBean("elements", elements); | runner.addBean("elements", elements); | ||||
runner.addBean("project", getProject()); | runner.addBean("project", getProject()); | ||||
runner.executeScript("scriptdef <" + name + ">"); | |||||
runner.executeScript("scriptdef_" + name); | |||||
} | } | ||||
@@ -33,6 +33,19 @@ import java.util.Iterator; | |||||
* @author Conor MacNeill | * @author Conor MacNeill | ||||
*/ | */ | ||||
public class ScriptRunner { | public class ScriptRunner { | ||||
// Register Groovy ourselves, since BSF does not | |||||
// natively support it (yet). | |||||
// This "hack" can be removed once BSF has been | |||||
// modified to support Groovy or more dynamic | |||||
// registration. | |||||
static { | |||||
BSFManager.registerScriptingEngine( | |||||
"groovy", | |||||
"org.codehaus.groovy.bsf.GroovyEngine", | |||||
new String[] {"groovy", "gy"}); | |||||
} | |||||
/** Script language */ | /** Script language */ | ||||
private String language; | private String language; | ||||