diff options
author | 2022-02-04 20:18:20 +0100 | |
---|---|---|
committer | 2022-02-04 20:18:20 +0100 | |
commit | 42db1e8b4dcff3667c5f14e8dd464309c3c2f23e (patch) | |
tree | f5f5efe86fb352980cf144cceb68d1a1101b274f /subprojects/language/build.gradle | |
parent | chore(web): fix Sonar issue (diff) | |
parent | chore(frontend): bump frontend dependencies (diff) | |
download | refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.gz refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.tar.zst refinery-42db1e8b4dcff3667c5f14e8dd464309c3c2f23e.zip |
Merge pull request #18 from kris7t/releng-docs
Restructure project
Diffstat (limited to 'subprojects/language/build.gradle')
-rw-r--r-- | subprojects/language/build.gradle | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/subprojects/language/build.gradle b/subprojects/language/build.gradle new file mode 100644 index 00000000..f7574ecc --- /dev/null +++ b/subprojects/language/build.gradle | |||
@@ -0,0 +1,66 @@ | |||
1 | plugins { | ||
2 | id 'java-test-fixtures' | ||
3 | id 'refinery-java-library' | ||
4 | id 'refinery-mwe2' | ||
5 | id 'refinery-sonarqube' | ||
6 | id 'refinery-xtend' | ||
7 | id 'refinery-xtext-conventions' | ||
8 | } | ||
9 | |||
10 | dependencies { | ||
11 | api platform(libs.xtext.bom) | ||
12 | api libs.ecore | ||
13 | api libs.xtext.core | ||
14 | api libs.xtext.xbase | ||
15 | api project(':refinery-language-model') | ||
16 | testFixturesApi libs.xtext.testing | ||
17 | testFixturesApi testFixtures(project(':refinery-language-model')) | ||
18 | mwe2 libs.xtext.generator | ||
19 | mwe2 libs.xtext.generator.antlr | ||
20 | } | ||
21 | |||
22 | sourceSets { | ||
23 | testFixtures { | ||
24 | java.srcDirs += ['src/testFixtures/xtext-gen'] | ||
25 | resources.srcDirs += ['src/testFixtures/xtext-gen'] | ||
26 | } | ||
27 | } | ||
28 | |||
29 | tasks.named('jar') { | ||
30 | from(sourceSets.main.allSource) { | ||
31 | include '**/*.xtext' | ||
32 | } | ||
33 | } | ||
34 | |||
35 | def generateXtextLanguage = tasks.register('generateXtextLanguage', JavaExec) { | ||
36 | mainClass = 'org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher' | ||
37 | classpath = configurations.mwe2 | ||
38 | inputs.file 'src/main/java/tools/refinery/language/GenerateProblem.mwe2' | ||
39 | inputs.file 'src/main/java/tools/refinery/language/Problem.xtext' | ||
40 | outputs.dir 'src/main/xtext-gen' | ||
41 | outputs.dir 'src/testFixtures/xtext-gen' | ||
42 | outputs.dir '../language-ide/src/main/xtext-gen' | ||
43 | outputs.dir '../language-web/src/main/xtext-gen' | ||
44 | args += 'src/main/java/tools/refinery/language/GenerateProblem.mwe2' | ||
45 | args += '-p' | ||
46 | args += "rootPath=/${projectDir}/.." | ||
47 | } | ||
48 | |||
49 | for (taskName in ['compileJava', 'processResources', 'generateXtext', 'generateEclipseSourceFolders']) { | ||
50 | tasks.named(taskName) { | ||
51 | dependsOn generateXtextLanguage | ||
52 | } | ||
53 | } | ||
54 | |||
55 | tasks.named('clean') { | ||
56 | delete 'src/main/xtext-gen' | ||
57 | delete 'src/testFixtures/xtext-gen' | ||
58 | delete '../language-ide/src/main/xtext-gen' | ||
59 | delete '../language-web/src/main/xtext-gen' | ||
60 | } | ||
61 | |||
62 | sonarqube.properties { | ||
63 | properties['sonar.exclusions'] += [ | ||
64 | 'src/testFixtures/xtext-gen/**', | ||
65 | ] | ||
66 | } | ||