diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-11-17 03:06:39 +0100 |
---|---|---|
committer | Kristóf Marussy <kristof@marussy.com> | 2021-11-17 03:06:39 +0100 |
commit | 720b9e2fb0968905e5a80f6099eab37554a6af58 (patch) | |
tree | b471f4da129efbfa730830a70e0107de852833d7 /buildSrc/src/main/groovy/tools.refinery.xtend-conventions.gradle | |
parent | build: use version catalogs (diff) | |
download | refinery-720b9e2fb0968905e5a80f6099eab37554a6af58.tar.gz refinery-720b9e2fb0968905e5a80f6099eab37554a6af58.tar.zst refinery-720b9e2fb0968905e5a80f6099eab37554a6af58.zip |
build: move scripts into script plugins
Script plugins allow applying other plugins from plugins { } blocks,
which simplifies the build script.
Diffstat (limited to 'buildSrc/src/main/groovy/tools.refinery.xtend-conventions.gradle')
-rw-r--r-- | buildSrc/src/main/groovy/tools.refinery.xtend-conventions.gradle | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/buildSrc/src/main/groovy/tools.refinery.xtend-conventions.gradle b/buildSrc/src/main/groovy/tools.refinery.xtend-conventions.gradle new file mode 100644 index 00000000..98fc131c --- /dev/null +++ b/buildSrc/src/main/groovy/tools.refinery.xtend-conventions.gradle | |||
@@ -0,0 +1,37 @@ | |||
1 | plugins { | ||
2 | id 'org.sonarqube' | ||
3 | id 'org.xtext.xtend' | ||
4 | id 'tools.refinery.java-conventions' | ||
5 | } | ||
6 | |||
7 | sourceSets { | ||
8 | main { | ||
9 | xtendOutputDir = 'src/main/xtend-gen' | ||
10 | } | ||
11 | test { | ||
12 | xtendOutputDir = 'src/test/xtend-gen' | ||
13 | } | ||
14 | } | ||
15 | |||
16 | xtend.generator { | ||
17 | // As of Xtext 2.26.0.M2, the Xbase compiler doesn't know how to handle Java 12 and up | ||
18 | // and the build fails with a NullPointerException if such Java version is specified. | ||
19 | javaSourceLevel = '11' | ||
20 | } | ||
21 | |||
22 | tasks.named('clean') { | ||
23 | delete 'src/main/xtend-gen' | ||
24 | delete 'src/test/xtend-gen' | ||
25 | } | ||
26 | |||
27 | sonarqube.properties { | ||
28 | properties['sonar.exclusions'] += [ | ||
29 | 'src/main/xtend-gen/**', | ||
30 | 'src/test/xtend-gen/**', | ||
31 | ] | ||
32 | } | ||
33 | |||
34 | tasks.named('generateEclipseSourceFolders') { | ||
35 | dependsOn tasks.named('generateXtext') | ||
36 | dependsOn tasks.named('generateTestXtext') | ||
37 | } | ||