Skip to content

Instantly share code, notes, and snippets.

View oehme's full-sized avatar

Stefan Oehme oehme

View GitHub Profile
@oehme
oehme / logfieldauto.xtend
Created November 25, 2014 14:45
Automatic log field
@Log class Commander {
def whatIsThis() {
log.warning("It's a trap!")
}
}
@oehme
oehme / logfieldman.xtend
Last active August 29, 2015 14:10
Manual log field
class Commander {
static val log = Logger.getLogger(Commander.name)
def whatIsThis() {
log.warning("It's a trap!")
}
}
@oehme
oehme / logprocessor.xtend
Last active August 29, 2015 14:10
LogProcessor
@Target(TYPE)
@Active(LogProcessor)
annotation Log {
}
class LogProcessor extends AbstractClassProcessor {
override doTransform(MutableClassDeclaration cls, extension TransformationContext context) {
cls.addField("log") [
static = true
final = true
@oehme
oehme / workflow
Last active August 29, 2015 14:05
Workflow change
//var grammarURI = "classpath:/org/xtext/builddsl/BuildDSL.xtext"
var grammarURI = "platform:/resource/${projectName}/src/org/xtext/builddsl/BuildDSL.xtext"
@oehme
oehme / pom.xml
Created August 13, 2014 13:51
Generating with maven-exec
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>mwe2Launcher</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
@oehme
oehme / build.gradle
Last active August 29, 2015 14:05
Gradle client
plugins {
id 'org.xtext.xtext' version '0.1.0'
}
dependencies {
xtextTooling 'org.xtext.builddsl:org.xtext.builddsl:1.0.0-SNAPSHOT'
}
xtext {
version = '2.6.+'
@oehme
oehme / pom.xml
Created August 13, 2014 13:46
Maven client
<plugin>
<groupId>org.eclipse.xtext</groupId>
<artifactId>xtext-maven-plugin</artifactId>
<version>2.6.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
@oehme
oehme / pom.xml
Created August 13, 2014 13:42
The core language plugin
<artifactId>org.xtext.builddsl</artifactId>
<packaging>eclipse-plugin</packaging>
<parent>
<groupId>org.xtext.builddsl</groupId>
<artifactId>org.xtext.builddsl.parent</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../org.xtext.builddsl.parent/pom.xml</relativePath>
</parent>
@oehme
oehme / pom.xml
Last active August 29, 2015 14:05
Target platform definition
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<target>
<artifact>
<groupId>org.xtext.builddsl</groupId>
<artifactId>org.xtext.builddsl.target</artifactId>
<version>1.0.0-SNAPSHOT</version>
@oehme
oehme / pom.xml
Created August 13, 2014 13:37
Tycho extension
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>