Skip to content

Commit

Permalink
Merge pull request #266 from graalvm/og/class-init-demos
Browse files Browse the repository at this point in the history
Update versions and dependencies in Native Image Configure Examples
  • Loading branch information
olyagpl authored Jun 12, 2024
2 parents d73ac54 + bed644a commit 4ec2b9c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/native-image-configure-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
java-version: ['21', 'dev']
java-version: ['21', 'latest-ea']
steps:
- uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
Expand All @@ -33,9 +33,9 @@ jobs:
run: |
cd native-image-configure-examples/configure-at-runtime-example
mvn --no-transfer-progress package
./target/example
./target/runtime-example
- name: Run 'configure-at-buildtime-example'
run: |
cd native-image-configure-examples/configure-at-buildtime-example
mvn --no-transfer-progress package
./target/example
./target/buildtime-example
8 changes: 4 additions & 4 deletions native-image-configure-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In both examples we use the Jackson framework to parse a JSON file to determine
cd graalvm-demos/native-image-configure-examples
```

## Build and run examples
## Build and Run Examples

1. Change to one of the demo subdirectories, for example, `configure-at-runtime-example`:
```bash
Expand All @@ -41,9 +41,9 @@ In both examples we use the Jackson framework to parse a JSON file to determine
```bash
mvn package
```
3. Once the Maven build succeeds, a native executable called "example" will be generated in the `configure-at-runtime-example/target/` directory. Run it:
3. Once the Maven build succeeds, a native executable called "runtime-example" will be generated in the `configure-at-runtime-example/target/` directory. Run it:
```bash
./target/example
./target/runtime-example
```
You will see the current date and time message.
4. Repeat the same steps for the other sub-demo:
Expand All @@ -54,7 +54,7 @@ In both examples we use the Jackson framework to parse a JSON file to determine
mvn package
```
```bash
./target/example
./target/buildtime-example
```
You will see the next output:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.graalvm.nativeimage</groupId>
<artifactId>configure-at-buildtime-example</artifactId>
<artifactId>buildtime-time-init</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<native.maven.plugin.version>0.9.28</native.maven.plugin.version>
<native.maven.plugin.version>0.10.2</native.maven.plugin.version>
<jackson.version>2.16.0</jackson.version>
</properties>

<dependencies>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>23.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down Expand Up @@ -88,7 +82,7 @@
</executions>
<configuration>
<skip>false</skip>
<imageName>example</imageName>
<imageName>buildtime-example</imageName>
<buildArgs>
--no-fallback
</buildArgs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,16 @@
<modelVersion>4.0.0</modelVersion>

<groupId>org.graalvm.nativeimage</groupId>
<artifactId>configure-at-runtime-example</artifactId>
<artifactId>runtime-init</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<native.maven.plugin.version>0.9.28</native.maven.plugin.version>
<native.maven.plugin.version>0.10.2</native.maven.plugin.version>
<jackson.version>2.16.0</jackson.version>
</properties>

<dependencies>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<version>23.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down Expand Up @@ -88,8 +82,7 @@
</execution>
</executions>
<configuration>
<skip>false</skip>
<imageName>example</imageName>
<imageName>runtime-example</imageName>
<buildArgs>
--no-fallback
</buildArgs>
Expand Down

0 comments on commit 4ec2b9c

Please sign in to comment.