Search in sources :

Example 1 with Scripter

use of aQute.bnd.service.Scripter in project bnd by bndtools.

the class Project method script.

@SuppressWarnings({ "unchecked", "rawtypes" })
public void script(String type, String script, Object... args) throws Exception {
    // TODO check tyiping
    List<Scripter> scripters = getPlugins(Scripter.class);
    if (scripters.isEmpty()) {
        msgs.NoScripters_(script);
        return;
    }
    Properties p = new UTF8Properties(getProperties());
    for (int i = 0; i < args.length; i++) p.setProperty("" + i, Converter.cnv(String.class, args[i]));
    scripters.get(0).eval((Map) p, new StringReader(script));
}
Also used : Scripter(aQute.bnd.service.Scripter) StringReader(java.io.StringReader) UTF8Properties(aQute.lib.utf8properties.UTF8Properties) Properties(java.util.Properties) UTF8Properties(aQute.lib.utf8properties.UTF8Properties)

Aggregations

Scripter (aQute.bnd.service.Scripter)1 UTF8Properties (aQute.lib.utf8properties.UTF8Properties)1 StringReader (java.io.StringReader)1 Properties (java.util.Properties)1