ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/util ScriptRunner.java
Date Tue, 17 May 2005 10:40:46 GMT
stevel      2005/05/17 03:40:46

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/script
                        ScriptDef.java
               src/main/org/apache/tools/ant/util ScriptRunner.java
  Log:
  jruby support in script. We ought to have a task to add these declarations.
  
  Revision  Changes    Path
  1.17      +4 -5      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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ScriptDef.java	13 Dec 2004 09:06:19 -0000	1.16
  +++ ScriptDef.java	17 May 2005 10:40:46 -0000	1.17
  @@ -311,10 +311,7 @@
        * @deprecated use executeScript(attribute, elements, instance) instead
        */
       public void executeScript(Map attributes, Map elements) {
  -        runner.addBean("attributes", attributes);
  -        runner.addBean("elements", elements);
  -        runner.addBean("project", getProject());
  -        runner.executeScript("scriptdef_" + name);
  +        executeScript(attributes, elements,null);
       }
   
       /**
  @@ -330,7 +327,9 @@
           runner.addBean("attributes", attributes);
           runner.addBean("elements", elements);
           runner.addBean("project", getProject());
  -        runner.addBean("self", instance);
  +        if(instance!=null) {
  +            runner.addBean("self", instance);
  +        }
           runner.executeScript("scriptdef_" + name);
       }
   
  
  
  
  1.11      +11 -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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ScriptRunner.java	24 Jan 2005 15:13:46 -0000	1.10
  +++ ScriptRunner.java	17 May 2005 10:40:46 -0000	1.11
  @@ -47,6 +47,17 @@
               new String[] {"groovy", "gy"});
       }
   
  +    // Register Jruby ourselves, since BSF does not
  +    // natively support it (yet).
  +    // This "hack" can be removed once BSF has been
  +    // modified to support Jruby or more dynamic
  +    // registration.
  +    static {
  +        BSFManager.registerScriptingEngine("ruby",
  +                "org.jruby.javasupport.bsf.JRubyEngine",
  +                new String[]{"ruby","rb"});
  +    }
  +
       /** Script language */
       private String language;
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message