-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor fortune-demo and move under native-image/antive-build-tools …
…subdirectory
- Loading branch information
Showing
27 changed files
with
752 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: native-build-tools-maven | ||
on: | ||
push: | ||
paths: | ||
- 'native-image/native-build-tools/maven-plugin/**' | ||
- '.github/workflows/native-build-tools-maven.yml' | ||
pull_request: | ||
paths: | ||
- 'native-image/native-build-tools/maven-plugin/**' | ||
- '.github/workflows/native-build-tools-maven.yml' | ||
schedule: | ||
- cron: "0 0 1 * *" # run every month | ||
workflow_dispatch: | ||
permissions: | ||
contents: read | ||
jobs: | ||
run: | ||
name: Run 'native-build-tools-maven' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: graalvm/setup-graalvm@v1 | ||
with: | ||
java-version: '24-ea' | ||
distribution: 'graalvm' | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run 'native-build-tools-maven' | ||
run: | | ||
cd native-image/native-build-tools/maven-plugin | ||
./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use Gradle to Build a Java Application from a Java Application | ||
|
||
The demo application simulates the traditional [fortune](https://en.wikipedia.org/wiki/Fortune_(Unix)) Unix program. | ||
The data for the fortune phrases is provided by [YourFortune](https://github.com/your-fortune). | ||
|
||
The project uses the [Gradle plugin for GraalVM Native Image building](https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html). | ||
|
||
## Run the Demo | ||
|
||
1. Run the application on JVM: | ||
```bash | ||
./gradlew run | ||
``` | ||
2. Build a native executable: | ||
```bash | ||
./gradlew nativeRun | ||
``` | ||
The `nativeRun` task compiles the application, invokes `nativeCompile`, and then runs the executable. | ||
3. Re-run the application from the native executable: | ||
```bash | ||
./build/native/nativeCompile/fortune | ||
``` | ||
Alternatively, you can execute `./run.sh` to build and run the application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
# Run the application on the JVM | ||
./gradlew clean run | ||
# Build and run a native executable (`nativeRun` compiles the application, invokes `nativeCompile`, and then runs the executable) | ||
./gradlew nativeRun |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
native-image/native-build-tools/maven-plugin/.mvn/wrapper/maven-wrapper.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Use Maven to Build a Java Application from a Java Application | ||
|
||
The demo application simulates the traditional [fortune](https://en.wikipedia.org/wiki/Fortune_(Unix)) Unix program. | ||
The data for the fortune phrases is provided by [YourFortune](https://github.com/your-fortune). | ||
|
||
The project uses the [Maven plugin for GraalVM Native Image building](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html). | ||
|
||
You can find the steps to run this demo in the [Optimize a Native Executable for File Size guide](https://www.graalvm.org/latest/reference-manual/native-image/guides/optimize-for-file-size/). |
Oops, something went wrong.