aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/language-web/build.gradle
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2023-04-08 22:56:44 +0200
committerLibravatar Kristóf Marussy <kristof@marussy.com>2023-04-08 22:58:21 +0200
commit561fac70fd3dc3ebe1cfbc50146757495fb828d5 (patch)
tree20aa72bbe438aaa70c8de264ff0d366758e7772d /subprojects/language-web/build.gradle
parentrefactor: remove TupleLike (diff)
downloadrefinery-561fac70fd3dc3ebe1cfbc50146757495fb828d5.tar.gz
refinery-561fac70fd3dc3ebe1cfbc50146757495fb828d5.tar.zst
refinery-561fac70fd3dc3ebe1cfbc50146757495fb828d5.zip
build: convert Gradle scripts to Kotlin
Improves IDE support build scripts in IntelliJ. There is no Eclipse IDE support, but Eclipse didn't have support for Groovy either, so there is no degradation of functionality.
Diffstat (limited to 'subprojects/language-web/build.gradle')
-rw-r--r--subprojects/language-web/build.gradle87
1 files changed, 0 insertions, 87 deletions
diff --git a/subprojects/language-web/build.gradle b/subprojects/language-web/build.gradle
deleted file mode 100644
index 8d277a5b..00000000
--- a/subprojects/language-web/build.gradle
+++ /dev/null
@@ -1,87 +0,0 @@
1plugins {
2 id 'refinery-java-application'
3 id 'refinery-xtext-conventions'
4}
5
6configurations {
7 webapp {
8 canBeConsumed = false
9 canBeResolved = true
10 }
11
12 all {
13 // Use log4j-over-slf4j instead of log4j 1.x
14 exclude group: 'log4j', module: 'log4j'
15 }
16}
17
18dependencies {
19 implementation project(':refinery-language')
20 implementation project(':refinery-language-ide')
21 implementation libs.jetty.server
22 implementation libs.jetty.servlet
23 implementation libs.jetty.websocket.server
24 implementation libs.slf4j.api
25 implementation libs.slf4j.simple
26 implementation libs.slf4j.log4j
27 implementation libs.xtext.web
28 webapp project(path: ':refinery-frontend', configuration: 'productionAssets')
29 testImplementation testFixtures(project(':refinery-language'))
30 testImplementation libs.jetty.websocket.client
31}
32
33def generateXtextLanguage = project(':refinery-language').tasks.named('generateXtextLanguage')
34
35for (taskName in ['compileJava', 'processResources']) {
36 tasks.named(taskName) {
37 dependsOn generateXtextLanguage
38 }
39}
40
41mainClassName = 'tools.refinery.language.web.ServerLauncher'
42
43// Enable JDK 19 preview features for virtual thread support.
44application {
45 applicationDefaultJvmArgs += '--enable-preview'
46}
47tasks.withType(JavaCompile) {
48 options.release = 19
49 options.compilerArgs += '--enable-preview'
50}
51tasks.withType(Test) {
52 jvmArgs += '--enable-preview'
53}
54
55tasks.named('jar') {
56 dependsOn project.configurations.webapp
57 from(project.configurations.webapp) {
58 into 'webapp'
59 }
60}
61
62tasks.named('shadowJar') {
63 dependsOn project.configurations.webapp
64 from(project.sourceSets.main.output)
65 configurations = [project.configurations.runtimeClasspath]
66 exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA','schema/*',
67 '.options', '.api_description', '*.profile', 'about.*', 'about_*.html', 'about_files/*',
68 'plugin.xml', 'systembundle.properties', 'profile.list', 'META-INF/resources/xtext/**')
69 append('plugin.properties')
70 from(project.configurations.webapp) {
71 into 'webapp'
72 }
73}
74
75tasks.register('serveBackend', JavaExec) {
76 dependsOn project.configurations.webapp
77 dependsOn sourceSets.main.runtimeClasspath
78 classpath = sourceSets.main.runtimeClasspath
79 mainClass = mainClassName
80 // Enable JDK 19 preview features for virtual thread support.
81 jvmArgs += '--enable-preview'
82 standardInput = System.in
83 def baseResource = project.configurations.webapp.incoming.artifacts.artifactFiles.first()
84 environment BASE_RESOURCE: baseResource
85 group = 'run'
86 description = 'Start a Jetty web server serving the Xtex API and assets.'
87}