Skip to content

Commit

Permalink
Initialize XText Project
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-ka committed Oct 19, 2018
1 parent 9b79132 commit 6042aae
Show file tree
Hide file tree
Showing 39 changed files with 1,721 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Compiled class file
*.class
**/target

# Log file
*.log
Expand All @@ -21,3 +22,13 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Eclipse files
*.project
*.classpath
**/.settings

# Xtext generated sources
**/src-gen
**/xtend-gen
**/model/generated/
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.contextmapper.dsl.ide
Bundle-ManifestVersion: 2
Bundle-Name: org.contextmapper.dsl.ide
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: org.contextmapper.dsl.ide; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.contextmapper.dsl,
org.eclipse.xtext.ide,
org.eclipse.xtext.xbase.ide,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.contextmapper.dsl.ide.contentassist.antlr.internal,
org.contextmapper.dsl.ide.contentassist.antlr

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
160 changes: 160 additions & 0 deletions org.contextmapper.dsl.parent/org.contextmapper.dsl.ide/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.contextmapper.dsl</groupId>
<artifactId>org.contextmapper.dsl.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>org.contextmapper.dsl.ide</artifactId>
<packaging>eclipse-plugin</packaging>

<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.eclipse.lsp4j</groupId>
<artifactId>org.eclipse.lsp4j</artifactId>
<version>0.5.0</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>6.2.1</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-tree</artifactId>
<version>6.2.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
<excludeTransitive>true</excludeTransitive>
<excludeArtifactIds>
com.ibm.icu,
org.apache.ant,
org.apache.commons.lang,
org.apache.commons.logging,
org.eclipse.core.commands,
org.eclipse.core.contenttype,
org.eclipse.core.expressions,
org.eclipse.core.filesystem,
org.eclipse.core.jobs,
org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.core.variables,
org.eclipse.debug.core,
org.eclipse.emf.codegen.ecore,
org.eclipse.emf.codegen,
org.eclipse.emf.mwe.core,
org.eclipse.emf.mwe.utils,
org.eclipse.emf.mwe2.lib,
org.eclipse.emf.mwe2.runtime,
org.eclipse.equinox.app,
org.eclipse.equinox.preferences,
org.eclipse.equinox.registry,
org.eclipse.jdt.core,
org.eclipse.jdt.debug,
org.eclipse.jdt.launching,
org.eclipse.text,
org.eclipse.xtend.typesystem.emf,
org.eclipse.xtend,
</excludeArtifactIds>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>add-jars</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/libs</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
<configuration>
<assembleDirectory>${project.build.directory}/languageserver</assembleDirectory>
<repositoryLayout>flat</repositoryLayout>
<useWildcardClassPath>true</useWildcardClassPath>
<!-- uncomment to enable remote debugging
<extraJvmArguments>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000</extraJvmArguments>
-->
<programs>
<program>
<id>mydsl-ls</id>
<mainClass>org.eclipse.xtext.ide.server.ServerLauncher</mainClass>
<!-- uncomment to enable options
<commandLineArguments>
<commandLineArgument>-trace</commandLineArgument>
<commandLineArgument>-log</commandLineArgument>
<commandLineArgument>-noValidate</commandLineArgument>
</commandLineArguments>
-->
</program>
</programs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* generated by Xtext 2.15.0
*/
package org.contextmapper.dsl.ide


