diff options
author | 2021-09-29 02:45:57 +0200 | |
---|---|---|
committer | 2021-09-29 03:16:01 +0200 | |
commit | a155f6ba02e08a75ce6e474a86900b8363f506e8 (patch) | |
tree | b78804c1c0f0968a9625f0656e08f5dadc16924c /language/build.gradle | |
parent | Simplify branding (diff) | |
download | refinery-a155f6ba02e08a75ce6e474a86900b8363f506e8.tar.gz refinery-a155f6ba02e08a75ce6e474a86900b8363f506e8.tar.zst refinery-a155f6ba02e08a75ce6e474a86900b8363f506e8.zip |
build: migration to Gradle 7
Diffstat (limited to 'language/build.gradle')
-rw-r--r-- | language/build.gradle | 61 |
1 files changed, 40 insertions, 21 deletions
diff --git a/language/build.gradle b/language/build.gradle index e95f6b14..494d9d08 100644 --- a/language/build.gradle +++ b/language/build.gradle | |||
@@ -1,41 +1,60 @@ | |||
1 | apply plugin: 'java-library' | ||
1 | apply from: "${rootDir}/gradle/xtext-common.gradle" | 2 | apply from: "${rootDir}/gradle/xtext-common.gradle" |
2 | apply from: "${rootDir}/gradle/junit.gradle" | 3 | apply from: "${rootDir}/gradle/junit.gradle" |
3 | apply from: "${rootDir}/gradle/mwe2.gradle" | 4 | apply from: "${rootDir}/gradle/mwe2.gradle" |
4 | apply from: "${rootDir}/gradle/xtend.gradle" | 5 | apply from: "${rootDir}/gradle/xtend.gradle" |
5 | 6 | ||
6 | dependencies { | 7 | dependencies { |
7 | compile "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}" | 8 | api "org.eclipse.xtext:org.eclipse.xtext:${xtextVersion}" |
8 | compile "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}" | 9 | api "org.eclipse.xtext:org.eclipse.xtext.xbase:${xtextVersion}" |
9 | compile "org.eclipse.emf:org.eclipse.emf.ecore:${ecoreVersion}" | 10 | api "org.eclipse.emf:org.eclipse.emf.ecore:${ecoreVersion}" |
10 | compile project(':language-model') | 11 | api project(':refinery-language-model') |
11 | testCompile "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}" | 12 | testImplementation "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}" |
12 | testCompile "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}" | 13 | testImplementation "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}" |
13 | mwe2 "org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}" | 14 | mwe2 "org.eclipse.xtext:org.eclipse.xtext.common.types:${xtextVersion}" |
14 | mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}" | 15 | mwe2 "org.eclipse.xtext:org.eclipse.xtext.xtext.generator:${xtextVersion}" |
15 | mwe2 "org.eclipse.xtext:xtext-antlr-generator:${xtextAntlrGeneratorVersion}" | 16 | mwe2 "org.eclipse.xtext:xtext-antlr-generator:${xtextAntlrGeneratorVersion}" |
16 | mwe2 project(':language-mwe2') | 17 | mwe2 project(':refinery-language-mwe2') |
17 | } | 18 | } |
18 | 19 | ||
19 | jar { | 20 | tasks.named('jar') { |
20 | from(sourceSets.main.allSource) { | 21 | from(sourceSets.main.allSource) { |
21 | include '**/*.xtext' | 22 | include '**/*.xtext' |
22 | } | 23 | } |
23 | } | 24 | } |
24 | 25 | ||
25 | task generateXtextLanguage(type: JavaExec) { | 26 | def generateXtextLanguage = tasks.register('generateXtextLanguage', JavaExec) { |
26 | main = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher' | 27 | mainClass = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher' |
27 | classpath = configurations.mwe2 | 28 | classpath = configurations.mwe2 |
28 | inputs.file "src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2" | 29 | inputs.file 'src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2' |
29 | inputs.file "src/main/java/org/eclipse/viatra/solver/language/Problem.xtext" | 30 | inputs.file 'src/main/java/org/eclipse/viatra/solver/language/Problem.xtext' |
30 | outputs.dir "src/main/xtext-gen" | 31 | outputs.dir 'src/main/xtext-gen' |
31 | outputs.dir "src/test/xtext-gen" | 32 | outputs.dir 'src/test/xtext-gen' |
32 | outputs.dir "../language-ide/src/main/xtext-gen" | 33 | outputs.dir '../language-ide/src/main/xtext-gen' |
33 | outputs.dir "../language-web/src/main/xtext-gen" | 34 | outputs.dir '../language-web/src/main/xtext-gen' |
34 | outputs.dir "../language-web/build/generated/sources/xtext" | 35 | outputs.dir '../language-web/build/generated/sources/xtext' |
35 | args += "src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2" | 36 | args += 'src/main/java/org/eclipse/viatra/solver/language/GenerateProblem.mwe2' |
36 | args += "-p" | 37 | args += '-p' |
37 | args += "rootPath=/${projectDir}/.." | 38 | args += "rootPath=/${projectDir}/.." |
38 | } | 39 | } |
39 | 40 | ||
40 | generateXtext.dependsOn(generateXtextLanguage) | 41 | def generateXtext = tasks.named('generateXtext') |
41 | clean.dependsOn(cleanGenerateXtextLanguage) | 42 | generateXtext.configure { |
43 | dependsOn generateXtextLanguage | ||
44 | } | ||
45 | |||
46 | tasks.named('compileJava') { | ||
47 | dependsOn generateXtext | ||
48 | } | ||
49 | |||
50 | tasks.named('processResources') { | ||
51 | dependsOn generateXtext | ||
52 | } | ||
53 | |||
54 | tasks.named('clean') { | ||
55 | delete 'src/main/xtext-gen' | ||
56 | delete 'src/test/xtext-gen' | ||
57 | delete '../language-ide/src/main/xtext-gen' | ||
58 | delete '../language-web/src/main/xtext-gen' | ||
59 | delete '../language-web/build/generated/sources/xtext' | ||
60 | } | ||