mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
Merge pull request #102 from kthoms/kth/issue101
[#101] Configure lineDelimiter in workflows
This commit is contained in:
commit
54b63bc0d9
11 changed files with 50 additions and 17 deletions
|
@ -25,6 +25,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ Workflow {
|
|||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
lineDelimiter = "\n"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
*******************************************************************************/
|
||||
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
|
||||
import org.eclipse.xtext.util.Strings
|
||||
|
||||
/**
|
||||
* @author Dennis Huebner - Initial contribution and API
|
||||
* @author Sven Efftinge
|
||||
|
@ -225,6 +227,7 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor {
|
|||
}
|
||||
code = {
|
||||
encoding = "«config.encoding»"
|
||||
lineDelimiter = "«Strings.convertToJavaString(config.lineDelimiter)»"
|
||||
fileHeader = "/*\n * generated by Xtext \${version}\n */"
|
||||
}
|
||||
}
|
||||
|
@ -344,10 +347,10 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor {
|
|||
</configuration>
|
||||
«IF config.needsTychoBuild»
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.emf</groupId>
|
||||
<artifactId>org.eclipse.emf.mwe2.launch</artifactId>
|
||||
<version>«config.xtextVersion.mweVersion»</version>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.emf</groupId>
|
||||
<artifactId>org.eclipse.emf.mwe2.launch</artifactId>
|
||||
<version>«config.xtextVersion.mweVersion»</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.xtext</groupId>
|
||||
|
@ -376,16 +379,16 @@ class RuntimeProjectDescriptor extends TestedProjectDescriptor {
|
|||
«IF p.enabled»
|
||||
<fileset>
|
||||
<directory>${basedir}/../«p.name»/«Outlet.MAIN_SRC_GEN.sourceFolder»/</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
«IF p instanceof TestedProjectDescriptor»
|
||||
«IF p.testProject.enabled»
|
||||
<fileset>
|
||||
<directory>${basedir}/../«if(p.testProject.isInlined) p.name else p.testProject.name»/«Outlet.TEST_SRC_GEN.sourceFolder»/</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
«ENDIF»
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.Set
|
|||
import org.eclipse.xtend.lib.annotations.Accessors
|
||||
import org.eclipse.xtext.util.XtextVersion
|
||||
import org.eclipse.xtext.util.JavaVersion
|
||||
import org.eclipse.xtext.util.Strings
|
||||
|
||||
@Accessors
|
||||
class WizardConfiguration {
|
||||
|
@ -22,6 +23,7 @@ class WizardConfiguration {
|
|||
val Ecore2XtextConfiguration ecore2Xtext = new Ecore2XtextConfiguration
|
||||
|
||||
Charset encoding = Charset.defaultCharset
|
||||
String lineDelimiter = Strings.newLine
|
||||
BuildSystem preferredBuildSystem = BuildSystem.NONE
|
||||
|
||||
SourceLayout sourceLayout = SourceLayout.PLAIN
|
||||
|
|
|
@ -17,6 +17,7 @@ import java.util.Set;
|
|||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtend2.lib.StringConcatenation;
|
||||
import org.eclipse.xtext.util.Strings;
|
||||
import org.eclipse.xtext.util.XtextVersion;
|
||||
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
|
||||
import org.eclipse.xtext.xbase.lib.Functions.Function1;
|
||||
|
@ -500,6 +501,14 @@ public class RuntimeProjectDescriptor extends TestedProjectDescriptor {
|
|||
_builder.append("\"");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("\t\t\t\t");
|
||||
_builder.append("lineDelimiter = \"");
|
||||
WizardConfiguration _config_8 = this.getConfig();
|
||||
String _lineDelimiter = _config_8.getLineDelimiter();
|
||||
String _convertToJavaString = Strings.convertToJavaString(_lineDelimiter);
|
||||
_builder.append(_convertToJavaString, "\t\t\t\t");
|
||||
_builder.append("\"");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("\t\t\t\t");
|
||||
_builder.append("fileHeader = \"/*\\n * generated by Xtext \\${version}\\n */\"");
|
||||
_builder.newLine();
|
||||
_builder.append("\t\t\t");
|
||||
|
@ -513,30 +522,30 @@ public class RuntimeProjectDescriptor extends TestedProjectDescriptor {
|
|||
_builder.newLine();
|
||||
_builder.append("\t\t\t");
|
||||
_builder.append("name = \"");
|
||||
WizardConfiguration _config_8 = this.getConfig();
|
||||
LanguageDescriptor _language_2 = _config_8.getLanguage();
|
||||
WizardConfiguration _config_9 = this.getConfig();
|
||||
LanguageDescriptor _language_2 = _config_9.getLanguage();
|
||||
String _name_1 = _language_2.getName();
|
||||
_builder.append(_name_1, "\t\t\t");
|
||||
_builder.append("\"");
|
||||
_builder.newLineIfNotEmpty();
|
||||
_builder.append("\t\t\t");
|
||||
_builder.append("fileExtensions = \"");
|
||||
WizardConfiguration _config_9 = this.getConfig();
|
||||
LanguageDescriptor _language_3 = _config_9.getLanguage();
|
||||
WizardConfiguration _config_10 = this.getConfig();
|
||||
LanguageDescriptor _language_3 = _config_10.getLanguage();
|
||||
LanguageDescriptor.FileExtensions _fileExtensions = _language_3.getFileExtensions();
|
||||
_builder.append(_fileExtensions, "\t\t\t");
|
||||
_builder.append("\"");
|
||||
_builder.newLineIfNotEmpty();
|
||||
{
|
||||
WizardConfiguration _config_10 = this.getConfig();
|
||||
Ecore2XtextConfiguration _ecore2Xtext = _config_10.getEcore2Xtext();
|
||||
WizardConfiguration _config_11 = this.getConfig();
|
||||
Ecore2XtextConfiguration _ecore2Xtext = _config_11.getEcore2Xtext();
|
||||
Set<EPackageInfo> _ePackageInfos = _ecore2Xtext.getEPackageInfos();
|
||||
boolean _isEmpty = _ePackageInfos.isEmpty();
|
||||
boolean _not = (!_isEmpty);
|
||||
if (_not) {
|
||||
{
|
||||
WizardConfiguration _config_11 = this.getConfig();
|
||||
Ecore2XtextConfiguration _ecore2Xtext_1 = _config_11.getEcore2Xtext();
|
||||
WizardConfiguration _config_12 = this.getConfig();
|
||||
Ecore2XtextConfiguration _ecore2Xtext_1 = _config_12.getEcore2Xtext();
|
||||
Set<EPackageInfo> _ePackageInfos_1 = _ecore2Xtext_1.getEPackageInfos();
|
||||
final Function1<EPackageInfo, String> _function = (EPackageInfo it) -> {
|
||||
URI _genmodelURI = it.getGenmodelURI();
|
||||
|
|
|
@ -15,6 +15,7 @@ import java.util.Collections;
|
|||
import java.util.Set;
|
||||
import org.eclipse.xtend.lib.annotations.Accessors;
|
||||
import org.eclipse.xtext.util.JavaVersion;
|
||||
import org.eclipse.xtext.util.Strings;
|
||||
import org.eclipse.xtext.util.XtextVersion;
|
||||
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
|
||||
import org.eclipse.xtext.xbase.lib.Functions.Function1;
|
||||
|
@ -51,6 +52,8 @@ public class WizardConfiguration {
|
|||
|
||||
private Charset encoding = Charset.defaultCharset();
|
||||
|
||||
private String lineDelimiter = Strings.newLine();
|
||||
|
||||
private BuildSystem preferredBuildSystem = BuildSystem.NONE;
|
||||
|
||||
private SourceLayout sourceLayout = SourceLayout.PLAIN;
|
||||
|
@ -160,6 +163,15 @@ public class WizardConfiguration {
|
|||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
@Pure
|
||||
public String getLineDelimiter() {
|
||||
return this.lineDelimiter;
|
||||
}
|
||||
|
||||
public void setLineDelimiter(final String lineDelimiter) {
|
||||
this.lineDelimiter = lineDelimiter;
|
||||
}
|
||||
|
||||
@Pure
|
||||
public BuildSystem getPreferredBuildSystem() {
|
||||
return this.preferredBuildSystem;
|
||||
|
|
Loading…
Reference in a new issue