Search in sources :

Example 6 with XtextVersion

use of org.eclipse.xtext.util.XtextVersion in project xtext-core by eclipse.

the class CliWizardIntegrationTest method newProjectConfig.

private static WizardConfiguration newProjectConfig() {
    WizardConfiguration _wizardConfiguration = new WizardConfiguration();
    final Procedure1<WizardConfiguration> _function = (WizardConfiguration it) -> {
        XtextVersion _xtextVersion = new XtextVersion("unspecified");
        it.setXtextVersion(_xtextVersion);
        it.setEncoding(Charsets.UTF_8);
        LanguageDescriptor _language = it.getLanguage();
        final Procedure1<LanguageDescriptor> _function_1 = (LanguageDescriptor it_1) -> {
            it_1.setName("org.xtext.example.mydsl.MyDsl");
            it_1.setFileExtensions(LanguageDescriptor.FileExtensions.fromString("mydsl"));
        };
        ObjectExtensions.<LanguageDescriptor>operator_doubleArrow(_language, _function_1);
    };
    return ObjectExtensions.<WizardConfiguration>operator_doubleArrow(_wizardConfiguration, _function);
}
Also used : XtextVersion(org.eclipse.xtext.util.XtextVersion) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) LanguageDescriptor(org.eclipse.xtext.xtext.wizard.LanguageDescriptor) WizardConfiguration(org.eclipse.xtext.xtext.wizard.WizardConfiguration)

Example 7 with XtextVersion

use of org.eclipse.xtext.util.XtextVersion in project xtext-core by eclipse.

the class ParentProjectDescriptor method buildGradle.

@Override
public GradleBuildFile buildGradle() {
    GradleBuildFile _buildGradle = super.buildGradle();
    final Procedure1<GradleBuildFile> _function = (GradleBuildFile it) -> {
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("buildscript {");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("repositories {");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("jcenter()");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("}");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("dependencies {");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("classpath \'org.xtext:xtext-gradle-plugin:");
        String _xtextGradlePluginVersion = this.getConfig().getXtextVersion().getXtextGradlePluginVersion();
        _builder.append(_xtextGradlePluginVersion, "\t\t");
        _builder.append("\'");
        _builder.newLineIfNotEmpty();
        {
            boolean _isEnabled = this.getConfig().getIntellijProject().isEnabled();
            if (_isEnabled) {
                _builder.append("\t\t");
                _builder.append("classpath \'org.xtext:xtext-idea-gradle-plugin:");
                String _xtextGradlePluginVersion_1 = this.getConfig().getXtextVersion().getXtextGradlePluginVersion();
                _builder.append(_xtextGradlePluginVersion_1, "\t\t");
                _builder.append("\'");
                _builder.newLineIfNotEmpty();
            }
        }
        _builder.append("\t");
        _builder.append("}");
        _builder.newLine();
        _builder.append("}");
        _builder.newLine();
        _builder.newLine();
        _builder.append("subprojects {");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("ext.xtextVersion = \'");
        XtextVersion _xtextVersion = this.getConfig().getXtextVersion();
        _builder.append(_xtextVersion, "\t");
        _builder.append("\'");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("repositories {");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("jcenter()");
        _builder.newLine();
        {
            boolean _isSnapshot = this.getConfig().getXtextVersion().isSnapshot();
            if (_isSnapshot) {
                _builder.append("\t\t");
                _builder.append("maven {");
                _builder.newLine();
                _builder.append("\t\t");
                _builder.append("\t");
                _builder.append("url \'https://oss.sonatype.org/content/repositories/snapshots\'");
                _builder.newLine();
                _builder.append("\t\t");
                _builder.append("}");
                _builder.newLine();
            }
        }
        _builder.append("\t");
        _builder.append("}");
        _builder.newLine();
        _builder.append("\t");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("apply plugin: \'java\'");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("apply plugin: \'org.xtext.xtend\'");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("apply from: \"${rootDir}/gradle/source-layout.gradle\"");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("apply from: \"${rootDir}/gradle/maven-deployment.gradle\"");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("apply plugin: \'eclipse\'");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("apply plugin: \'idea\'");
        _builder.newLine();
        _builder.append("\t");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("group = \'");
        String _baseName = this.getConfig().getBaseName();
        _builder.append(_baseName, "\t");
        _builder.append("\'");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("version = \'1.0.0-SNAPSHOT\'");
        _builder.newLine();
        _builder.append("\t");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("sourceCompatibility = \'");
        String _javaVersion = this.getJavaVersion();
        _builder.append(_javaVersion, "\t");
        _builder.append("\'");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("targetCompatibility = \'");
        String _javaVersion_1 = this.getJavaVersion();
        _builder.append(_javaVersion_1, "\t");
        _builder.append("\'");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("configurations.all {");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("exclude group: \'asm\'");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("}");
        _builder.newLine();
        _builder.append("}");
        _builder.newLine();
        it.setAdditionalContent(_builder.toString());
    };
    return ObjectExtensions.<GradleBuildFile>operator_doubleArrow(_buildGradle, _function);
}
Also used : GradleBuildFile(org.eclipse.xtext.xtext.wizard.GradleBuildFile) XtextVersion(org.eclipse.xtext.util.XtextVersion) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation)

Aggregations

XtextVersion (org.eclipse.xtext.util.XtextVersion)7 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)3 IntellijProjectDescriptor (org.eclipse.xtext.xtext.wizard.IntellijProjectDescriptor)2 UiProjectDescriptor (org.eclipse.xtext.xtext.wizard.UiProjectDescriptor)2 Test (org.junit.Test)2 Charset (java.nio.charset.Charset)1 StringConcatenationClient (org.eclipse.xtend2.lib.StringConcatenationClient)1 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)1 TextFileAccess (org.eclipse.xtext.xtext.generator.model.TextFileAccess)1 GradleBuildFile (org.eclipse.xtext.xtext.wizard.GradleBuildFile)1 LanguageDescriptor (org.eclipse.xtext.xtext.wizard.LanguageDescriptor)1 Outlet (org.eclipse.xtext.xtext.wizard.Outlet)1 PomFile (org.eclipse.xtext.xtext.wizard.PomFile)1 ProjectDescriptor (org.eclipse.xtext.xtext.wizard.ProjectDescriptor)1 ProjectLayout (org.eclipse.xtext.xtext.wizard.ProjectLayout)1 WizardConfiguration (org.eclipse.xtext.xtext.wizard.WizardConfiguration)1