From b15ed52da0317203ad37625bccc5a173f561ffe3 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Tue, 21 May 2019 14:13:01 +0200 Subject: [PATCH 1/3] Reuse let variable --- src/bootstrap.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap.clj b/src/bootstrap.clj index 4a34e62..78a7ac6 100644 --- a/src/bootstrap.clj +++ b/src/bootstrap.clj @@ -55,7 +55,7 @@ (defn- pin-version [version] (let [props (io/file (conf/work-dir) "boot.properties")] - (when (and (.exists ^File (io/file (conf/work-dir) "boot.properties")) + (when (and (.exists ^File props) (not= version (:boot-version (conf/project)))) (println (format "Pinning BOOT_VERSION to %s..." version)) (-> (props/load-properties props) From a4e7e41e4bae8cdc6da396c0e233bbd0ad1fdc0f Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Tue, 21 May 2019 14:20:43 +0200 Subject: [PATCH 2/3] Take `:boot-jvm-options` into account --- src/bootstrap.clj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bootstrap.clj b/src/bootstrap.clj index 78a7ac6..2ad789a 100644 --- a/src/bootstrap.clj +++ b/src/bootstrap.clj @@ -63,8 +63,14 @@ (defn- launch-version [version args] (let [jar (.getAbsolutePath ^File (version-jar version)) - command (:boot-java-command (conf/config) "java") - ^List args (into [command "-jar" jar] args)] + conf (conf/config) + command (:boot-java-command conf "java") + jvm-options (some-> (get conf :boot-jvm-options) vector) + ^List args (into [command] + (concat + jvm-options + ["-jar" jar] + args))] (.waitFor (.start (.inheritIO (ProcessBuilder. args)))))) (defn- print-version [config] From 902eaf520765712c061747769fed57c79d999ca5 Mon Sep 17 00:00:00 2001 From: Jeroen van Dijk Date: Tue, 21 May 2019 14:46:39 +0200 Subject: [PATCH 3/3] Add simple makefile to manage compilation --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9215a6b --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +BINARY_LOC := $(shell which boot || which boot.bak | sed "s/.bak//") + +echo: + echo ${BINARY_LOC} + +bin/boot.sh: + boot build standalone + cat src/head.sh target/bootstrap.uber.jar > bin/boot.sh + chmod +x bin/boot.sh + +install-boot-bin: bin/boot.sh + mv bin/boot.sh ${BINARY_LOC} + +backup-boot-bin: + mv ${BINARY_LOC} ${BINARY_LOC}.bak + +restore-boot-bin: + mv ${BINARY_LOC}.bak ${BINARY_LOC}