Search in sources :

Example 1 with ProjectLayout

use of org.eclipse.xtext.xtext.wizard.ProjectLayout in project xtext-core by eclipse.

the class ParentProjectDescriptor method pom.

@Override
public PomFile pom() {
    PomFile _pom = super.pom();
    final Procedure1<PomFile> _function = (PomFile it) -> {
        it.setPackaging("pom");
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("<properties>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<xtextVersion>");
        XtextVersion _xtextVersion = this.getConfig().getXtextVersion();
        _builder.append(_xtextVersion, "\t");
        _builder.append("</xtextVersion>");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("<project.build.sourceEncoding>");
        Charset _encoding = this.getConfig().getEncoding();
        _builder.append(_encoding, "\t");
        _builder.append("</project.build.sourceEncoding>");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("<maven.compiler.source>");
        String _javaVersion = this.getJavaVersion();
        _builder.append(_javaVersion, "\t");
        _builder.append("</maven.compiler.source>");
        _builder.newLineIfNotEmpty();
        _builder.append("\t");
        _builder.append("<maven.compiler.target>");
        String _javaVersion_1 = this.getJavaVersion();
        _builder.append(_javaVersion_1, "\t");
        _builder.append("</maven.compiler.target>");
        _builder.newLineIfNotEmpty();
        {
            boolean _needsTychoBuild = this.getConfig().needsTychoBuild();
            if (_needsTychoBuild) {
                _builder.append("\t");
                _builder.append("<!-- Tycho settings -->");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("<tycho-version>1.1.0</tycho-version>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("<!-- Define overridable properties for tycho-surefire-plugin -->");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("<platformSystemProperties></platformSystemProperties>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("<moduleProperties></moduleProperties>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("<systemProperties></systemProperties>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("<tycho.testArgLine></tycho.testArgLine>");
                _builder.newLine();
            }
        }
        _builder.append("</properties>");
        _builder.newLine();
        _builder.append("<modules>");
        _builder.newLine();
        {
            final Function1<ProjectDescriptor, Boolean> _function_1 = (ProjectDescriptor it_1) -> {
                return Boolean.valueOf(((!Objects.equal(it_1, this)) && it_1.isPartOfMavenBuild()));
            };
            Iterable<ProjectDescriptor> _filter = IterableExtensions.<ProjectDescriptor>filter(this.getConfig().getEnabledProjects(), _function_1);
            for (final ProjectDescriptor p : _filter) {
                _builder.append("\t");
                _builder.append("<module>");
                {
                    ProjectLayout _projectLayout = this.getConfig().getProjectLayout();
                    boolean _equals = Objects.equal(_projectLayout, ProjectLayout.FLAT);
                    if (_equals) {
                        _builder.append("../");
                    }
                }
                String _name = p.getName();
                _builder.append(_name, "\t");
                _builder.append("</module>");
                _builder.newLineIfNotEmpty();
            }
        }
        _builder.append("</modules>");
        _builder.newLine();
        _builder.append("<build>");
        _builder.newLine();
        {
            boolean _needsTychoBuild_1 = this.getConfig().needsTychoBuild();
            if (_needsTychoBuild_1) {
                _builder.append("\t");
                _builder.append("<plugins>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<plugin>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<groupId>org.eclipse.tycho</groupId>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<artifactId>tycho-maven-plugin</artifactId>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<version>${tycho-version}</version>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<extensions>true</extensions>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("</plugin>");
                _builder.newLine();
                {
                    boolean _isEnabled = this.getConfig().getP2Project().isEnabled();
                    if (_isEnabled) {
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<plugin>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<groupId>org.eclipse.tycho</groupId>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<artifactId>tycho-source-plugin</artifactId>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<version>${tycho-version}</version>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<executions>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("<execution>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<id>plugin-source</id>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<goals>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t\t");
                        _builder.append("<goal>plugin-source</goal>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("</goals>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("</execution>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("</executions>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("</plugin>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<plugin>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<groupId>org.eclipse.tycho.extras</groupId>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<artifactId>tycho-source-feature-plugin</artifactId>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<version>${tycho-version}</version>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<executions>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("<execution>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<id>source-feature</id>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<phase>package</phase>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<goals>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t\t");
                        _builder.append("<goal>source-feature</goal>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("</goals>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("</execution>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("</executions>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("</plugin>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<plugin>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<groupId>org.eclipse.tycho</groupId>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<artifactId>tycho-p2-plugin</artifactId>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<version>${tycho-version}</version>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("<executions>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("<execution>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<id>attach-p2-metadata</id>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<phase>package</phase>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("<goals>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t\t");
                        _builder.append("<goal>p2-metadata</goal>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t\t");
                        _builder.append("</goals>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t\t");
                        _builder.append("</execution>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("</executions>");
                        _builder.newLine();
                        _builder.append("\t");
                        _builder.append("\t");
                        _builder.append("</plugin>");
                        _builder.newLine();
                    }
                }
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<plugin>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<groupId>org.eclipse.tycho</groupId>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<artifactId>target-platform-configuration</artifactId>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<version>${tycho-version}</version>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("<configuration>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t");
                _builder.append("<target>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("<artifact>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<groupId>");
                String _baseName = this.getConfig().getBaseName();
                _builder.append(_baseName, "\t\t\t\t\t\t");
                _builder.append("</groupId>");
                _builder.newLineIfNotEmpty();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<artifactId>");
                String _name_1 = this.getConfig().getTargetPlatformProject().getName();
                _builder.append(_name_1, "\t\t\t\t\t\t");
                _builder.append("</artifactId>");
                _builder.newLineIfNotEmpty();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<version>${project.version}</version>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("</artifact>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t");
                _builder.append("</target>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t");
                _builder.append("<environments>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("<environment>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<os>macosx</os>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<ws>cocoa</ws>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<arch>x86_64</arch>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("</environment>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("<environment>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<os>win32</os>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<ws>win32</ws>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<arch>x86_64</arch>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("</environment>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("<environment>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<os>linux</os>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<ws>gtk</ws>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t\t");
                _builder.append("<arch>x86_64</arch>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t\t");
                _builder.append("</environment>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t\t");
                _builder.append("</environments>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t\t");
                _builder.append("</configuration>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("</plugin>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("</plugins>");
                _builder.newLine();
            }
        }
        _builder.append("\t");
        _builder.append("<pluginManagement>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<plugins>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<plugin>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<groupId>org.eclipse.xtend</groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<artifactId>xtend-maven-plugin</artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<version>${xtextVersion}</version>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<executions>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("<execution>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t");
        _builder.append("<goals>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("<goal>compile</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("<goal>xtend-install-debug-info</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("<goal>testCompile</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("<goal>xtend-test-install-debug-info</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t");
        _builder.append("</goals>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("</execution>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("</executions>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<configuration>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("<outputDirectory>${basedir}/");
        String _sourceFolder = this.sourceFolder(Outlet.MAIN_XTEND_GEN);
        _builder.append(_sourceFolder, "\t\t\t\t\t");
        _builder.append("</outputDirectory>");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t\t\t\t");
        _builder.append("<testOutputDirectory>${basedir}/");
        String _sourceFolder_1 = this.sourceFolder(Outlet.TEST_XTEND_GEN);
        _builder.append(_sourceFolder_1, "\t\t\t\t\t");
        _builder.append("</testOutputDirectory>");
        _builder.newLineIfNotEmpty();
        _builder.append("\t\t\t\t");
        _builder.append("</configuration>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("</plugin>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<plugin>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<groupId>org.apache.maven.plugins</groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<artifactId>maven-clean-plugin</artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<version>2.5</version>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<configuration>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("<filesets>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t");
        _builder.append("<fileset>");
        _builder.newLine();
        {
            final Function1<Outlet, String> _function_2 = (Outlet it_1) -> {
                return this.sourceFolder(it_1);
            };
            Set<String> _set = IterableExtensions.<String>toSet(ListExtensions.<Outlet, String>map(Collections.<Outlet>unmodifiableList(CollectionLiterals.<Outlet>newArrayList(Outlet.MAIN_XTEND_GEN, Outlet.TEST_XTEND_GEN)), _function_2));
            for (final String dir : _set) {
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("<directory>${basedir}/");
                _builder.append(dir, "\t\t\t\t\t\t\t");
                _builder.append("</directory>");
                _builder.newLineIfNotEmpty();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("<includes>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("<include>**/*</include>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("</includes>");
                _builder.newLine();
            }
        }
        _builder.append("\t\t\t\t\t\t");
        _builder.append("</fileset>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("</filesets>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("</configuration>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("</plugin>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<plugin>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<groupId>org.eclipse.m2e</groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<artifactId>lifecycle-mapping</artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<version>1.0.0</version>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<configuration>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("<lifecycleMappingMetadata>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t");
        _builder.append("<pluginExecutions>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("<pluginExecution>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("<pluginExecutionFilter>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("org.apache.maven.plugins");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("maven-resources-plugin");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<versionRange>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("[2.4.3,)");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</versionRange>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<goals>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("<goal>resources</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("<goal>testResources</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</goals>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("</pluginExecutionFilter>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("<action>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<ignore></ignore>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("</action>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("</pluginExecution>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("<pluginExecution>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("<pluginExecutionFilter>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("org.codehaus.mojo");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</groupId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("build-helper-maven-plugin");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</artifactId>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<versionRange>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("[1.9.1,)");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</versionRange>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<goals>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("<goal>add-resource</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("<goal>add-source</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("<goal>add-test-resource</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t\t");
        _builder.append("<goal>add-test-source</goal>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("</goals>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("</pluginExecutionFilter>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("<action>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t\t");
        _builder.append("<ignore></ignore>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t\t");
        _builder.append("</action>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t\t\t");
        _builder.append("</pluginExecution>");
        _builder.newLine();
        {
            boolean _needsTychoBuild_2 = this.getConfig().needsTychoBuild();
            if (_needsTychoBuild_2) {
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("<pluginExecution>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("<pluginExecutionFilter>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<groupId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("org.eclipse.tycho");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</groupId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<artifactId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("tycho-compiler-plugin");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</artifactId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<versionRange>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("[0.23.1,)");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</versionRange>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<goals>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("<goal>compile</goal>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</goals>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("</pluginExecutionFilter>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("<action>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<ignore></ignore>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("</action>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("</pluginExecution>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("<pluginExecution>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("<pluginExecutionFilter>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<groupId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("org.eclipse.tycho");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</groupId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<artifactId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("tycho-packaging-plugin");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</artifactId>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<versionRange>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("[0.23.1,)");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</versionRange>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<goals>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("<goal>build-qualifier</goal>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("<goal>build-qualifier-aggregator</goal>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("<goal>validate-id</goal>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t\t");
                _builder.append("<goal>validate-version</goal>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("</goals>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("</pluginExecutionFilter>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("<action>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t\t");
                _builder.append("<ignore></ignore>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("\t");
                _builder.append("</action>");
                _builder.newLine();
                _builder.append("\t\t\t\t\t\t\t");
                _builder.append("</pluginExecution>");
                _builder.newLine();
            }
        }
        _builder.append("\t\t\t\t\t\t");
        _builder.append("</pluginExecutions>");
        _builder.newLine();
        _builder.append("\t\t\t\t\t");
        _builder.append("</lifecycleMappingMetadata>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("</configuration>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("</plugin>");
        _builder.newLine();
        {
            boolean _needsTychoBuild_3 = this.getConfig().needsTychoBuild();
            if (_needsTychoBuild_3) {
                _builder.append("\t\t\t");
                _builder.append("<plugin>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<!-- ");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t\t");
                _builder.append("Can be removed after first generator execution");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t\t");
                _builder.append("https://bugs.eclipse.org/bugs/show_bug.cgi?id=480097");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("-->");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<groupId>org.eclipse.tycho</groupId>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<artifactId>tycho-compiler-plugin</artifactId>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<version>${tycho-version}</version>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<configuration>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t\t");
                _builder.append("<compilerArgument>-err:-forbidden</compilerArgument>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t\t");
                _builder.append("<useProjectSettings>false</useProjectSettings>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("</configuration>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("</plugin>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("<!-- to skip running (and compiling) tests use commandline flag: -Dmaven.test.skip");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("To skip tests, but still compile them, use: -DskipTests");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("To allow all tests in a pom to pass/fail, use commandline flag: -fae (fail");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("at end) -->");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("<plugin>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<groupId>org.eclipse.tycho</groupId>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<artifactId>tycho-surefire-plugin</artifactId>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<version>${tychoVersion}</version>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("<configuration>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t\t");
                _builder.append("<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t\t");
                _builder.append("<argLine>${tycho.testArgLine} ${platformSystemProperties} ${systemProperties} ${moduleProperties}</argLine>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("\t");
                _builder.append("</configuration>");
                _builder.newLine();
                _builder.append("\t\t\t");
                _builder.append("</plugin>");
                _builder.newLine();
            }
        }
        _builder.append("\t\t");
        _builder.append("</plugins>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</pluginManagement>");
        _builder.newLine();
        _builder.append("</build>");
        _builder.newLine();
        _builder.append("<repositories>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<repository>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<id>codehaus-snapshots</id>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<name>disable dead \'Codehaus Snapshots\' repository, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481478</name>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<url>http://nexus.codehaus.org/snapshots/</url>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<releases>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<enabled>false</enabled>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</releases>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<snapshots>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<enabled>false</enabled>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</snapshots>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</repository>");
        _builder.newLine();
        {
            boolean _isSnapshot = this.getConfig().getXtextVersion().isSnapshot();
            if (_isSnapshot) {
                _builder.append("\t");
                _builder.append("<repository>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<id>sonatype-snapshots</id>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<url>https://oss.sonatype.org/content/repositories/snapshots</url>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<releases><enabled>false</enabled></releases>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<snapshots><enabled>true</enabled></snapshots>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("</repository>");
                _builder.newLine();
            }
        }
        _builder.append("</repositories>");
        _builder.newLine();
        _builder.append("<pluginRepositories>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<pluginRepository>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<id>codehaus-snapshots</id>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<name>disable dead \'Codehaus Snapshots\' repository, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481478</name>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<url>http://nexus.codehaus.org/snapshots/</url>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<releases>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<enabled>false</enabled>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</releases>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<snapshots>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<enabled>false</enabled>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</snapshots>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</pluginRepository>");
        _builder.newLine();
        {
            boolean _isSnapshot_1 = this.getConfig().getXtextVersion().isSnapshot();
            if (_isSnapshot_1) {
                _builder.append("\t");
                _builder.append("<pluginRepository>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<id>sonatype-snapshots</id>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<url>https://oss.sonatype.org/content/repositories/snapshots</url>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<releases><enabled>false</enabled></releases>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("\t");
                _builder.append("<snapshots><enabled>true</enabled></snapshots>");
                _builder.newLine();
                _builder.append("\t");
                _builder.append("</pluginRepository>");
                _builder.newLine();
            }
        }
        _builder.append("</pluginRepositories>");
        _builder.newLine();
        _builder.append("<profiles>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<profile>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<id>macos</id>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<activation>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<os>");
        _builder.newLine();
        _builder.append("\t\t\t\t");
        _builder.append("<family>mac</family>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("</os>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</activation>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<properties>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<platformSystemProperties>-XstartOnFirstThread</platformSystemProperties>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</properties>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</profile>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("<profile>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<id>jdk9-or-newer</id>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<activation>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<jdk>[9,)</jdk>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</activation>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("<properties>");
        _builder.newLine();
        _builder.append("\t\t\t");
        _builder.append("<moduleProperties>--add-modules=ALL-SYSTEM</moduleProperties>");
        _builder.newLine();
        _builder.append("\t\t");
        _builder.append("</properties>");
        _builder.newLine();
        _builder.append("\t");
        _builder.append("</profile>");
        _builder.newLine();
        _builder.append("</profiles>");
        _builder.newLine();
        it.setBuildSection(_builder.toString());
    };
    return ObjectExtensions.<PomFile>operator_doubleArrow(_pom, _function);
}
Also used : ProjectLayout(org.eclipse.xtext.xtext.wizard.ProjectLayout) XtextVersion(org.eclipse.xtext.util.XtextVersion) Charset(java.nio.charset.Charset) ProjectDescriptor(org.eclipse.xtext.xtext.wizard.ProjectDescriptor) PomFile(org.eclipse.xtext.xtext.wizard.PomFile) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Outlet(org.eclipse.xtext.xtext.wizard.Outlet)

Example 2 with ProjectLayout

use of org.eclipse.xtext.xtext.wizard.ProjectLayout in project xtext-core by eclipse.

the class PomFile method getContent.

@Override
public String getContent() {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("<modelVersion>4.0.0</modelVersion>");
    _builder.newLine();
    {
        ProjectDescriptor _project = this.getProject();
        ParentProjectDescriptor _parentProject = this.getProject().getConfig().getParentProject();
        boolean _notEquals = (!Objects.equal(_project, _parentProject));
        if (_notEquals) {
            _builder.append("\t");
            _builder.append("<parent>");
            _builder.newLine();
            _builder.append("\t");
            _builder.append("\t");
            _builder.append("<groupId>");
            String _baseName = this.getProject().getConfig().getBaseName();
            _builder.append(_baseName, "\t\t");
            _builder.append("</groupId>");
            _builder.newLineIfNotEmpty();
            _builder.append("\t");
            _builder.append("\t");
            _builder.append("<artifactId>");
            String _name = this.getProject().getConfig().getParentProject().getName();
            _builder.append(_name, "\t\t");
            _builder.append("</artifactId>");
            _builder.newLineIfNotEmpty();
            _builder.append("\t");
            _builder.append("\t");
            _builder.append("<version>1.0.0-SNAPSHOT</version>");
            _builder.newLine();
            {
                ProjectLayout _projectLayout = this.getProject().getConfig().getProjectLayout();
                boolean _equals = Objects.equal(_projectLayout, ProjectLayout.FLAT);
                if (_equals) {
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<relativePath>../");
                    String _name_1 = this.getProject().getConfig().getParentProject().getName();
                    _builder.append(_name_1, "\t\t");
                    _builder.append("/pom.xml</relativePath>");
                    _builder.newLineIfNotEmpty();
                }
            }
            _builder.append("\t");
            _builder.append("</parent>");
            _builder.newLine();
        } else {
            _builder.append("\t");
            _builder.append("<groupId>");
            String _baseName_1 = this.getProject().getConfig().getBaseName();
            _builder.append(_baseName_1, "\t");
            _builder.append("</groupId>");
            _builder.newLineIfNotEmpty();
            _builder.append("\t");
            _builder.append("<version>1.0.0-SNAPSHOT</version>");
            _builder.newLine();
        }
    }
    _builder.append("\t");
    _builder.append("<artifactId>");
    String _name_2 = this.getProject().getName();
    _builder.append(_name_2, "\t");
    _builder.append("</artifactId>");
    _builder.newLineIfNotEmpty();
    _builder.append("\t");
    _builder.append("<packaging>");
    _builder.append(this.packaging, "\t");
    _builder.append("</packaging>");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    _builder.append("\t");
    _builder.append(this.buildSection, "\t");
    _builder.newLineIfNotEmpty();
    _builder.newLine();
    {
        boolean _isEclipsePluginProject = this.getProject().isEclipsePluginProject();
        boolean _not = (!_isEclipsePluginProject);
        if (_not) {
            _builder.append("\t");
            _builder.append("<dependencies>");
            _builder.newLine();
            {
                Set<? extends ProjectDescriptor> _upstreamProjects = this.getProject().getUpstreamProjects();
                for (final ProjectDescriptor p : _upstreamProjects) {
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<dependency>");
                    _builder.newLine();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<groupId>${project.groupId}</groupId>");
                    _builder.newLine();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<artifactId>");
                    String _name_3 = p.getName();
                    _builder.append(_name_3, "\t\t\t");
                    _builder.append("</artifactId>");
                    _builder.newLineIfNotEmpty();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<version>${project.version}</version>");
                    _builder.newLine();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("</dependency>");
                    _builder.newLine();
                }
            }
            {
                final Function1<ExternalDependency, ExternalDependency.MavenCoordinates> _function = (ExternalDependency it) -> {
                    return it.getMaven();
                };
                final Function1<ExternalDependency.MavenCoordinates, Boolean> _function_1 = (ExternalDependency.MavenCoordinates it) -> {
                    String _artifactId = it.getArtifactId();
                    return Boolean.valueOf((_artifactId != null));
                };
                Iterable<ExternalDependency.MavenCoordinates> _filter = IterableExtensions.<ExternalDependency.MavenCoordinates>filter(IterableExtensions.<ExternalDependency, ExternalDependency.MavenCoordinates>map(this.getProject().getExternalDependencies(), _function), _function_1);
                for (final ExternalDependency.MavenCoordinates dep : _filter) {
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<dependency>");
                    _builder.newLine();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<groupId>");
                    String _groupId = dep.getGroupId();
                    _builder.append(_groupId, "\t\t\t");
                    _builder.append("</groupId>");
                    _builder.newLineIfNotEmpty();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<artifactId>");
                    String _artifactId = dep.getArtifactId();
                    _builder.append(_artifactId, "\t\t\t");
                    _builder.append("</artifactId>");
                    _builder.newLineIfNotEmpty();
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("<version>");
                    String _version = dep.getVersion();
                    _builder.append(_version, "\t\t\t");
                    _builder.append("</version>");
                    _builder.newLineIfNotEmpty();
                    {
                        Scope _scope = dep.getScope();
                        boolean _notEquals_1 = (!Objects.equal(_scope, Scope.COMPILE));
                        if (_notEquals_1) {
                            _builder.append("\t");
                            _builder.append("\t");
                            _builder.append("\t");
                            _builder.append("<scope>");
                            String _mavenNotation = dep.getScope().getMavenNotation();
                            _builder.append(_mavenNotation, "\t\t\t");
                            _builder.append("</scope>");
                            _builder.newLineIfNotEmpty();
                        }
                    }
                    {
                        boolean _isOptional = dep.isOptional();
                        if (_isOptional) {
                            _builder.append("\t");
                            _builder.append("\t");
                            _builder.append("\t");
                            _builder.append("<optional>true</optional>");
                            _builder.newLine();
                        }
                    }
                    _builder.append("\t");
                    _builder.append("\t");
                    _builder.append("</dependency>");
                    _builder.newLine();
                }
            }
            _builder.append("\t");
            _builder.append("</dependencies>");
            _builder.newLine();
        }
    }
    _builder.append("\t");
    _builder.append(this.profileSection, "\t");
    _builder.newLineIfNotEmpty();
    _builder.append("</project>");
    _builder.newLine();
    return _builder.toString();
}
Also used : ExternalDependency(org.eclipse.xtext.xtext.wizard.ExternalDependency) ProjectLayout(org.eclipse.xtext.xtext.wizard.ProjectLayout) ParentProjectDescriptor(org.eclipse.xtext.xtext.wizard.ParentProjectDescriptor) Scope(org.eclipse.xtext.xtext.wizard.Scope) ProjectDescriptor(org.eclipse.xtext.xtext.wizard.ProjectDescriptor) ParentProjectDescriptor(org.eclipse.xtext.xtext.wizard.ParentProjectDescriptor) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation)

Example 3 with ProjectLayout

use of org.eclipse.xtext.xtext.wizard.ProjectLayout in project xtext-core by eclipse.

the class ProjectDescriptor method getLocation.

public String getLocation() {
    String _xifexpression = null;
    ProjectLayout _projectLayout = this.config.getProjectLayout();
    boolean _equals = Objects.equal(_projectLayout, ProjectLayout.FLAT);
    if (_equals) {
        String _rootLocation = this.config.getRootLocation();
        String _plus = (_rootLocation + "/");
        String _name = this.getName();
        _xifexpression = (_plus + _name);
    } else {
        String _location = this.config.getParentProject().getLocation();
        String _plus_1 = (_location + "/");
        String _name_1 = this.getName();
        _xifexpression = (_plus_1 + _name_1);
    }
    return _xifexpression;
}
Also used : ProjectLayout(org.eclipse.xtext.xtext.wizard.ProjectLayout)

Example 4 with ProjectLayout

use of org.eclipse.xtext.xtext.wizard.ProjectLayout in project xtext-core by eclipse.

the class ParentProjectDescriptor method settingsGradle.

public CharSequence settingsGradle() {
    StringConcatenation _builder = new StringConcatenation();
    {
        final Function1<ProjectDescriptor, Boolean> _function = (ProjectDescriptor it) -> {
            return Boolean.valueOf(((!Objects.equal(it, this)) && it.isPartOfGradleBuild()));
        };
        Iterable<ProjectDescriptor> _filter = IterableExtensions.<ProjectDescriptor>filter(this.getConfig().getEnabledProjects(), _function);
        for (final ProjectDescriptor p : _filter) {
            {
                ProjectLayout _projectLayout = this.getConfig().getProjectLayout();
                boolean _equals = Objects.equal(_projectLayout, ProjectLayout.FLAT);
                if (_equals) {
                    _builder.append("includeFlat");
                } else {
                    _builder.append("include");
                }
            }
            _builder.append(" \'");
            String _name = p.getName();
            _builder.append(_name);
            _builder.append("\'");
            _builder.newLineIfNotEmpty();
        }
    }
    return _builder;
}
Also used : ProjectLayout(org.eclipse.xtext.xtext.wizard.ProjectLayout) ProjectDescriptor(org.eclipse.xtext.xtext.wizard.ProjectDescriptor) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1)

Aggregations

ProjectLayout (org.eclipse.xtext.xtext.wizard.ProjectLayout)4 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)3 ProjectDescriptor (org.eclipse.xtext.xtext.wizard.ProjectDescriptor)3 Charset (java.nio.charset.Charset)1 XtextVersion (org.eclipse.xtext.util.XtextVersion)1 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)1 ExternalDependency (org.eclipse.xtext.xtext.wizard.ExternalDependency)1 Outlet (org.eclipse.xtext.xtext.wizard.Outlet)1 ParentProjectDescriptor (org.eclipse.xtext.xtext.wizard.ParentProjectDescriptor)1 PomFile (org.eclipse.xtext.xtext.wizard.PomFile)1 Scope (org.eclipse.xtext.xtext.wizard.Scope)1