use of org.apache.tools.ant.input.DefaultInputHandler in project eclipse.platform by eclipse-platform.
the class InputHandlerSetter method setInputHandler.
protected void setInputHandler(Project project, String inputHandlerClassname) {
InputHandler handler = null;
if (inputHandlerClassname == null) {
handler = new DefaultInputHandler();
} else {
try {
handler = (InputHandler) (Class.forName(inputHandlerClassname).getConstructor().newInstance());
} catch (ClassCastException e) {
String msg = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.The_specified_input_handler_class_{0}_does_not_implement_the_org.apache.tools.ant.input.InputHandler_interface_5"), new Object[] { // $NON-NLS-1$
inputHandlerClassname });
throw new BuildException(msg, e);
} catch (Exception e) {
String msg = MessageFormat.format(RemoteAntMessages.getString("InternalAntRunner.Unable_to_instantiate_specified_input_handler_class_{0}___{1}_6"), new Object[] { // $NON-NLS-1$
inputHandlerClassname, e.getClass().getName() });
throw new BuildException(msg, e);
}
}
project.setInputHandler(handler);
}
use of org.apache.tools.ant.input.DefaultInputHandler in project CodenameOne by codenameone.
the class AbstractCN1Mojo method setupAnt.
private void setupAnt() throws MojoExecutionException, MojoFailureException {
antProject = new Project();
if (project.getBasedir() != null) {
antProject.setBaseDir(project.getBasedir());
} else {
antProject.setBaseDir(new File("."));
}
antProject.setDefaultInputStream(System.in);
InputHandler handler = new DefaultInputHandler();
antProject.setProjectReference(handler);
antProject.setInputHandler(handler);
antProject.init();
}
use of org.apache.tools.ant.input.DefaultInputHandler in project CodenameOne by codenameone.
the class GenerateAppProjectMojo method antProject.
private Project antProject() {
if (antProject == null) {
antProject = new Project();
antProject.setBaseDir(sourceProject);
antProject.setDefaultInputStream(System.in);
InputHandler handler = new DefaultInputHandler();
antProject.setProjectReference(handler);
antProject.setInputHandler(handler);
antProject.init();
}
return antProject;
}
use of org.apache.tools.ant.input.DefaultInputHandler in project CodenameOne by codenameone.
the class GenerateCn1libProjectMojo method antProject.
private Project antProject() {
if (antProject == null) {
antProject = new Project();
antProject.setBaseDir(sourceProject);
antProject.setDefaultInputStream(System.in);
InputHandler handler = new DefaultInputHandler();
antProject.setProjectReference(handler);
antProject.setInputHandler(handler);
antProject.init();
}
return antProject;
}
use of org.apache.tools.ant.input.DefaultInputHandler in project ant by apache.
the class Main method addInputHandler.
/**
* Creates the InputHandler and adds it to the project.
*
* @param project the project instance.
*
* @exception BuildException if a specified InputHandler
* implementation could not be loaded.
*/
private void addInputHandler(final Project project) throws BuildException {
InputHandler handler = null;
if (inputHandlerClassname == null) {
handler = new DefaultInputHandler();
} else {
handler = ClasspathUtils.newInstance(inputHandlerClassname, Main.class.getClassLoader(), InputHandler.class);
project.setProjectReference(handler);
}
project.setInputHandler(handler);
}
Aggregations