dependencies {
	compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}"
	compile 'org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:1.3.0'
	
	xtextLanguages 'org.eclipse.emf:org.eclipse.emf.ecore.xcore:1.3.1'
	xtextLanguages 'org.eclipse.emf:org.eclipse.emf.ecore.xcore.lib:1.3.0'
	xtextLanguages "org.eclipse.emf:org.eclipse.emf.codegen:2.11.0"
	xtextLanguages 'org.eclipse.emf:org.eclipse.emf.codegen.ecore:2.12.0'
	xtextLanguages 'org.eclipse.emf:org.eclipse.emf.codegen.ecore.xtext:1.2.0'
	xtextLanguages "org.eclipse.xtext:org.eclipse.xtext.ecore:${xtextVersion}"
	xtextLanguages "org.eclipse.emf:org.eclipse.emf.mwe2.lib:2.9.1.201705291010"
}

sourceSets {
	main {
		resources {
			exclude '**/*.xcore'
		}
	}
}

xtext {
	version = "${xtextVersion}"
	languages {
		ecore {
			setup = 'org.eclipse.xtext.ecore.EcoreSupport'
		}
		codegen {
			setup = 'org.eclipse.emf.codegen.ecore.xtext.GenModelSupport'
		}
		xcore {
			setup = 'org.eclipse.emf.ecore.xcore.XcoreStandaloneSetup'
			generator.outlet.producesJava = true
		}
	}
}

// workaround for Java 8 xtext plugin issue, see https://github.com/eclipse/xtext/issues/1976
configurations.all {
    resolutionStrategy {
        eachDependency { DependencyResolveDetails details ->
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.runtime') {
                details.useVersion "3.19.0"
            }
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.common') {
                details.useVersion "3.13.0"
            }
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.resources') {
                details.useVersion "3.12.0"
            }
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.text') {
                details.useVersion "3.10.0"
            }
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.jobs') {
                details.useVersion "3.11.0"
            }
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.core.contenttype') {
                details.useVersion "3.7.0"
            }
            if (details.requested.group == 'org.eclipse.platform' && details.requested.name == 'org.eclipse.equinox.preferences') {
                details.useVersion "3.9.0"
            }
        }
    }
}
