diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePlugin/org.xtext.example.eclipsePlugin/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePlugin/org.xtext.example.eclipsePlugin/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..4beae87db --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePlugin/org.xtext.example.eclipsePlugin/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePlugin/org.xtext.example.eclipsePlugin/.launch/Launch Runtime Eclipse.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePlugin/org.xtext.example.eclipsePlugin/.launch/Launch Runtime Eclipse.launch new file mode 100644 index 000000000..c6c201998 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePlugin/org.xtext.example.eclipsePlugin/.launch/Launch Runtime Eclipse.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePluginP2/org.xtext.example.eclipsePluginP2/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePluginP2/org.xtext.example.eclipsePluginP2/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..f102f0ffc --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePluginP2/org.xtext.example.eclipsePluginP2/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePluginP2/org.xtext.example.eclipsePluginP2/.launch/Launch Runtime Eclipse.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePluginP2/org.xtext.example.eclipsePluginP2/.launch/Launch Runtime Eclipse.launch new file mode 100644 index 000000000..9d65e4864 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.eclipsePluginP2/org.xtext.example.eclipsePluginP2/.launch/Launch Runtime Eclipse.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.full/org.xtext.example.full.parent/org.xtext.example.full/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.full/org.xtext.example.full.parent/org.xtext.example.full/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..7011c9626 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.full/org.xtext.example.full.parent/org.xtext.example.full/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.full/org.xtext.example.full.parent/org.xtext.example.full/.launch/Launch Runtime Eclipse.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.full/org.xtext.example.full.parent/org.xtext.example.full/.launch/Launch Runtime Eclipse.launch new file mode 100644 index 000000000..7b4c9df46 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.full/org.xtext.example.full.parent/org.xtext.example.full/.launch/Launch Runtime Eclipse.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.gradle/org.xtext.example.gradle.parent/org.xtext.example.gradle/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.gradle/org.xtext.example.gradle.parent/org.xtext.example.gradle/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..2aa565f56 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.gradle/org.xtext.example.gradle.parent/org.xtext.example.gradle/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTycho/org.xtext.example.mavenTycho.parent/org.xtext.example.mavenTycho/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTycho/org.xtext.example.mavenTycho.parent/org.xtext.example.mavenTycho/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..486538e33 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTycho/org.xtext.example.mavenTycho.parent/org.xtext.example.mavenTycho/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTycho/org.xtext.example.mavenTycho.parent/org.xtext.example.mavenTycho/.launch/Launch Runtime Eclipse.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTycho/org.xtext.example.mavenTycho.parent/org.xtext.example.mavenTycho/.launch/Launch Runtime Eclipse.launch new file mode 100644 index 000000000..b0685b532 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTycho/org.xtext.example.mavenTycho.parent/org.xtext.example.mavenTycho/.launch/Launch Runtime Eclipse.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTychoP2/org.xtext.example.mavenTychoP2.parent/org.xtext.example.mavenTychoP2/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTychoP2/org.xtext.example.mavenTychoP2.parent/org.xtext.example.mavenTychoP2/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..15c903993 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTychoP2/org.xtext.example.mavenTychoP2.parent/org.xtext.example.mavenTychoP2/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTychoP2/org.xtext.example.mavenTychoP2.parent/org.xtext.example.mavenTychoP2/.launch/Launch Runtime Eclipse.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTychoP2/org.xtext.example.mavenTychoP2.parent/org.xtext.example.mavenTychoP2/.launch/Launch Runtime Eclipse.launch new file mode 100644 index 000000000..bf1808506 --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.mavenTychoP2/org.xtext.example.mavenTychoP2.parent/org.xtext.example.mavenTychoP2/.launch/Launch Runtime Eclipse.launch @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.plainMaven/org.xtext.example.plainMaven.parent/org.xtext.example.plainMaven/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.plainMaven/org.xtext.example.plainMaven.parent/org.xtext.example.plainMaven/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch new file mode 100644 index 000000000..aebf31d8f --- /dev/null +++ b/org.eclipse.xtext.tests/testdata/wizard-expectations/org.xtext.example.plainMaven/org.xtext.example.plainMaven.parent/org.xtext.example.plainMaven/.launch/Generate MyDsl (mydsl) Language Infrastructure.launch @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.xtend b/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.xtend index 7d1286abf..6ec2dfe9f 100644 --- a/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.xtend +++ b/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.xtend @@ -7,12 +7,11 @@ *******************************************************************************/ package org.eclipse.xtext.xtext.wizard +import org.eclipse.xtend.lib.annotations.Accessors import org.eclipse.xtext.xtext.wizard.ecore2xtext.Ecore2XtextGrammarCreator import static org.eclipse.xtext.xtext.wizard.ExternalDependency.* -import org.eclipse.xtend.lib.annotations.Accessors - class RuntimeProjectDescriptor extends TestedProjectDescriptor { val grammarCreator = new Ecore2XtextGrammarCreator @@ -113,6 +112,10 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor { files += super.files files += grammarFile files += file(Outlet.MAIN_JAVA, workflowFilePath, workflow) + files += workflowLaunchConfigFile + if (config.runtimeProject.isEclipsePluginProject) { + files += launchConfigFile + } if (isPlainMavenBuild) { files += file(Outlet.ROOT, "jar-with-ecore-model.xml", jarDescriptor) } @@ -528,4 +531,130 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor { #{"**/*.xtend","**/*.mwe2"} } + /** + * @since 2.11 + */ + def private getWorkflowLaunchConfigFile() { + file(Outlet.ROOT, '''.launch/Generate «config.language.simpleName» («config.language.fileExtensions.head») Language Infrastructure.launch'''.toString, workflowLaunchConfig) + } + + /** + * @since 2.11 + */ + def private workflowLaunchConfig() { + var projectsToRefresh = newArrayList + + projectsToRefresh += config.enabledProjects + if (config.runtimeProject.testProject.enabled) + projectsToRefresh += config.runtimeProject.testProject + if (config.uiProject.testProject.enabled) + projectsToRefresh += config.uiProject.testProject + + val refreshAttr = '''${working_set:<?xml version="1.0" encoding="UTF-8"?> <resources> «FOR it: projectsToRefresh»<item path="/«name»" type="4"/> «ENDFOR»;</resources>}''' + + ''' + + «IF config.runtimeProject.isEclipsePluginProject» + + + + + + + + + + + + + + + + + + «ELSEIF config.preferredBuildSystem == BuildSystem.MAVEN» + + + + + + + + + + + + + + + + + + «ELSEIF config.preferredBuildSystem == BuildSystem.GRADLE» + + + + + + + + + + + + + + «ENDIF» + ''' + } + + /** + * @since 2.11 + */ + def private getLaunchConfigFile() { + file(Outlet.ROOT, ".launch/Launch Runtime Eclipse.launch", launchConfig) + } + + /** + * @since 2.11 + */ + def private launchConfig() { + ''' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''' + } + } \ No newline at end of file diff --git a/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.java b/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.java index b4d9796f0..58eb5056d 100644 --- a/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.java +++ b/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/RuntimeProjectDescriptor.java @@ -203,6 +203,15 @@ public class RuntimeProjectDescriptor extends TestedProjectDescriptor { CharSequence _workflow = this.workflow(); PlainTextFile _file = this.file(Outlet.MAIN_JAVA, _workflowFilePath, _workflow); files.add(_file); + PlainTextFile _workflowLaunchConfigFile = this.getWorkflowLaunchConfigFile(); + files.add(_workflowLaunchConfigFile); + WizardConfiguration _config = this.getConfig(); + RuntimeProjectDescriptor _runtimeProject = _config.getRuntimeProject(); + boolean _isEclipsePluginProject = _runtimeProject.isEclipsePluginProject(); + if (_isEclipsePluginProject) { + PlainTextFile _launchConfigFile = this.getLaunchConfigFile(); + files.add(_launchConfigFile); + } boolean _isPlainMavenBuild = this.isPlainMavenBuild(); if (_isPlainMavenBuild) { CharSequence _jarDescriptor = this.jarDescriptor(); @@ -1568,6 +1577,315 @@ public class RuntimeProjectDescriptor extends TestedProjectDescriptor { return Collections.unmodifiableSet(CollectionLiterals.newHashSet("**/*.xtend", "**/*.mwe2")); } + /** + * @since 2.11 + */ + private PlainTextFile getWorkflowLaunchConfigFile() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append(".launch/Generate "); + WizardConfiguration _config = this.getConfig(); + LanguageDescriptor _language = _config.getLanguage(); + String _simpleName = _language.getSimpleName(); + _builder.append(_simpleName, ""); + _builder.append(" ("); + WizardConfiguration _config_1 = this.getConfig(); + LanguageDescriptor _language_1 = _config_1.getLanguage(); + LanguageDescriptor.FileExtensions _fileExtensions = _language_1.getFileExtensions(); + String _head = IterableExtensions.head(_fileExtensions); + _builder.append(_head, ""); + _builder.append(") Language Infrastructure.launch"); + String _string = _builder.toString(); + CharSequence _workflowLaunchConfig = this.workflowLaunchConfig(); + return this.file(Outlet.ROOT, _string, _workflowLaunchConfig); + } + + /** + * @since 2.11 + */ + private CharSequence workflowLaunchConfig() { + CharSequence _xblockexpression = null; + { + ArrayList projectsToRefresh = CollectionLiterals.newArrayList(); + WizardConfiguration _config = this.getConfig(); + Set _enabledProjects = _config.getEnabledProjects(); + Iterables.addAll(projectsToRefresh, _enabledProjects); + WizardConfiguration _config_1 = this.getConfig(); + RuntimeProjectDescriptor _runtimeProject = _config_1.getRuntimeProject(); + boolean _isEnabled = _runtimeProject.testProject.isEnabled(); + if (_isEnabled) { + WizardConfiguration _config_2 = this.getConfig(); + RuntimeProjectDescriptor _runtimeProject_1 = _config_2.getRuntimeProject(); + projectsToRefresh.add(_runtimeProject_1.testProject); + } + WizardConfiguration _config_3 = this.getConfig(); + UiProjectDescriptor _uiProject = _config_3.getUiProject(); + TestProjectDescriptor _testProject = _uiProject.getTestProject(); + boolean _isEnabled_1 = _testProject.isEnabled(); + if (_isEnabled_1) { + WizardConfiguration _config_4 = this.getConfig(); + UiProjectDescriptor _uiProject_1 = _config_4.getUiProject(); + TestProjectDescriptor _testProject_1 = _uiProject_1.getTestProject(); + projectsToRefresh.add(_testProject_1); + } + 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(""); + _builder_1.newLine(); + { + WizardConfiguration _config_5 = this.getConfig(); + RuntimeProjectDescriptor _runtimeProject_2 = _config_5.getRuntimeProject(); + boolean _isEclipsePluginProject = _runtimeProject_2.isEclipsePluginProject(); + if (_isEclipsePluginProject) { + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + } else { + WizardConfiguration _config_10 = this.getConfig(); + BuildSystem _preferredBuildSystem = _config_10.getPreferredBuildSystem(); + boolean _equals = Objects.equal(_preferredBuildSystem, BuildSystem.MAVEN); + if (_equals) { + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + } else { + WizardConfiguration _config_12 = this.getConfig(); + BuildSystem _preferredBuildSystem_1 = _config_12.getPreferredBuildSystem(); + boolean _equals_1 = Objects.equal(_preferredBuildSystem_1, BuildSystem.GRADLE); + if (_equals_1) { + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + _builder_1.append(""); + _builder_1.newLineIfNotEmpty(); + _builder_1.append(""); + _builder_1.newLine(); + } + } + } + } + _xblockexpression = _builder_1; + } + return _xblockexpression; + } + + /** + * @since 2.11 + */ + private PlainTextFile getLaunchConfigFile() { + CharSequence _launchConfig = this.launchConfig(); + return this.file(Outlet.ROOT, ".launch/Launch Runtime Eclipse.launch", _launchConfig); + } + + /** + * @since 2.11 + */ + private CharSequence launchConfig() { + StringConcatenation _builder = new StringConcatenation(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLineIfNotEmpty(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + _builder.append(""); + _builder.newLine(); + return _builder; + } + @Pure public boolean isWithPluginXml() { return this.withPluginXml;