use of org.eclipse.debug.core.ILaunchConfigurationType in project liferay-ide by liferay.
the class MavenProjectRemoteServerPublisher method _execMavenLaunch.
private boolean _execMavenLaunch(IProject project, String goal, IMavenProjectFacade facade, IProgressMonitor monitor) throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(_launchConfigurationTypeId);
IPath basedirLocation = project.getLocation();
String newName = launchManager.generateLaunchConfigurationName(basedirLocation.lastSegment());
ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(null, newName);
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, "-Dmaven.multiModuleProjectDirectory");
workingCopy.setAttribute(_attrPomDir, basedirLocation.toString());
workingCopy.setAttribute(_attrGoals, goal);
workingCopy.setAttribute(_attrUpdateSnapshots, Boolean.TRUE);
workingCopy.setAttribute(_attrWorkspaceResolution, Boolean.TRUE);
workingCopy.setAttribute(_attrSkipTests, Boolean.TRUE);
if (facade != null) {
ResolverConfiguration configuration = facade.getResolverConfiguration();
String selectedProfiles = configuration.getSelectedProfiles();
if ((selectedProfiles != null) && (selectedProfiles.length() > 0)) {
workingCopy.setAttribute(_attrProfiles, selectedProfiles);
}
new LaunchHelper().launch(workingCopy, "run", monitor);
return true;
} else {
return false;
}
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project jbosstools-hibernate by jbosstools.
the class JPAPostInstallFasetListener method buildConsoleConfiguration.
protected void buildConsoleConfiguration(IProject project, String platformId) {
ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType lct = LaunchHelper.getHibernateLaunchConfigsType();
String launchName = lm.generateLaunchConfigurationName(project.getName());
ILaunchConfigurationWorkingCopy wc;
try {
wc = lct.newInstance(null, launchName);
wc.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, Collections.singletonList(new Path(project.getName()).makeAbsolute().toString()));
wc.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, Collections.singletonList(Integer.toString(IResource.PROJECT)));
wc.setAttribute(IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, ConfigurationMode.JPA.toString());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true);
wc.setAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, (List<String>) null);
wc.setAttribute(IConsoleConfigurationLaunchConstants.USE_JPA_PROJECT_PROFILE, Boolean.toString(true));
String hibernateVersion = lookupHibernateVersion(project);
if (HibernateJpaPlatform.HIBERNATE2_1_PLATFORM_ID.equals(platformId)) {
wc.setAttribute(IConsoleConfigurationLaunchConstants.PERSISTENCE_UNIT_NAME, getPersistenceUnitName(project));
}
if (hibernateVersion != null) {
wc.setAttribute(IConsoleConfigurationLaunchConstants.HIBERNATE_VERSION, hibernateVersion);
} else {
if (HibernateJpaPlatform.HIBERNATE2_1_PLATFORM_ID.equals(platformId)) {
// $NON-NLS-1$
wc.setAttribute(IConsoleConfigurationLaunchConstants.HIBERNATE_VERSION, "4.3");
} else if (HibernateJpaPlatform.HIBERNATE2_0_PLATFORM_ID.equals(platformId)) {
// $NON-NLS-1$
wc.setAttribute(IConsoleConfigurationLaunchConstants.HIBERNATE_VERSION, "4.0");
} else {
// $NON-NLS-1$
wc.setAttribute(IConsoleConfigurationLaunchConstants.HIBERNATE_VERSION, "3.6");
}
}
wc.doSave();
ProjectUtils.toggleHibernateOnProject(project, true, launchName);
} catch (CoreException e) {
HibernateJptPlugin.logException(e);
}
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project iobserve-analysis by research-iobserve.
the class PerOpteryxLaunchConfigurationBuilder method getDefaultLaunchConfiguration.
public static ILaunchConfiguration getDefaultLaunchConfiguration(final String projectModelDir, final String sourceModelDir) throws CoreException {
final Map<String, Object> attr = new HashMap<>();
setDefaultConfigFiles(projectModelDir, attr);
setDefaultGeneralOptions(attr);
setDefaultAnalysisOptions(attr);
setDefaultResourceOptions(attr);
setDefaultReliabilityOptions(attr);
// setSimuComDefaultOptions(attr);
setLQNSDefaultOptions(attr, projectModelDir, sourceModelDir);
setDefaultTacticsOptions(attr);
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigType = launchManager.getLaunchConfigurationType(DSE_LAUNCH_TYPE_ID);
ILaunchConfigurationWorkingCopy workingCopy = launchConfigType.newInstance(null, DEFAULT_LAUNCH_CONFIG_NAME);
workingCopy.setAttributes(attr);
ILaunchConfiguration launchConfig = workingCopy.doSave();
LOG.info("Using launch configuration with attributes: " + attr.toString());
return launchConfig;
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project jbosstools-hibernate by jbosstools.
the class AddConfigurationAction method createTemporaryLaunchConfiguration.
public static ILaunchConfiguration createTemporaryLaunchConfiguration() throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = LaunchHelper.getHibernateLaunchConfigsType();
String launchName = launchManager.generateLaunchConfigurationName(HibernateConsoleMessages.AddConfigurationAction_hibernate);
// ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations( launchConfigurationType );
ILaunchConfigurationWorkingCopy wc = launchConfigurationType.newInstance(null, launchName);
wc.setAttribute(TEMPORARY_CONFIG_FLAG, true);
return wc.doSave();
}
use of org.eclipse.debug.core.ILaunchConfigurationType in project jbosstools-hibernate by jbosstools.
the class LaunchHelper method findLaunchConfigurationByName.
public static ILaunchConfiguration findLaunchConfigurationByName(String launchConfigurationTypeId, String name) throws CoreException {
Assert.isNotNull(launchConfigurationTypeId, HibernateConsoleMessages.LaunchHelper_launch_cfg_type_cannot_be_null);
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager.getLaunchConfigurationType(launchConfigurationTypeId);
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations(launchConfigurationType);
for (int i = 0; i < launchConfigurations.length; i++) {
// can't believe
// there is no
// look up by
// name API
ILaunchConfiguration launchConfiguration = launchConfigurations[i];
if (launchConfiguration.getName().equals(name)) {
return launchConfiguration;
}
}
return null;
}
Aggregations