-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note that the "--no-fallback" native-image option cannot be used for the moment (the compilation to native code fails), so the application runs in the normal JVM. See https://www.graalvm.org/docs/reference-manual/aot-compilation/
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
*.iml | ||
/lib | ||
.idea | ||
hubstats.core |
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,37 @@ | ||
#!/bin/bash | ||
|
||
# Fail on error | ||
set -e | ||
|
||
echo "Build nicokosi/hubstats JAR file:" | ||
lein uberjar | ||
|
||
echo "Install GraalVM via SDKMAN!:" | ||
curl --silent "https://get.sdkman.io" | bash || echo 'SDKMAN! already installed' | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
GRAALVM_VERSION=19.0.2-grl | ||
sdkman_auto_answer=true sdk install java $GRAALVM_VERSION > /dev/null | ||
sdk use java $GRAALVM_VERSION | ||
|
||
echo "Build executable from JAR via GraalVM:" | ||
gu install native-image && \ | ||
native-image \ | ||
--allow-incomplete-classpath \ | ||
--force-fallback \ | ||
--initialize-at-build-time \ | ||
--no-server \ | ||
--report-unsupported-elements-at-runtime \ | ||
-Dclojure.compiler.direct-linking=true \ | ||
-H:+ReportExceptionStackTraces \ | ||
-jar ./target/hubstats-0.1.0-SNAPSHOT-standalone.jar \ | ||
hubstats.core | ||
|
||
echo "Executable has been built! ✅ | ||
It can be run this way: | ||
# Show last 10 days stats for GitHub repository docker/containerd: | ||
$ ./hubstats.core --organization docker --repository containerd --since-days 10 | ||
# Show all parameters: | ||
$ ./hubstats.core" |