/** * Run a script * @param execName name of the script */ protected void executeScript(String execName) { getRunner().executeScript(execName); }
/** * Run the script using the helper object. * * @exception BuildException if something goes wrong with the build */ public void execute() throws BuildException { helper.getScriptRunner().executeScript("ANT"); }
/** * Called filter the token. * This sets the token in this object, calls * the script and returns the token. * * @param token the token to be filtered * @return the filtered token */ @Override public String filter(String token) { init(); setToken(token); runner.executeScript("ant_filter"); return getToken(); }
/** * Executes the script. * This is called by the script instance to execute the script for this * definition. * * @param attributes collection of attributes * @param elements a list of nested element values. * @param instance the script instance; can be null */ public void executeScript(Map<String, String> attributes, Map<String, List<Object>> elements, ScriptDefBase instance) { ScriptRunnerBase runner = helper.getScriptRunner(); runner.addBean("attributes", attributes); runner.addBean("elements", elements); runner.addBean("project", getProject()); if (instance != null) { runner.addBean("self", instance); } runner.executeScript("scriptdef_" + name); }
/** * Method that each selector will implement to create their selection * behaviour. If there is a problem with the setup of a selector, it can * throw a BuildException to indicate the problem. * * @param basedir A java.io.File object for the base directory * @param filename The name of the file to check * @param file A File object for this filename * * @return whether the file should be selected or not */ @Override public boolean isSelected(File basedir, String filename, File file) { init(); setSelected(true); this.file = file; this.basedir = basedir; this.filename = filename; runner.addBean("basedir", basedir); runner.addBean("filename", filename); runner.addBean("file", file); runner.executeScript("ant_selector"); return isSelected(); }