File tree Expand file tree Collapse file tree 5 files changed +22
-14
lines changed
resources/META-INF/native-image/babashka/process Expand file tree Collapse file tree 5 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 4545 java -version
4646 bb --version
4747
48+ - name : 🔧 Install bb from dev build (until next release)
49+ shell : bash
50+ run : |
51+ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
52+ chmod +x ./install
53+ ./install --dev-build --dir /tmp
54+ cp /tmp/bb "$(which bb)"
55+
4856 - name : Run bb tests
4957 run : |
5058 bb test:bb
Original file line number Diff line number Diff line change 11{:deps {babashka/fs {:mvn/version " 0.4.18" }}
2+ :paths [" src" " resources" ]
23 :aliases {:test {:extra-paths [" test" ]
34 :extra-deps {io.github.cognitect-labs/test-runner {:git/tag " v0.5.1" :git/sha " dfb30dd" }}
45 :main-opts [" -m" " cognitect.test-runner" ]}
Original file line number Diff line number Diff line change 77 :url " https://www.eclipse.org/legal/epl-1.0/" }
88 :dependencies [[org.clojure/clojure " 1.9.0" ]
99 [babashka/fs " 0.4.18" ]]
10+ :source-paths [" src" " resources" ]
1011 :deploy-repositories [[" clojars" {:url " https://clojars.org/repo"
1112 :username :env/clojars_user
1213 :password :env/clojars_pass
Original file line number Diff line number Diff line change 1+ [ {
2+ "name" : " org.graalvm.nativeimage.ProcessProperties" ,
3+ "methods" : [{"name" : " exec" }]
4+ } ]
Original file line number Diff line number Diff line change 604604 :err :string } opts)]
605605 @(process* {:cmd cmd :opts opts :prev prev})))
606606
607- (def ^:private has-exec?
608- (boolean (try (.getMethod ^Class
609- (resolve 'org.graalvm.nativeimage.ProcessProperties) " exec"
610- (into-array [java.nio.file.Path (Class/forName " [Ljava.lang.String;" ) java.util.Map]))
611- (catch Exception _ false ))))
612-
613- (defmacro ^:no-doc
614- if-has-exec [then else]
615- (if has-exec?
616- then else))
607+ (def ^:private exec-meth
608+ (delay (try (.getMethod (Class/forName " org.graalvm.nativeimage.ProcessProperties" ) " exec"
609+ (into-array [java.nio.file.Path (Class/forName " [Ljava.lang.String;" ) java.util.Map]))
610+ (catch Exception _ nil ))))
617611
618612(defn exec
619613 " Replaces the current process image with the process image specified
649643 ^java.util.Map env (into (or (as-string-map env)
650644 (into {} (System/getenv )))
651645 (as-string-map extra-env))]
652- (if-has- exec
653- ( org.graalvm.nativeimage.ProcessProperties/exec (fs/path program)
654- (into-array String args)
655- env)
646+ (if-let [^java.lang.reflect.Method meth @ exec-meth]
647+ ( .invoke meth nil ( into-array Object [ (fs/path program)
648+ (into-array String args)
649+ env]) )
656650 (throw (ex-info " exec is not supported in non-GraalVM environments" {:cmd cmd}))))))
657651
658652(def ^:private default-shell-opts
You can’t perform that action at this time.
0 commit comments