/**
* Use this class to register ide components.
*/
class ContextMappingDSLIdeModule extends AbstractContextMappingDSLIdeModule {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* generated by Xtext 2.15.0
*/
package org.contextmapper.dsl.ide

import com.google.inject.Guice
import org.contextmapper.dsl.ContextMappingDSLRuntimeModule
import org.contextmapper.dsl.ContextMappingDSLStandaloneSetup
import org.eclipse.xtext.util.Modules2

/**
* Initialization support for running Xtext languages as language servers.
*/
class ContextMappingDSLIdeSetup extends ContextMappingDSLStandaloneSetup {

override createInjector() {
Guice.createInjector(Modules2.mixin(new ContextMappingDSLRuntimeModule, new ContextMappingDSLIdeModule))
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="org.contextmapper.dsl.target" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.jdt.feature.group" version="0.0.0"/>
<unit id="org.eclipse.platform.feature.group" version="0.0.0"/>
<unit id="org.eclipse.pde.feature.group" version="0.0.0"/>
<unit id="org.eclipse.draw2d.feature.group" version="0.0.0"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/releases/2018-09"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.mwe2.launcher.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/modeling/emft/mwe/updates/releases/2.9.1/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.15.0/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="com.google.gson" version="2.7.0.v20170129-0911"/>
<unit id="org.antlr.runtime" version="3.2.0.v201101311130"/>
<unit id="org.junit" version="4.12.0.v201504281640"/>
<unit id="org.junit.jupiter.api" version="5.1.0.v20180327-1502"/>
<unit id="org.junit.jupiter.engine" version="5.1.0.v20180327-1502"/>
<unit id="org.junit.platform.commons" version="1.1.0.v20180327-1502"/>
<unit id="org.junit.platform.engine" version="1.1.0.v20180327-1502"/>
<unit id="org.junit.platform.launcher" version="1.1.0.v20180327-1502"/>
<unit id="org.junit.platform.runner" version="1.1.0.v20180327-1502"/>
<unit id="org.opentest4j" version="1.0.0.v20180327-1502"/>
<unit id="org.objectweb.asm" version="6.2.1.v20180823-1831"/>
<unit id="org.objectweb.asm.tree" version="6.2.1.v20180823-1831"/>
<repository location="http://download.eclipse.org/modeling/tmf/xtext/updates/orbit/2018-09"/>
</location>
</locations>
</target>
15 changes: 15 additions & 0 deletions org.contextmapper.dsl.parent/org.contextmapper.dsl.target/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.contextmapper.dsl</groupId>
<artifactId>org.contextmapper.dsl.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>org.contextmapper.dsl.target</artifactId>
<packaging>eclipse-target-definition</packaging>


<dependencies>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.contextmapper.dsl.tests
Bundle-ManifestVersion: 2
Bundle-Name: org.contextmapper.dsl.tests
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: org.contextmapper.dsl.tests; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.contextmapper.dsl,
org.junit.jupiter.api;bundle-version="[5.0.0,6.0.0)",
org.eclipse.xtext.testing,
org.eclipse.xtext.xbase.testing,
org.eclipse.xtext.xbase.lib;bundle-version="2.14.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.contextmapper.dsl.tests;x-internal=true

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
21 changes: 21 additions & 0 deletions org.contextmapper.dsl.parent/org.contextmapper.dsl.tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.contextmapper.dsl</groupId>
<artifactId>org.contextmapper.dsl.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>org.contextmapper.dsl.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* generated by Xtext 2.15.0
*/
package org.contextmapper.dsl.tests

import com.google.inject.Inject
import org.contextmapper.dsl.contextMappingDSL.Model
import org.eclipse.xtext.testing.InjectWith
import org.eclipse.xtext.testing.extensions.InjectionExtension
import org.eclipse.xtext.testing.util.ParseHelper
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.^extension.ExtendWith

@ExtendWith(InjectionExtension)
@InjectWith(ContextMappingDSLInjectorProvider)
class ContextMappingDSLParsingTest {
@Inject
ParseHelper<Model> parseHelper

@Test
def void loadModel() {
val result = parseHelper.parse('''
Hello Xtext!
''')
Assertions.assertNotNull(result)
val errors = result.eResource.errors
Assertions.assertTrue(errors.isEmpty, '''Unexpected errors: «errors.join(", ")»''')
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.contextmapper.dsl.ui.tests
Bundle-ManifestVersion: 2
Bundle-Name: org.contextmapper.dsl.ui.tests
Bundle-Vendor: My Company
Bundle-Version: 1.0.0.qualifier
Bundle-SymbolicName: org.contextmapper.dsl.ui.tests; singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.contextmapper.dsl.ui,
org.junit.jupiter.api;bundle-version="[5.0.0,6.0.0)",
org.eclipse.xtext.testing,
org.eclipse.xtext.xbase.testing,
org.eclipse.xtext.junit4,
org.eclipse.xtext.xbase.junit,
org.eclipse.core.runtime,
org.eclipse.ui.workbench;resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.contextmapper.dsl.ui.tests;x-internal=true

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source.. = src/,\
src-gen/,\
xtend-gen/
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
Loading

0 comments on commit 6042aae

Please sign in to comment.