diff --git a/.gitignore b/.gitignore index 4c7b41d..03ee98e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ target/ .lein-repl-history .lein-failures pom.* +reports/* # cljs .shadow-cljs @@ -28,3 +29,4 @@ auth.edn config.edn .eastwood + diff --git a/c4k-forgejo-standalone b/c4k-forgejo-standalone new file mode 100755 index 0000000..2165568 Binary files /dev/null and b/c4k-forgejo-standalone differ diff --git a/doc/Development.md b/doc/Development.md index 461f3d6..08c8546 100644 --- a/doc/Development.md +++ b/doc/Development.md @@ -39,26 +39,23 @@ npx shadow-cljs release frontend ## graalvm-setup ``` -curl -LO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.0.0.2/graalvm-ce-java11-linux-amd64-21.0.0.2.tar.gz +curl -LO https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz # unpack -tar -xzf graalvm-ce-java11-linux-amd64-21.0.0.2.tar.gz +tar -xzf graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz -sudo mv graalvm-ce-java11-21.0.0.2 /usr/lib/jvm/ -sudo ln -s /usr/lib/jvm/graalvm-ce-java11-21.0.0.2 /usr/lib/jvm/graalvm -sudo ln -s /usr/lib/jvm/graalvm/bin/gu /usr/local/bin -sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm/bin/java 2 +sudo mv graalvm-community-openjdk-21.0.2+13.1 /usr/lib/jvm/ +sudo ln -s /usr/lib/jvm/graalvm-community-openjdk-21.0.2+13.1 /usr/lib/jvm/graalvm-21 +sudo ln -s /usr/lib/jvm/graalvm-21/bin/gu /usr/local/bin +sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/graalvm-21/bin/java 2 sudo update-alternatives --config java - -# install native-image in graalvm-ce-java11-linux-amd64-21.0.0.2/bin -sudo gu install native-image -sudo ln -s /usr/lib/jvm/graalvm/bin/native-image /usr/local/bin +sudo ln -s /usr/lib/jvm/graalvm-21/bin/native-image /usr/local/bin # deps sudo apt-get install build-essential libz-dev zlib1g-dev # build -cd ~/repo/dda/c4k-cloud +cd ~/repo/c4k/c4k-forgejo lein uberjar mkdir -p target/graalvm lein native diff --git a/graalvm-resource-config.json b/graalvm-resource-config.json new file mode 100644 index 0000000..e06faaa --- /dev/null +++ b/graalvm-resource-config.json @@ -0,0 +1,9 @@ +{ + "resources": { + "includes": [ + { + "pattern": ".*.yaml" + } + ] + } +} \ No newline at end of file diff --git a/project.clj b/project.clj index 04290e4..93a15d8 100644 --- a/project.clj +++ b/project.clj @@ -25,7 +25,8 @@ :dependencies [[org.clojure/tools.cli "1.0.219"] [ch.qos.logback/logback-classic "1.4.14" :exclusions [com.sun.mail/javax.mail]] - [org.slf4j/jcl-over-slf4j "2.0.12"]]}} + [org.slf4j/jcl-over-slf4j "2.0.12"] + [com.github.clj-easy/graal-build-time "0.1.5"]]}} :release-tasks [["test"] ["vcs" "assert-committed"] ["change" "version" "leiningen.release/bump-version" "release"] @@ -34,12 +35,16 @@ ["change" "version" "leiningen.release/bump-version"]] :aliases {"native" ["shell" "native-image" + ;"--verbose" + "--native-image-info" "--report-unsupported-elements-at-runtime" - "--initialize-at-build-time" + "--no-server" + "--no-fallback" + "-H:IncludeResources=.*.yaml" + "-H:Log=registerResource:verbose" + "-H:Name=target/graalvm/${:name}" "-jar" "target/uberjar/c4k-forgejo-standalone.jar" - "-H:ResourceConfigurationFiles=graalvm-resource-config.json" - "-H:Log=registerResource" - "-H:Name=target/graalvm/${:name}"] + ] "inst" ["shell" "sh" "-c"