Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / ant / Build3.groovy @ 1000

History | View | Annotate | Download (656 Bytes)

1 1000 mdecorde
package org.txm.scripts.ant;
2 321 mdecorde
3 321 mdecorde
import java.io.IOException;
4 321 mdecorde
5 321 mdecorde
import groovy.lang.Binding;
6 321 mdecorde
import groovy.util.GroovyScriptEngine;
7 321 mdecorde
import groovy.util.ResourceException;
8 321 mdecorde
import groovy.util.ScriptException;
9 321 mdecorde
10 321 mdecorde
                String userdir = System.getProperty("user.home");
11 321 mdecorde
                String[] roots = [ userdir+"/TXM/scripts", userdir+"/TXM/scripts/test"];
12 321 mdecorde
                GroovyScriptEngine gse = new GroovyScriptEngine(roots, this.getClass().getClassLoader());
13 321 mdecorde
                //gse.loadScriptByName("test/B.groovy");
14 321 mdecorde
                //System.out.println("B: " +gse.getResourceConnection("test/B.groovy"));
15 321 mdecorde
                Binding binding = new Binding();
16 321 mdecorde
                binding.setVariable("input", "world");
17 321 mdecorde
                gse.run("test/A.groovy", binding);
18 321 mdecorde