From 9d4eb75af7407b0f50a7b6653a47021ee7e7f6f8 Mon Sep 17 00:00:00 2001 From: Bahman Movaqar Date: Tue, 31 Dec 2024 14:31:35 -0800 Subject: [PATCH] Create a launcher and add it to the distribution --- Makefile | 1 + bjForth | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 bjForth diff --git a/Makefile b/Makefile index 92f0853..22867d8 100644 --- a/Makefile +++ b/Makefile @@ -100,6 +100,7 @@ package : cp $(root.forth)*.forth $(root.build) mkdir -p $(root.build)docs cp $(root.docs)*.md $(root.build)docs + cp $(ROOT)bjForth $(root.build) cd $(root.build) && tar -cf bjForth-$(VERSION).tar * #################################################################################################### diff --git a/bjForth b/bjForth new file mode 100755 index 0000000..fe5e953 --- /dev/null +++ b/bjForth @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +jarFile=$(ls bjForth-*.jar 2>/dev/null) +if [[ -z $jarFile ]]; then + echo "Cannot find bjForth JAR file. Make sure you are in the same directory." + exit 1; +fi + +# Your source files should go here. +# For instance, cat bjForth.forth my-source.forth - | ... +cat bjForth.forth - \ +| java \ + --add-opens=java.base/java.lang=ALL-UNNAMED \ + --add-opens=java.base/java.lang.reflect=ALL-UNNAMED \ + --add-opens=java.base/java.io=ALL-UNNAMED \ + --add-opens=java.base/java.util=ALL-UNNAMED \ + --add-opens=java.base/java.util.stream=ALL-UNNAMED \ + -jar ${jarFile} +