2017-01-12 08:51:31 +00:00
|
|
|
/*
|
|
|
|
* Bootstrap project for the Xtext language. It contains an MWE2 generator workflow with
|
2019-04-02 06:48:56 +00:00
|
|
|
* dedicated configuration code. The workflow generates into the core and generic ide projects,
|
|
|
|
* which are defined in different source repositories. The path to these other repositories is
|
|
|
|
* assumed to be ../xtext-eclipse, respectively.
|
2017-01-12 08:51:31 +00:00
|
|
|
*/
|
|
|
|
|
2017-01-11 12:34:05 +00:00
|
|
|
apply from: "${rootDir}/gradle/mwe2-workflows.gradle"
|
|
|
|
|
2016-12-13 15:18:42 +00:00
|
|
|
dependencies {
|
2016-11-22 15:35:07 +00:00
|
|
|
// We cannot use the projects within the workspace, as we would have
|
|
|
|
// to compile them before generating the code, so we need to stick to the bootstrapping version.
|
2017-01-11 12:34:05 +00:00
|
|
|
// Buildship, however, links the workspace projects anyway if a composite build is used.
|
2021-08-10 10:02:12 +00:00
|
|
|
api "org.eclipse.xtext:org.eclipse.xtext:$versions.xtext_bootstrap"
|
|
|
|
api "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:$versions.xtext_bootstrap"
|
2016-12-13 15:18:42 +00:00
|
|
|
}
|
|
|
|
|
2017-01-11 12:34:05 +00:00
|
|
|
sourceSets.main.java.srcDirs = []
|
2017-01-12 08:51:31 +00:00
|
|
|
sourceSets.main.resources.srcDirs = []
|
|
|
|
sourceSets.test.java.srcDirs = []
|
|
|
|
sourceSets.test.resources.srcDirs = []
|
2017-01-11 12:34:05 +00:00
|
|
|
|
|
|
|
sourceSets.mwe2 {
|
|
|
|
java.srcDir 'src'
|
|
|
|
if (findProperty('compileXtend') == 'true') {
|
|
|
|
xtendOutputDir = 'xtend-gen'
|
|
|
|
} else {
|
|
|
|
java.srcDir 'xtend-gen'
|
|
|
|
}
|
2016-12-13 15:18:42 +00:00
|
|
|
}
|
2021-08-10 10:02:12 +00:00
|
|
|
configurations.mwe2Implementation.extendsFrom configurations.api
|
2017-01-11 12:34:05 +00:00
|
|
|
jar.from sourceSets.mwe2.output
|
2021-08-10 10:02:12 +00:00
|
|
|
sourcesJar {
|
|
|
|
if (findProperty('compileXtend') == 'true') {
|
|
|
|
dependsOn generateMwe2Xtext
|
|
|
|
}
|
|
|
|
from sourceSets.mwe2.allSource
|
|
|
|
}
|
2017-01-11 12:34:05 +00:00
|
|
|
task generateXtextLanguage(type: XtextGeneratorTask) {
|
|
|
|
workflow = file('src/org/eclipse/xtext/xtext/bootstrap/GenerateXtext.mwe2')
|
|
|
|
}
|
2017-01-12 08:51:31 +00:00
|
|
|
|
|
|
|
eclipse {
|
|
|
|
project {
|
|
|
|
natures 'org.eclipse.xtext.ui.shared.xtextNature'
|
|
|
|
buildCommands.add(0,new org.gradle.plugins.ide.eclipse.model.BuildCommand('org.eclipse.xtext.ui.shared.xtextBuilder'))
|
|
|
|
}
|
|
|
|
}
|