ext.title = 'Xtend Core Library'
description = 'Core language services for Xtend.'
apply from: "${rootDir}/gradle/mwe2-workflows.gradle"

dependencies {
	api "org.eclipse.xtext:org.eclipse.xtext.xbase:$versions.xtext"
	api "org.eclipse.platform:org.eclipse.equinox.common"
	api "org.eclipse.platform:org.eclipse.core.runtime"
	api "org.eclipse.jdt:org.eclipse.jdt.core"
	api "org.eclipse.jdt:org.eclipse.jdt.compiler.apt"
	api "org.eclipse.jdt:org.eclipse.jdt.compiler.tool"
	optional "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:$versions.xtext"
	optional "org.apache.ant:ant:$versions.ant"
	mwe2Implementation "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:$versions.xtext"
	mwe2Implementation "org.eclipse.xtext:org.eclipse.xtext.xbase:$versions.xtext"
	mwe2Implementation "de.jflex:jflex:$versions.jflex"
	mwe2Implementation "org.eclipse.emf:org.eclipse.emf.mwe2.launch"
}

sourceSets {
	mwe2.java.srcDir 'generator'
	mwe2.java.srcDir 'generator-xtend-gen'
	mwe2.resources.srcDir 'generator'
}


// Include the mwe2 and xtext files from the main source set when executing the workflow
sourceSets.mwe2.runtimeClasspath += processResources.outputs.files
sourceSets.main.java.srcDir 'deprecated'

task generateXtend(type: XtextGeneratorTask) {
	workflow = file('src/org/eclipse/xtend/core/GenerateXtend.mwe2')
	outputs.dir 'src-gen'
	jvmArgs '-Xmx2G'
	jvmArgs '-Dfile.encoding=ISO-8859-1'
}
