-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
134 lines (112 loc) · 5.05 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.3/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
id "com.github.johnrengelman.shadow" version "7.1.2"
//id "com.palantir.graal" version "0.7.1"
id "org.beryx.runtime" version "1.13.0"
id "antlr"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
mavenCentral()
}
dependencies {
antlr group: 'org.antlr', name: 'antlr4', version: '4.11.1'
// This dependency is used by the application.
implementation 'com.google.guava:guava:31.1-jre'
implementation('com.nedap.healthcare.archie:archie-all:3.0.0')
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j:0.19.0'
implementation 'org.slf4j:slf4j-nop:1.7.36'
implementation 'com.nedap.healthcare:aqlparser:*'
// Use JUnit Jupiter API, Engine and params for testing.
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2'
testImplementation 'commons-io:commons-io:2.11.0'
}
generateGrammarSource {
arguments += ["-visitor", "-package", "com.nedap.healthcare.tolerantaqlparser"]
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
application {
// Define the main class for the application.
mainClassName = 'com.nedap.openehr.lsp.App'
}
test {
// Use junit platform for unit tests
useJUnitPlatform()
}
task buildExtension() {
dependsOn build
doLast {
mkdir "$projectDir/build/image/app"
//now copy it all to the vscode extension dir
delete "$projectDir/vscode-extension/lsp-images"
copy {
from "$projectDir/build/image"
into "$projectDir/vscode-extension/lsp-images"
}
//copy the jar file to a common directory so it does not get included multiple times
copy {
from "$projectDir/vscode-extension/lsp-images/archie-lsp-macos-x64/lib/archie-lsp-all.jar"
into "$projectDir/vscode-extension/lsp-images/app"
}
//then remove all the other jar files to save space. The custom start script template will fix the classpath
delete "$projectDir/vscode-extension/lsp-images/archie-lsp-macos-x64/lib/archie-lsp-all.jar"
delete "$projectDir/vscode-extension/lsp-images/archie-lsp-macos-arm64/lib/archie-lsp-all.jar"
delete "$projectDir/vscode-extension/lsp-images/archie-lsp-linux-x64/lib/archie-lsp-all.jar"
delete "$projectDir/vscode-extension/lsp-images/archie-lsp-winx64/lib/archie-lsp-all.jar"
exec {
workingDir "$projectDir/vscode-extension"
commandLine "npm", "install"
}
exec {
workingDir "$projectDir/vscode-extension"
commandLine "npm", "run", "compile"
}
exec {
workingDir "$projectDir/vscode-extension"
commandLine "npm", "run-script", "package"
}
}
}
runtime {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
modules = ['java.xml', 'java.sql', 'java.desktop']
//SQL required because of GSON dependency. Maybe get rid of that anyway...
//java.desktop required because of glassfish JAXB
targetPlatform('linux-x64', jvm_linux_home)
targetPlatform('winx64', jvm_windows_home)
targetPlatform('macos-x64', jvm_macos_x86_home)
targetPlatform('macos-arm64', jvm_macos_arm_home)
launcher {
//To set the classpath to the single included jar file, instead of one per distribution, the start scripts
//are customized. Taken from https://github.com/beryx/badass-runtime-plugin/blob/master/src/main/resources/
//and only the CLASSPATH is changed to point at APP_HOME/../app/* to pick up the archie-lsp-all.jar
unixScriptTemplate = file("$projectDir/unixScriptTemplate.txt")
windowsScriptTemplate = file("$projectDir/windowsScriptTemplate.txt")
jvmArgs = ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'
, '--add-opens', 'java.base/java.lang.invoke=ALL-UNNAMED'
, '--add-opens', 'java.base/java.net=ALL-UNNAMED'
, '--add-opens', 'java.base/java.nio=ALL-UNNAMED'
, '--add-opens', 'java.base/java.time=ALL-UNNAMED'
, '--add-opens', 'java.base/java.util=ALL-UNNAMED'
, '--add-opens', 'java.base/java.util.concurrent.atomic=ALL-UNNAMED'
, '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED'
, '--add-opens', 'java.base/sun.util.calendar=ALL-UNNAMED']
}
}