use of org.eclipse.ant.core.AntRunner in project generator by mybatis.
the class GeneratorLaunchConfigurationDelegate method launch.
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
AntRunner antRunner = new AntRunner();
String buildFile;
try {
buildFile = generateAntScript(configuration);
} catch (IOException e) {
Status status = new Status(Status.ERROR, Activator.PLUGIN_ID, Messages.LAUNCH_ERROR_ERROR_GENERATING_ANT_FILE, e);
throw new CoreException(status);
}
antRunner.setBuildFileLocation(buildFile);
//$NON-NLS-1$
antRunner.addBuildLogger("org.mybatis.generator.eclipse.ui.ant.GeneratorBuildLogger");
modifyAntClasspathIfNecessary(configuration, antRunner);
if (ILaunchManager.DEBUG_MODE.equals(mode)) {
antRunner.setMessageOutputLevel(Project.MSG_DEBUG);
//$NON-NLS-1$
antRunner.setArguments("-debug");
} else {
antRunner.setMessageOutputLevel(Project.MSG_WARN);
}
antRunner.run(monitor);
if (LauncherUtils.getBooleanOrFalse(configuration, GeneratorLaunchConstants.ATTR_SQL_SCRIPT_SECURE_CREDENTIALS)) {
File file = new File(buildFile);
file.delete();
}
}
use of org.eclipse.ant.core.AntRunner in project jop by jop-devel.
the class JOPizer method buildToolChain.
private void buildToolChain(IProgressMonitor monitor) throws CoreException {
IPreferenceStore prefs = JOPUIPlugin.getDefault().getPreferenceStore();
String jopHome = prefs.getString(IJOPLaunchConfigurationConstants.ATTR_JOP_HOME);
AntRunner antRunner = new AntRunner();
antRunner.setBuildFileLocation(jopHome + IPath.SEPARATOR + "build.xml");
antRunner.setExecutionTargets(new String[] { "directories", "tools", "classes" });
try {
antRunner.run(monitor);
} catch (CoreException e) {
// TODO only for demo since i don't have quartus etc installed
e.printStackTrace();
}
}
use of org.eclipse.ant.core.AntRunner in project jop by jop-devel.
the class JOPLaunchConfigurationDelegate method launch.
@Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
System.err.println("JOPLaunchConfigurationDelegate");
if (CommonTab.isLaunchInBackground(configuration)) {
System.err.println("Launch in background");
}
// FIXME do some serious error handling here, alright
IJavaProject javaProject = getJavaProject(configuration);
IProject project = javaProject.getProject();
/* Can I guarantee this is a Java project?
* JOP runs only Java, so..?
*/
// Find the build file (relative path)
IFile buildFile = findAntBuildFile(project);
IPath buildFileLocation = buildFile.getLocation();
System.out.printf("[Build file] OS-string: %s%n", buildFileLocation.toOSString());
AntRunner antRunner = new AntRunner();
antRunner.setBuildFileLocation(buildFileLocation.toOSString());
antRunner.addBuildLogger("org.apache.tools.ant.DefaultLogger");
// TODO Remove when not debugging
antRunner.setMessageOutputLevel(org.apache.tools.ant.Project.MSG_VERBOSE);
setAntProperties(configuration, antRunner);
try {
antRunner.run(monitor);
} catch (CoreException e) {
// Build exception occured
e.printStackTrace();
}
if (!AntRunner.isBuildRunning()) {
// Launch the Java build
super.launch(configuration, mode, launch, monitor);
}
}
Aggregations