use of org.eclipse.xtext.xtext.wizard.BuildSystem in project xtext-core by eclipse.
the class RuntimeProjectDescriptor method workflowLaunchConfig.
/**
* @since 2.11
*/
private CharSequence workflowLaunchConfig() {
CharSequence _xblockexpression = null;
{
ArrayList<ProjectDescriptor> projectsToRefresh = CollectionLiterals.<ProjectDescriptor>newArrayList();
Set<ProjectDescriptor> _enabledProjects = this.getConfig().getEnabledProjects();
Iterables.<ProjectDescriptor>addAll(projectsToRefresh, _enabledProjects);
boolean _isEnabled = this.getConfig().getRuntimeProject().testProject.isEnabled();
if (_isEnabled) {
projectsToRefresh.add(this.getConfig().getRuntimeProject().testProject);
}
boolean _isEnabled_1 = this.getConfig().getUiProject().getTestProject().isEnabled();
if (_isEnabled_1) {
TestProjectDescriptor _testProject = this.getConfig().getUiProject().getTestProject();
projectsToRefresh.add(_testProject);
}
StringConcatenation _builder = new StringConcatenation();
_builder.append("${working_set:<?xml version="1.0" encoding="UTF-8"?> <resources> ");
{
for (final ProjectDescriptor it : projectsToRefresh) {
_builder.append("<item path="/");
String _name = it.getName();
_builder.append(_name);
_builder.append("" type="4"/> ");
}
}
_builder.append(";</resources>}");
final String refreshAttr = _builder.toString();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>");
_builder_1.newLine();
{
boolean _isEclipsePluginProject = this.getConfig().getRuntimeProject().isEclipsePluginProject();
if (_isEclipsePluginProject) {
_builder_1.append("<launchConfiguration type=\"org.eclipse.emf.mwe2.launch.Mwe2LaunchConfigurationType\">");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS\">");
_builder_1.newLine();
_builder_1.append("<listEntry value=\"/");
String _name_1 = this.getConfig().getRuntimeProject().getName();
_builder_1.append(_name_1);
_builder_1.append("\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("</listAttribute>");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES\">");
_builder_1.newLine();
_builder_1.append("<listEntry value=\"4\"/>");
_builder_1.newLine();
_builder_1.append("</listAttribute>");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"org.eclipse.debug.ui.favoriteGroups\">");
_builder_1.newLine();
_builder_1.append("<listEntry value=\"org.eclipse.debug.ui.launchGroup.debug\"/>");
_builder_1.newLine();
_builder_1.append("<listEntry value=\"org.eclipse.debug.ui.launchGroup.run\"/>");
_builder_1.newLine();
_builder_1.append("</listAttribute>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"org.eclipse.debug.core.ATTR_REFRESH_SCOPE\" value=\"");
_builder_1.append(refreshAttr);
_builder_1.append("\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("<stringAttribute key=\"org.eclipse.jdt.launching.MAIN_TYPE\" value=\"org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"org.eclipse.jdt.launching.PROGRAM_ARGUMENTS\" value=\"");
String _basePackagePath = this.getConfig().getLanguage().getBasePackagePath();
String _plus = (_basePackagePath + "/Generate");
String _simpleName = this.getConfig().getLanguage().getSimpleName();
String _replaceAll = (_plus + _simpleName).replaceAll("/", ".");
_builder_1.append(_replaceAll);
_builder_1.append("\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("<stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\"");
String _name_2 = this.getConfig().getRuntimeProject().getName();
_builder_1.append(_name_2);
_builder_1.append("\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("<stringAttribute key=\"org.eclipse.jdt.launching.VM_ARGUMENTS\" value=\"-Xmx512m\"/>");
_builder_1.newLine();
_builder_1.append("</launchConfiguration>");
_builder_1.newLine();
} else {
BuildSystem _preferredBuildSystem = this.getConfig().getPreferredBuildSystem();
boolean _equals = Objects.equal(_preferredBuildSystem, BuildSystem.MAVEN);
if (_equals) {
_builder_1.append("<launchConfiguration type=\"org.eclipse.m2e.Maven2LaunchConfigurationType\">");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"M2_DEBUG_OUTPUT\" value=\"false\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"M2_GOALS\" value=\"clean generate-sources\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"M2_NON_RECURSIVE\" value=\"false\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"M2_OFFLINE\" value=\"false\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"M2_PROFILES\" value=\"\"/>");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"M2_PROPERTIES\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"M2_RUNTIME\" value=\"EMBEDDED\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"M2_SKIP_TESTS\" value=\"false\"/>");
_builder_1.newLine();
_builder_1.append("<intAttribute key=\"M2_THREADS\" value=\"1\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"M2_UPDATE_SNAPSHOTS\" value=\"false\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"M2_USER_SETTINGS\" value=\"\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"M2_WORKSPACE_RESOLUTION\" value=\"true\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"org.eclipse.debug.core.ATTR_REFRESH_SCOPE\" value=\"");
_builder_1.append(refreshAttr);
_builder_1.append("\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("<booleanAttribute key=\"org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD\" value=\"true\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"org.eclipse.jdt.launching.WORKING_DIRECTORY\" value=\"${workspace_loc:/");
String _name_3 = this.getConfig().getRuntimeProject().getName();
_builder_1.append(_name_3);
_builder_1.append("}\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("</launchConfiguration>");
_builder_1.newLine();
} else {
BuildSystem _preferredBuildSystem_1 = this.getConfig().getPreferredBuildSystem();
boolean _equals_1 = Objects.equal(_preferredBuildSystem_1, BuildSystem.GRADLE);
if (_equals_1) {
_builder_1.append("<launchConfiguration type=\"org.eclipse.buildship.core.launch.runconfiguration\">");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"arguments\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"gradle_distribution\" value=\"GRADLE_DISTRIBUTION(WRAPPER)\"/>");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"jvm_arguments\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"show_console_view\" value=\"true\"/>");
_builder_1.newLine();
_builder_1.append("<booleanAttribute key=\"show_execution_view\" value=\"true\"/>");
_builder_1.newLine();
_builder_1.append("<listAttribute key=\"tasks\">");
_builder_1.newLine();
_builder_1.append("<listEntry value=\"build\"/>");
_builder_1.newLine();
_builder_1.append("</listAttribute>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"org.eclipse.debug.core.ATTR_REFRESH_SCOPE\" value=\"");
_builder_1.append(refreshAttr);
_builder_1.append("\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("<booleanAttribute key=\"org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD\" value=\"true\"/>");
_builder_1.newLine();
_builder_1.append("<stringAttribute key=\"org.eclipse.jdt.launching.WORKING_DIRECTORY\" value=\"${workspace_loc:/");
String _name_4 = this.getConfig().getRuntimeProject().getName();
_builder_1.append(_name_4);
_builder_1.append("}\"/>");
_builder_1.newLineIfNotEmpty();
_builder_1.append("</launchConfiguration>");
_builder_1.newLine();
}
}
}
}
_xblockexpression = _builder_1;
}
return _xblockexpression;
}
Aggregations