dependencies {
	testCompile "org.eclipse.xtext:org.eclipse.xtext.junit4:${xtextVersion}"
	testCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.junit:${xtextVersion}"
	compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}"
	compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}"
	compile "org.eclipse.xtext:org.eclipse.xtext.xtext:${xtextVersion}"
	compile "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}"
}
configurations {
	mwe2 {
		extendsFrom compile
	}
}

dependencies {
	mwe2 "org.eclipse.emf:org.eclipse.emf.mwe2.launch:[2.8.2,3.0)"
	mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}"
}

task generateXtextLanguage(type: JavaExec) {
	main = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher'
	classpath = configurations.mwe2
	inputs.file "src/main/java/org/xtext/example/mydsl/GenerateEinDsl.mwe2"
	inputs.file "src/main/java/org/xtext/example/mydsl/EinDsl.xtext"
	outputs.dir "src/main/xtext-gen"
	args += "src/main/java/org/xtext/example/mydsl/GenerateEinDsl.mwe2"
	args += "-p"
	args += "rootPath=/${projectDir}/.."
}

compileXtend.dependsOn(generateXtextLanguage)
clean.dependsOn(cleanGenerateXtextLanguage)
eclipse.classpath.plusConfigurations += [configurations.mwe2]
