Skip to content

Commit 45114d6

Browse files
committed
Add basic support for GraalVM native image
1 parent d47ce99 commit 45114d6

File tree

3 files changed

+371
-0
lines changed

3 files changed

+371
-0
lines changed

build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins {
99
`maven-publish`
1010
signing
1111
id("org.gradle.test-retry") version "1.6.4"
12+
id("org.graalvm.buildtools.native") version "0.11.3"
1213
id("com.github.ben-manes.versions") version "0.53.0"
1314
eclipse
1415
}
@@ -130,6 +131,27 @@ testing {
130131
}
131132
}
132133

134+
graalvmNative {
135+
// toolchainDetection = true // only works reliably if a single JDK is installed, which is GraalVM
136+
agent {
137+
// enabled = true
138+
defaultMode = "standard"
139+
}
140+
binaries {
141+
named("main") {
142+
// verbose = true
143+
buildArgs.addAll(
144+
listOf(
145+
"--initialize-at-build-time",
146+
"--no-fallback",
147+
"--exact-reachability-metadata",
148+
"-H:+ReportExceptionStackTraces",
149+
)
150+
)
151+
}
152+
}
153+
}
154+
133155
publishing {
134156
publications {
135157
create<MavenPublication>("mavenJava") {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Args = \
2+
--initialize-at-run-time=io.calimero.knxnetip.Discoverer \
3+
--initialize-at-run-time=io.calimero.knxnetip.KNXnetIPRouting \
4+
--initialize-at-run-time=io.calimero.knxnetip.Net \
5+
--initialize-at-run-time=io.calimero.knxnetip.Net$1NetIf \
6+
--initialize-at-run-time=io.calimero.knxnetip.StreamConnection \
7+
--initialize-at-run-time=io.calimero.knxnetip.servicetype.DescriptionRequest \
8+
--initialize-at-run-time=io.calimero.knxnetip.util.HPAI \
9+
--initialize-at-run-time=io.calimero.link.KNXNetworkLinkIP \
10+
--initialize-at-run-time=io.calimero.secure.SecureApplicationLayer
Lines changed: 339 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
{
2+
"reflection": [
3+
{
4+
"type": "io.calimero.KNXListener"
5+
},
6+
{
7+
"type": "io.calimero.baos.BaosService",
8+
"methods": [
9+
{
10+
"name": "from",
11+
"parameterTypes": [
12+
"java.nio.ByteBuffer"
13+
]
14+
}
15+
]
16+
},
17+
{
18+
"type": "io.calimero.knxnetip.RoutingListener"
19+
},
20+
{
21+
"type": "io.calimero.link.AbstractLink$LinkNotifier"
22+
},
23+
{
24+
"type": "io.calimero.link.Connector$Link"
25+
},
26+
{
27+
"type": "io.calimero.link.KNXNetworkLink"
28+
},
29+
{
30+
"type": "io.calimero.link.KNXNetworkLinkIP$2"
31+
},
32+
{
33+
"type": "io.calimero.link.KNXNetworkMonitor"
34+
},
35+
{
36+
"type": "io.calimero.link.NetworkLinkListener"
37+
},
38+
{
39+
"type": "io.calimero.link.medium.KNXMediumSettings",
40+
"fields": [
41+
{
42+
"name": "assigned"
43+
}
44+
]
45+
},
46+
{
47+
"type": "io.calimero.mgmt.TransportLayerImpl$NLListener"
48+
},
49+
{
50+
"type": "io.calimero.mgmt.TransportListener"
51+
},
52+
{
53+
"type": "io.calimero.mgmt.SecureManagement$1"
54+
},
55+
{
56+
"type": "io.calimero.mgmt.ManagementClientImpl$TLListener"
57+
},
58+
{
59+
"type": "io.calimero.mgmt.LocalDeviceManagement$KNXListenerImpl"
60+
},
61+
{
62+
"type": "io.calimero.mgmt.RemotePropertyServiceAdapter$1"
63+
},
64+
{
65+
"type": "io.calimero.process.ProcessListener"
66+
},
67+
{
68+
"type": "io.calimero.process.ProcessCommunicatorImpl$NLListener"
69+
},
70+
{
71+
"type": "io.calimero.secure.SecureApplicationLayer$1"
72+
},
73+
{
74+
"type": "io.calimero.dptxlator.DPTXlator1BitControlled",
75+
"methods": [
76+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
77+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
78+
{ "name": "getSubTypesStatic" }
79+
]
80+
},
81+
{
82+
"type": "io.calimero.dptxlator.DPTXlator2ByteFloat",
83+
"methods": [
84+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
85+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
86+
{ "name": "getSubTypesStatic" }
87+
]
88+
},
89+
{
90+
"type": "io.calimero.dptxlator.DptXlator2ByteSigned",
91+
"methods": [
92+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
93+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
94+
{ "name": "getSubTypesStatic" }
95+
]
96+
},
97+
{
98+
"type": "io.calimero.dptxlator.DPTXlator2ByteUnsigned",
99+
"methods": [
100+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
101+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
102+
{ "name": "getSubTypesStatic" }
103+
]
104+
},
105+
{
106+
"type": "io.calimero.dptxlator.DPTXlator3BitControlled",
107+
"methods": [
108+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
109+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
110+
{ "name": "getSubTypesStatic" }
111+
]
112+
},
113+
{
114+
"type": "io.calimero.dptxlator.DPTXlator4ByteFloat",
115+
"methods": [
116+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
117+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
118+
{ "name": "getSubTypesStatic" }
119+
]
120+
},
121+
{
122+
"type": "io.calimero.dptxlator.DPTXlator4ByteSigned",
123+
"methods": [
124+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
125+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
126+
{ "name": "getSubTypesStatic" }
127+
]
128+
},
129+
{
130+
"type": "io.calimero.dptxlator.DPTXlator4ByteUnsigned",
131+
"methods": [
132+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
133+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
134+
{ "name": "getSubTypesStatic" }
135+
]
136+
},
137+
{
138+
"type": "io.calimero.dptxlator.DPTXlator8BitEnum",
139+
"methods": [
140+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
141+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
142+
{ "name": "getSubTypesStatic" }
143+
]
144+
},
145+
{
146+
"type": "io.calimero.dptxlator.DptXlator8BitSet",
147+
"methods": [
148+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
149+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
150+
{ "name": "getSubTypesStatic" }
151+
]
152+
},
153+
{
154+
"type": "io.calimero.dptxlator.DPTXlator8BitSigned",
155+
"methods": [
156+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
157+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
158+
{ "name": "getSubTypesStatic" }
159+
]
160+
},
161+
{
162+
"type": "io.calimero.dptxlator.DPTXlator8BitUnsigned",
163+
"methods": [
164+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
165+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
166+
{ "name": "getSubTypesStatic" }
167+
]
168+
},
169+
{
170+
"type": "io.calimero.dptxlator.DptXlator16BitSet",
171+
"methods": [
172+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
173+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
174+
{ "name": "getSubTypesStatic" }
175+
]
176+
},
177+
{
178+
"type": "io.calimero.dptxlator.DPTXlator64BitSigned",
179+
"methods": [
180+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
181+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
182+
{ "name": "getSubTypesStatic" }
183+
]
184+
},
185+
{
186+
"type": "io.calimero.dptxlator.DPTXlatorBoolean",
187+
"methods": [
188+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
189+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
190+
{ "name": "getSubTypesStatic" }
191+
]
192+
},
193+
{
194+
"type": "io.calimero.dptxlator.DptXlatorBrightnessClrTempControl",
195+
"methods": [
196+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
197+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
198+
{ "name": "getSubTypesStatic" }
199+
]
200+
},
201+
{
202+
"type": "io.calimero.dptxlator.DptXlatorBrightnessClrTempTrans",
203+
"methods": [
204+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
205+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
206+
{ "name": "getSubTypesStatic" }
207+
]
208+
},
209+
{
210+
"type": "io.calimero.dptxlator.DPTXlatorDate",
211+
"methods": [
212+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
213+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
214+
{ "name": "getSubTypesStatic" }
215+
]
216+
},
217+
{
218+
"type": "io.calimero.dptxlator.DPTXlatorDateTime",
219+
"methods": [
220+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
221+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
222+
{ "name": "getSubTypesStatic" }
223+
]
224+
},
225+
{
226+
"type": "io.calimero.dptxlator.DptXlatorMeteringValue",
227+
"methods": [
228+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
229+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
230+
{ "name": "getSubTypesStatic" }
231+
]
232+
},
233+
{
234+
"type": "io.calimero.dptxlator.DptXlatorRelativeControlRgb",
235+
"methods": [
236+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
237+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
238+
{ "name": "getSubTypesStatic" }
239+
]
240+
},
241+
{
242+
"type": "io.calimero.dptxlator.DptXlatorRelativeControlRgbw",
243+
"methods": [
244+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
245+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
246+
{ "name": "getSubTypesStatic" }
247+
]
248+
},
249+
{
250+
"type": "io.calimero.dptxlator.DptXlatorRelativeControlXyY",
251+
"methods": [
252+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
253+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
254+
{ "name": "getSubTypesStatic" }
255+
]
256+
},
257+
{
258+
"type": "io.calimero.dptxlator.DPTXlatorRGB",
259+
"methods": [
260+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
261+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
262+
{ "name": "getSubTypesStatic" }
263+
]
264+
},
265+
{
266+
"type": "io.calimero.dptxlator.DptXlatorRgbw",
267+
"methods": [
268+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
269+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
270+
{ "name": "getSubTypesStatic" }
271+
]
272+
},
273+
{
274+
"type": "io.calimero.dptxlator.DPTXlatorSceneControl",
275+
"methods": [
276+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
277+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
278+
{ "name": "getSubTypesStatic" }
279+
]
280+
},
281+
{
282+
"type": "io.calimero.dptxlator.DPTXlatorSceneNumber",
283+
"methods": [
284+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
285+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
286+
{ "name": "getSubTypesStatic" }
287+
]
288+
},
289+
{
290+
"type": "io.calimero.dptxlator.DPTXlatorString",
291+
"methods": [
292+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
293+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
294+
{ "name": "getSubTypesStatic" }
295+
]
296+
},
297+
{
298+
"type": "io.calimero.dptxlator.DPTXlatorTime",
299+
"methods": [
300+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
301+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
302+
{ "name": "getSubTypesStatic" }
303+
]
304+
},
305+
{
306+
"type": "io.calimero.dptxlator.DPTXlatorUtf8",
307+
"methods": [
308+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
309+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
310+
{ "name": "getSubTypesStatic" }
311+
]
312+
},
313+
{
314+
"type": "io.calimero.dptxlator.DptXlatorXyY",
315+
"methods": [
316+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
317+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
318+
{ "name": "getSubTypesStatic" }
319+
]
320+
},
321+
{
322+
"type": "io.calimero.dptxlator.DptXlatorXyYTransition",
323+
"methods": [
324+
{ "name": "<init>", "parameterTypes": [ "java.lang.String" ] },
325+
{ "name": "<init>", "parameterTypes": [ "io.calimero.dptxlator.DPT" ] },
326+
{ "name": "getSubTypesStatic" }
327+
]
328+
}
329+
],
330+
"resources": [
331+
{
332+
"module:": "io.calimero.core",
333+
"glob": "properties.xml"
334+
},
335+
{
336+
"glob": "META-INF/services/java.net.spi.InetAddressResolverProvider"
337+
}
338+
]
339+
}

0 commit comments

Comments
 (0)