Skip to content

Commit 1013c26

Browse files
author
Dennis Labordus
authored
Merge pull request #115 from com-pas/make_native_compilation_work
Fix native compilation
2 parents cc965b4 + a68c3b0 commit 1013c26

File tree

9 files changed

+71
-20
lines changed

9 files changed

+71
-20
lines changed

.github/workflows/release-project.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ jobs:
2424
shell: bash
2525
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
2626
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
27-
- name: Set up JDK 11
28-
uses: actions/setup-[email protected]
27+
- name: Install graalvm
28+
uses: DeLaGuardo/setup-[email protected]
2929
with:
30-
distribution: 'zulu'
31-
java-version: '11'
30+
graalvm: '21.2.0'
31+
java: 'java11'
32+
- name: Install native-image
33+
run: gu install native-image
3234
- name: Create custom Maven Settings.xml
3335
uses: whelk-io/maven-settings-xml-action@v20
3436
with:
@@ -39,6 +41,6 @@ jobs:
3941
env:
4042
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4143
- name: Deploy with Maven to GitHub Packages and Docker Hub
42-
run: ./mvnw -B -s custom_maven_settings.xml -Prelease clean deploy
44+
run: ./mvnw -B -s custom_maven_settings.xml -Prelease,native clean deploy
4345
env:
4446
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

app/pom.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ SPDX-License-Identifier: Apache-2.0
1919

2020
<properties>
2121
<quarkus.platform.version>2.2.3.Final</quarkus.platform.version>
22+
23+
<quarkus.container-image.group>lfenergycompas</quarkus.container-image.group>
24+
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
2225
</properties>
2326

2427
<dependencyManagement>
@@ -156,7 +159,9 @@ SPDX-License-Identifier: Apache-2.0
156159

157160
<properties>
158161
<quarkus.package.type>native</quarkus.package.type>
159-
<quarkus.native.container-build>true</quarkus.native.container-build> <!-- Allows for creating a Linux executable without GraalVM being installed -->
162+
<!-- Allows for creating a Linux executable without GraalVM being installed -->
163+
<quarkus.native.container-build>true</quarkus.native.container-build>
164+
<quarkus.native.additional-build-args>-H:ReflectionConfigurationFiles=reflection-config.json</quarkus.native.additional-build-args>
160165
</properties>
161166

162167
<build>
@@ -202,8 +207,6 @@ SPDX-License-Identifier: Apache-2.0
202207
<properties>
203208
<!-- Properties only used for publishing a native docker image (default to Docker Hub) -->
204209
<quarkus.container-image.build>true</quarkus.container-image.build>
205-
<quarkus.container-image.group>lfenergycompas</quarkus.container-image.group>
206-
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
207210
<quarkus.container-image.push>true</quarkus.container-image.push>
208211
<quarkus.container-image.additional-tags>latest</quarkus.container-image.additional-tags>
209212
</properties>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"name" : "org.lfenergy.compas.scl.data.model.ObjectFactory",
4+
"allDeclaredMethods" : true,
5+
"allPublicMethods" : true
6+
}
7+
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
3+
SPDX-License-Identifier: Apache-2.0

app/src/native-test/java/org/lfenergy/compas/scl/data/NativeHealthCheckIT.java

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package org.lfenergy.compas.scl.data.rest;
6+
7+
import io.quarkus.test.junit.NativeImageTest;
8+
9+
@NativeImageTest
10+
class NativeHealthCheckIT extends HealthCheckTest {
11+
// Execute the same tests but in native mode.
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package org.lfenergy.compas.scl.data.rest.v1;
6+
7+
import io.quarkus.test.junit.NativeImageTest;
8+
9+
@NativeImageTest
10+
class NativeCompasCommonResourceIT extends CompasCommonResourceTest {
11+
// Execute the same tests but in native mode.
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package org.lfenergy.compas.scl.data.rest.v1;
6+
7+
import io.quarkus.test.junit.NativeImageTest;
8+
9+
@NativeImageTest
10+
class NativeCompasSclDataResourceAsEditorIT extends CompasSclDataResourceAsEditorTest {
11+
// Execute the same tests but in native mode.
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// SPDX-FileCopyrightText: 2021 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package org.lfenergy.compas.scl.data.rest.v1;
6+
7+
import io.quarkus.test.junit.NativeImageTest;
8+
9+
@NativeImageTest
10+
class NativeCompasSclDataResourceAsReaderT extends CompasSclDataResourceAsReaderTest {
11+
// Execute the same tests but in native mode.
12+
}

0 commit comments

Comments
 (0)