peterreilly 2004/02/12 02:09:23
Modified: src/main/org/apache/tools/ant/util ScriptRunner.java
src/main/org/apache/tools/ant/taskdefs/optional Script.java
src/main/org/apache/tools/ant/taskdefs/optional/script
ScriptDef.java
Log:
support the groovy language for the script and scriptdef tasks
Add groovy to the BSF supported tasks
Change the script names to remove <> to allow current Groovy implementation
to work
Revision Changes Path
1.7 +13 -0 ant/src/main/org/apache/tools/ant/util/ScriptRunner.java
Index: ScriptRunner.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/ScriptRunner.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ScriptRunner.java 9 Feb 2004 21:05:38 -0000 1.6
+++ ScriptRunner.java 12 Feb 2004 10:09:23 -0000 1.7
@@ -33,6 +33,19 @@
* @author Conor MacNeill
*/
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 */
private String language;
1.29 +1 -1
ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java
Index: Script.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Script.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- Script.java 9 Feb 2004 21:05:26 -0000 1.28
+++ Script.java 12 Feb 2004 10:09:23 -0000 1.29
@@ -58,7 +58,7 @@
runner.addBean("project", getProject());
runner.addBean("self", this);
- runner.executeScript("<ANT>");
+ runner.executeScript("ANT");
}
/**
1.11 +1 -1
ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java
Index: ScriptDef.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/script/ScriptDef.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ScriptDef.java 9 Feb 2004 21:05:33 -0000 1.10
+++ ScriptDef.java 12 Feb 2004 10:09:23 -0000 1.11
@@ -314,7 +314,7 @@
runner.addBean("attributes", attributes);
runner.addBean("elements", elements);
runner.addBean("project", getProject());
- runner.executeScript("scriptdef <" + name + ">");
+ runner.executeScript("scriptdef_" + name);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]