Compare commits
3 commits
master
...
version-cl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc930250a4 | ||
|
|
3035fef138 | ||
|
|
62bd498b12 |
8 changed files with 58 additions and 5 deletions
4
deps.edn
4
deps.edn
|
|
@ -8,6 +8,7 @@
|
||||||
"feature-test-check"
|
"feature-test-check"
|
||||||
"feature-spec-alpha"
|
"feature-spec-alpha"
|
||||||
"feature-rewrite-clj"
|
"feature-rewrite-clj"
|
||||||
|
"feature-version-clj"
|
||||||
"pods/src"
|
"pods/src"
|
||||||
"babashka.nrepl/src"
|
"babashka.nrepl/src"
|
||||||
"depstar/src" "process/src"
|
"depstar/src" "process/src"
|
||||||
|
|
@ -35,7 +36,8 @@
|
||||||
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
||||||
org.clojure/core.match {:mvn/version "1.0.0"}
|
org.clojure/core.match {:mvn/version "1.0.0"}
|
||||||
hiccup/hiccup {:mvn/version "2.0.0-alpha2"}
|
hiccup/hiccup {:mvn/version "2.0.0-alpha2"}
|
||||||
rewrite-clj/rewrite-clj {:mvn/version "1.0.605-alpha"}}
|
rewrite-clj/rewrite-clj {:mvn/version "1.0.605-alpha"}
|
||||||
|
version-clj/version-clj {:mvn/version "2.0.1"}}
|
||||||
:aliases {:babashka/dev
|
:aliases {:babashka/dev
|
||||||
{:main-opts ["-m" "babashka.main"]}
|
{:main-opts ["-m" "babashka.main"]}
|
||||||
:profile
|
:profile
|
||||||
|
|
|
||||||
26
feature-version-clj/babashka/impl/version_clj.clj
Normal file
26
feature-version-clj/babashka/impl/version_clj.clj
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
(ns babashka.impl.version-clj
|
||||||
|
{:no-doc true}
|
||||||
|
(:require [sci.core :as sci]
|
||||||
|
[version-clj.core]))
|
||||||
|
|
||||||
|
(def vns (sci/create-ns 'version-clj.core nil))
|
||||||
|
|
||||||
|
(defn make-ns [ns sci-ns]
|
||||||
|
(reduce (fn [ns-map [var-name var]]
|
||||||
|
(let [m (meta var)
|
||||||
|
no-doc (:no-doc m)
|
||||||
|
doc (:doc m)
|
||||||
|
arglists (:arglists m)]
|
||||||
|
(if no-doc ns-map
|
||||||
|
(assoc ns-map var-name
|
||||||
|
(sci/new-var (symbol var-name) @var
|
||||||
|
(cond-> {:ns sci-ns
|
||||||
|
:name (:name m)}
|
||||||
|
(:macro m) (assoc :macro true)
|
||||||
|
doc (assoc :doc doc)
|
||||||
|
arglists (assoc :arglists arglists)))))))
|
||||||
|
{}
|
||||||
|
(ns-publics ns)))
|
||||||
|
|
||||||
|
(def version-clj-namespace
|
||||||
|
(make-ns 'version-clj.core vns))
|
||||||
|
|
@ -54,6 +54,8 @@
|
||||||
:feature/spec-alpha {:source-paths ["feature-spec-alpha"]}
|
:feature/spec-alpha {:source-paths ["feature-spec-alpha"]}
|
||||||
:feature/rewrite-clj {:source-paths ["feature-rewrite-clj"]
|
:feature/rewrite-clj {:source-paths ["feature-rewrite-clj"]
|
||||||
:dependencies [[rewrite-clj/rewrite-clj "1.0.605-alpha"]]}
|
:dependencies [[rewrite-clj/rewrite-clj "1.0.605-alpha"]]}
|
||||||
|
:feature/version-clj {:source-paths ["feature-version-clj"]
|
||||||
|
:dependencies [[version-clj/version-clj "2.0.1"]]}
|
||||||
:test [:feature/xml
|
:test [:feature/xml
|
||||||
:feature/lanterna
|
:feature/lanterna
|
||||||
:feature/yaml
|
:feature/yaml
|
||||||
|
|
@ -70,6 +72,7 @@
|
||||||
:feature/test-check
|
:feature/test-check
|
||||||
:feature/spec-alpha
|
:feature/spec-alpha
|
||||||
:feature/rewrite-clj
|
:feature/rewrite-clj
|
||||||
|
:feature/version-clj
|
||||||
{:dependencies [[com.clojure-goes-fast/clj-async-profiler "0.4.1"]
|
{:dependencies [[com.clojure-goes-fast/clj-async-profiler "0.4.1"]
|
||||||
[com.opentable.components/otj-pg-embedded "0.13.3"]]}]
|
[com.opentable.components/otj-pg-embedded "0.13.3"]]}]
|
||||||
:uberjar {:global-vars {*assert* false}
|
:uberjar {:global-vars {*assert* false}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ then
|
||||||
export BABASHKA_FEATURE_TEST_CHECK="${BABASHKA_FEATURE_TEST_CHECK:-false}"
|
export BABASHKA_FEATURE_TEST_CHECK="${BABASHKA_FEATURE_TEST_CHECK:-false}"
|
||||||
export BABASHKA_FEATURE_SPEC_ALPHA="${BABASHKA_FEATURE_SPEC_ALPHA:-false}"
|
export BABASHKA_FEATURE_SPEC_ALPHA="${BABASHKA_FEATURE_SPEC_ALPHA:-false}"
|
||||||
export BABASHKA_FEATURE_REWRITE_CLJ="${BABASHKA_FEATURE_REWRITE_CLJ:-false}"
|
export BABASHKA_FEATURE_REWRITE_CLJ="${BABASHKA_FEATURE_REWRITE_CLJ:-false}"
|
||||||
|
export BABASHKA_FEATURE_REWRITE_CLJ="${BABASHKA_FEATURE_VERSION_CLJ:-false}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$GRAALVM_HOME/bin/native-image" "${args[@]}"
|
"$GRAALVM_HOME/bin/native-image" "${args[@]}"
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,13 @@ else
|
||||||
BABASHKA_LEIN_PROFILES+=",-feature/rewrite-clj"
|
BABASHKA_LEIN_PROFILES+=",-feature/rewrite-clj"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$BABASHKA_FEATURE_VERSION_CLJ" != "false" ]
|
||||||
|
then
|
||||||
|
BABASHKA_LEIN_PROFILES+=",+feature/version-clj"
|
||||||
|
else
|
||||||
|
BABASHKA_LEIN_PROFILES+=",-feature/version-clj"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$BABASHKA_JAR" ]; then
|
if [ -z "$BABASHKA_JAR" ]; then
|
||||||
lein with-profiles "$BABASHKA_LEIN_PROFILES,+reflection,-uberjar" do run
|
lein with-profiles "$BABASHKA_LEIN_PROFILES,+reflection,-uberjar" do run
|
||||||
lein with-profiles "$BABASHKA_LEIN_PROFILES" do clean, uberjar
|
lein with-profiles "$BABASHKA_LEIN_PROFILES" do clean, uberjar
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,11 @@ set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/rewrite-clj
|
||||||
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/rewrite-clj
|
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/rewrite-clj
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not "%BABASHKA_FEATURE_VERSION_CLJ%"=="false" (
|
||||||
|
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,+feature/version-clj
|
||||||
|
) else (
|
||||||
|
set BABASHKA_LEIN_PROFILES=%BABASHKA_LEIN_PROFILES%,-feature/version-clj
|
||||||
|
)
|
||||||
|
|
||||||
call lein with-profiles %BABASHKA_LEIN_PROFILES% bb "(+ 1 2 3)"
|
call lein with-profiles %BABASHKA_LEIN_PROFILES% bb "(+ 1 2 3)"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
(def hiccup? (not= "false" (System/getenv "BABASHKA_FEATURE_HICCUP")))
|
(def hiccup? (not= "false" (System/getenv "BABASHKA_FEATURE_HICCUP")))
|
||||||
(def test-check? (not= "false" (System/getenv "BABASHKA_FEATURE_TEST_CHECK")))
|
(def test-check? (not= "false" (System/getenv "BABASHKA_FEATURE_TEST_CHECK")))
|
||||||
(def rewrite-clj? (not= "false" (System/getenv "BABASHKA_FEATURE_REWRITE_CLJ")))
|
(def rewrite-clj? (not= "false" (System/getenv "BABASHKA_FEATURE_REWRITE_CLJ")))
|
||||||
|
(def version-clj? (not= "false" (System/getenv "BABASHKA_FEATURE_VERSION_CLJ")))
|
||||||
|
|
||||||
;; excluded by default
|
;; excluded by default
|
||||||
(def jdbc? (= "true" (System/getenv "BABASHKA_FEATURE_JDBC")))
|
(def jdbc? (= "true" (System/getenv "BABASHKA_FEATURE_JDBC")))
|
||||||
|
|
@ -70,3 +71,6 @@
|
||||||
|
|
||||||
(when rewrite-clj?
|
(when rewrite-clj?
|
||||||
(require '[babashka.impl.rewrite-clj]))
|
(require '[babashka.impl.rewrite-clj]))
|
||||||
|
|
||||||
|
(when version-clj?
|
||||||
|
(require '[babashka.impl.version-clj]))
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,8 @@ When no eval opts or subcommand is provided, the implicit subcommand is repl.")
|
||||||
:feature/hiccup %s
|
:feature/hiccup %s
|
||||||
:feature/test-check %s
|
:feature/test-check %s
|
||||||
:feature/spec-alpha %s
|
:feature/spec-alpha %s
|
||||||
:feature/rewrite-clj %s}")
|
:feature/rewrite-clj %s
|
||||||
|
:feature/version-clj %s}")
|
||||||
version
|
version
|
||||||
features/core-async?
|
features/core-async?
|
||||||
features/csv?
|
features/csv?
|
||||||
|
|
@ -209,7 +210,8 @@ When no eval opts or subcommand is provided, the implicit subcommand is repl.")
|
||||||
features/hiccup?
|
features/hiccup?
|
||||||
features/test-check?
|
features/test-check?
|
||||||
features/spec-alpha?
|
features/spec-alpha?
|
||||||
features/rewrite-clj?)))
|
features/rewrite-clj?
|
||||||
|
features/version-clj?)))
|
||||||
|
|
||||||
(defn read-file [file]
|
(defn read-file [file]
|
||||||
(let [f (io/file file)]
|
(let [f (io/file file)]
|
||||||
|
|
@ -260,7 +262,8 @@ When no eval opts or subcommand is provided, the implicit subcommand is repl.")
|
||||||
features/jdbc? (assoc 'jdbc 'next.jdbc)
|
features/jdbc? (assoc 'jdbc 'next.jdbc)
|
||||||
features/core-async? (assoc 'async 'clojure.core.async)
|
features/core-async? (assoc 'async 'clojure.core.async)
|
||||||
features/csv? (assoc 'csv 'clojure.data.csv)
|
features/csv? (assoc 'csv 'clojure.data.csv)
|
||||||
features/transit? (assoc 'transit 'cognitect.transit)))
|
features/transit? (assoc 'transit 'cognitect.transit)
|
||||||
|
features/version-clj? (assoc 'version 'version-clj.core)))
|
||||||
|
|
||||||
;;(def ^:private server-ns-obj (sci/create-ns 'clojure.core.server nil))
|
;;(def ^:private server-ns-obj (sci/create-ns 'clojure.core.server nil))
|
||||||
|
|
||||||
|
|
@ -349,7 +352,9 @@ When no eval opts or subcommand is provided, the implicit subcommand is repl.")
|
||||||
'rewrite-clj.zip
|
'rewrite-clj.zip
|
||||||
@(resolve 'babashka.impl.rewrite-clj/zip-namespace)
|
@(resolve 'babashka.impl.rewrite-clj/zip-namespace)
|
||||||
'rewrite-clj.zip.subedit
|
'rewrite-clj.zip.subedit
|
||||||
@(resolve 'babashka.impl.rewrite-clj/subedit-namespace))))
|
@(resolve 'babashka.impl.rewrite-clj/subedit-namespace))
|
||||||
|
features/version-clj? (assoc 'version-clj.core
|
||||||
|
@(resolve 'babashka.impl.version-clj/version-clj-namespace))))
|
||||||
|
|
||||||
(def imports
|
(def imports
|
||||||
'{ArithmeticException java.lang.ArithmeticException
|
'{ArithmeticException java.lang.ArithmeticException
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue