Compare commits
13 commits
master
...
cap10morga
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91a35b770a | ||
|
|
5468f61a67 | ||
|
|
53f1feda98 | ||
|
|
7363aaabc7 | ||
|
|
3363809f6f | ||
|
|
6900999085 | ||
|
|
4d1f59ce22 | ||
|
|
f24eb5142d | ||
|
|
02c8b77c5e | ||
|
|
9b245b9a40 | ||
|
|
debdeb8ad0 | ||
|
|
a512c1814d | ||
|
|
a2966d5967 |
194 changed files with 3797 additions and 9998 deletions
|
|
@ -2,5 +2,5 @@
|
||||||
:deps {borkdude/gh-release-artifact
|
:deps {borkdude/gh-release-artifact
|
||||||
#_{:local/root "../gh-release-artifact"}
|
#_{:local/root "../gh-release-artifact"}
|
||||||
{:git/url "https://github.com/borkdude/gh-release-artifact"
|
{:git/url "https://github.com/borkdude/gh-release-artifact"
|
||||||
:git/sha "4a9a74f0e50e897c45df8cc70684360eb30fce80"}}
|
:git/sha "ce060c12a25b552b864dc90f8fb344a2eb91ea9d"}}
|
||||||
:tasks {release-artifact babashka.release-artifact/release}}
|
:tasks {release-artifact babashka.release-artifact/release}}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Generate config
|
name: Generate config
|
||||||
command: |
|
command: |
|
||||||
/tmp/bbb .circleci/script/gen_ci.clj > generated_config.yml
|
/tmp/bbb .circleci/script/short_ci.clj > generated_config.yml
|
||||||
- continuation/continue:
|
- continuation/continue:
|
||||||
configuration_path: generated_config.yml
|
configuration_path: generated_config.yml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
(require '[babashka.fs :as fs]
|
(require '[clojure.string :as str]
|
||||||
'[babashka.process :as proc]
|
'[babashka.process :as proc]
|
||||||
'[clojure.string :as str])
|
'[babashka.fs :as fs])
|
||||||
(import '[java.time Instant])
|
(import '[java.time Instant])
|
||||||
|
|
||||||
(defn read-env
|
(defn read-env
|
||||||
|
|
@ -12,9 +12,7 @@
|
||||||
|
|
||||||
(def image-name "babashka/babashka")
|
(def image-name "babashka/babashka")
|
||||||
|
|
||||||
(def ghcr-image-name "ghcr.io/babashka/babashka")
|
(def image-tag (slurp "resources/BABASHKA_VERSION"))
|
||||||
|
|
||||||
(def image-tag (str/trim (slurp "resources/BABASHKA_VERSION")))
|
|
||||||
|
|
||||||
(def latest-tag "latest")
|
(def latest-tag "latest")
|
||||||
|
|
||||||
|
|
@ -48,11 +46,6 @@
|
||||||
[username password]
|
[username password]
|
||||||
(exec ["docker" "login" "-u" username "-p" password]))
|
(exec ["docker" "login" "-u" username "-p" password]))
|
||||||
|
|
||||||
(defn docker-login-ghcr
|
|
||||||
[username password]
|
|
||||||
(exec ["docker" "login" "ghcr.io" "-u" username "-p" password]))
|
|
||||||
|
|
||||||
;; TODO: Remove this when Dockerhub goes off
|
|
||||||
(defn build-push
|
(defn build-push
|
||||||
[image-tag platform docker-file]
|
[image-tag platform docker-file]
|
||||||
(println (format "Building and pushing %s Docker image(s) %s:%s"
|
(println (format "Building and pushing %s Docker image(s) %s:%s"
|
||||||
|
|
@ -62,21 +55,6 @@
|
||||||
(let [base-cmd ["docker" "buildx" "build"
|
(let [base-cmd ["docker" "buildx" "build"
|
||||||
"-t" (str image-name ":" image-tag)
|
"-t" (str image-name ":" image-tag)
|
||||||
"--platform" platform
|
"--platform" platform
|
||||||
"--progress" "plain"
|
|
||||||
"--push"
|
|
||||||
"-f" docker-file]]
|
|
||||||
(exec (concat base-cmd label-args ["."]))))
|
|
||||||
|
|
||||||
(defn build-push-ghcr
|
|
||||||
[image-tag platform docker-file]
|
|
||||||
(println (format "Building and pushing %s Docker image(s) %s:%s to GHCR"
|
|
||||||
platform
|
|
||||||
ghcr-image-name
|
|
||||||
image-tag))
|
|
||||||
(let [base-cmd ["docker" "buildx" "build"
|
|
||||||
"-t" (str ghcr-image-name ":" image-tag)
|
|
||||||
"--platform" platform
|
|
||||||
"--progress" "plain"
|
|
||||||
"--push"
|
"--push"
|
||||||
"-f" docker-file]]
|
"-f" docker-file]]
|
||||||
(exec (concat base-cmd label-args ["."]))))
|
(exec (concat base-cmd label-args ["."]))))
|
||||||
|
|
@ -86,7 +64,7 @@
|
||||||
(doseq [platform (str/split platforms #",")]
|
(doseq [platform (str/split platforms #",")]
|
||||||
(let [tarball-platform (str/replace platform #"\/" "-")
|
(let [tarball-platform (str/replace platform #"\/" "-")
|
||||||
tarball-platform (if (= "linux-arm64" tarball-platform)
|
tarball-platform (if (= "linux-arm64" tarball-platform)
|
||||||
"linux-aarch64-static"
|
"linux-aarch64"
|
||||||
tarball-platform)
|
tarball-platform)
|
||||||
tarball-path (format "/tmp/release/babashka-%s-%s.tar.gz"
|
tarball-path (format "/tmp/release/babashka-%s-%s.tar.gz"
|
||||||
image-tag
|
image-tag
|
||||||
|
|
@ -96,20 +74,16 @@
|
||||||
; this overwrites, but this is to work around having built the uberjar/metabom multiple times
|
; this overwrites, but this is to work around having built the uberjar/metabom multiple times
|
||||||
(fs/copy (format "/tmp/release/%s-metabom.jar" tarball-platform) "metabom.jar" {:replace-existing true})))
|
(fs/copy (format "/tmp/release/%s-metabom.jar" tarball-platform) "metabom.jar" {:replace-existing true})))
|
||||||
(build-push image-tag platforms "Dockerfile.ci")
|
(build-push image-tag platforms "Dockerfile.ci")
|
||||||
(build-push-ghcr image-tag platforms "Dockerfile.ci")
|
|
||||||
(when-not snapshot?
|
(when-not snapshot?
|
||||||
(build-push latest-tag platforms "Dockerfile.ci")
|
(build-push latest-tag platforms "Dockerfile.ci")))
|
||||||
(build-push-ghcr latest-tag platforms "Dockerfile.ci")))
|
|
||||||
|
|
||||||
(defn build-push-alpine-images
|
(defn build-push-alpine-images
|
||||||
"Build alpine image for linux-amd64 only (no upstream arm64 support yet)"
|
"Build alpine image for linux-amd64 only (no upstream arm64 support yet)"
|
||||||
[]
|
[]
|
||||||
(exec ["tar" "zxvf" (str "/tmp/release/babashka-" image-tag "-linux-amd64-static.tar.gz")])
|
(exec ["tar" "zxvf" (str "/tmp/release/babashka-" image-tag "-linux-amd64-static.tar.gz")])
|
||||||
(build-push (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
(build-push (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
||||||
(build-push-ghcr (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
|
||||||
(when-not snapshot?
|
(when-not snapshot?
|
||||||
(build-push "alpine" "linux/amd64" "Dockerfile.alpine")
|
(build-push "alpine" "linux/amd64" "Dockerfile.alpine")))
|
||||||
(build-push-ghcr "alpine" "linux/amd64" "Dockerfile.alpine")))
|
|
||||||
|
|
||||||
(when (= *file* (System/getProperty "babashka.file"))
|
(when (= *file* (System/getProperty "babashka.file"))
|
||||||
(if (and (nil? (read-env "CIRCLE_PULL_REQUEST"))
|
(if (and (nil? (read-env "CIRCLE_PULL_REQUEST"))
|
||||||
|
|
@ -119,7 +93,6 @@
|
||||||
(println "This is a snapshot version")
|
(println "This is a snapshot version")
|
||||||
(println "This is a non-snapshot version"))
|
(println "This is a non-snapshot version"))
|
||||||
(docker-login (read-env "DOCKERHUB_USER") (read-env "DOCKERHUB_PASS"))
|
(docker-login (read-env "DOCKERHUB_USER") (read-env "DOCKERHUB_PASS"))
|
||||||
(docker-login-ghcr (read-env "CONTAINER_REGISTRY_USER") (read-env "BB_GHCR_TOKEN"))
|
|
||||||
(build-push-images)
|
(build-push-images)
|
||||||
(build-push-alpine-images))
|
(build-push-alpine-images))
|
||||||
(println "Not publishing docker image(s).")))
|
(println "Not publishing docker image(s).")))
|
||||||
|
|
|
||||||
|
|
@ -1,281 +0,0 @@
|
||||||
(ns gen-ci
|
|
||||||
(:require
|
|
||||||
[babashka.tasks :as tasks]
|
|
||||||
[clj-yaml.core :as yaml]
|
|
||||||
[clojure.string :as str]
|
|
||||||
[flatland.ordered.map :refer [ordered-map]]))
|
|
||||||
|
|
||||||
(def graalvm-version "24")
|
|
||||||
|
|
||||||
(defn run
|
|
||||||
([cmd-name cmd]
|
|
||||||
(run cmd-name cmd nil))
|
|
||||||
([cmd-name cmd no-output-timeout]
|
|
||||||
(let [base {:run {:name cmd-name
|
|
||||||
:command cmd}}]
|
|
||||||
(if no-output-timeout
|
|
||||||
(assoc-in base [:run :no_output_timeout] no-output-timeout)
|
|
||||||
base))))
|
|
||||||
|
|
||||||
(defn gen-steps
|
|
||||||
[shorted? steps]
|
|
||||||
(if shorted?
|
|
||||||
[(run "Shorted" "echo 'Skipping Run'")]
|
|
||||||
steps))
|
|
||||||
|
|
||||||
(defn gen-job
|
|
||||||
[shorted? conf]
|
|
||||||
(if shorted?
|
|
||||||
(-> conf
|
|
||||||
(dissoc :machine :macos)
|
|
||||||
(assoc :resource_class "small" :docker [{:image "ubuntu:latest"}]))
|
|
||||||
conf))
|
|
||||||
|
|
||||||
(defn pull-submodules
|
|
||||||
[]
|
|
||||||
(run "Pull Submodules" "git submodule init\ngit submodule update"))
|
|
||||||
|
|
||||||
(defn deploy
|
|
||||||
[shorted?]
|
|
||||||
(gen-job shorted?
|
|
||||||
(ordered-map
|
|
||||||
:resource_class "large"
|
|
||||||
:docker [{:image "circleci/clojure:lein-2.9.8"}]
|
|
||||||
:working_directory "~/repo"
|
|
||||||
:environment {:LEIN_ROOT "true"}
|
|
||||||
:steps (gen-steps
|
|
||||||
shorted?
|
|
||||||
[:checkout
|
|
||||||
(pull-submodules)
|
|
||||||
{:restore_cache {:keys ["v1-dependencies-{{ checksum \"project.clj\" }}"
|
|
||||||
"v1-dependencies-"]}}
|
|
||||||
{:run ".circleci/script/deploy"}
|
|
||||||
{:save_cache {:paths ["~/.m2"]
|
|
||||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}"}}]))))
|
|
||||||
|
|
||||||
(defn docker
|
|
||||||
[shorted?]
|
|
||||||
(gen-job
|
|
||||||
shorted?
|
|
||||||
(ordered-map
|
|
||||||
:machine {:image "ubuntu-2004:2024.05.1"}
|
|
||||||
:steps
|
|
||||||
(gen-steps
|
|
||||||
shorted?
|
|
||||||
[:checkout
|
|
||||||
(pull-submodules)
|
|
||||||
"setup-docker-buildx"
|
|
||||||
{:attach_workspace {:at "/tmp"}}
|
|
||||||
(run "Build uberjar" "script/uberjar")
|
|
||||||
{:run
|
|
||||||
{:name "Build Docker image"
|
|
||||||
:environment {:PLATFORMS "linux/amd64,linux/arm64"}
|
|
||||||
:command
|
|
||||||
"java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj"}}]))))
|
|
||||||
|
|
||||||
(defn jvm
|
|
||||||
[shorted? graalvm-home]
|
|
||||||
(gen-job
|
|
||||||
shorted?
|
|
||||||
(ordered-map
|
|
||||||
:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]
|
|
||||||
:working_directory "~/repo"
|
|
||||||
:environment {:LEIN_ROOT "true"
|
|
||||||
:BABASHKA_PLATFORM "linux"
|
|
||||||
:GRAALVM_VERSION graalvm-version
|
|
||||||
:GRAALVM_HOME graalvm-home
|
|
||||||
:BABASHKA_TEST_ENV "jvm"
|
|
||||||
:BABASHKA_SHA (System/getenv "CIRCLE_SHA1")}
|
|
||||||
:resource_class "large"
|
|
||||||
:steps
|
|
||||||
(gen-steps
|
|
||||||
shorted?
|
|
||||||
[:checkout
|
|
||||||
(pull-submodules)
|
|
||||||
{:restore_cache {:keys ["v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"
|
|
||||||
"v1-dependencies-"]}}
|
|
||||||
(run "Install Clojure" "sudo script/install-clojure")
|
|
||||||
(run "Download GraalVM" "script/install-graalvm")
|
|
||||||
(run
|
|
||||||
"Run JVM tests"
|
|
||||||
"export BABASHKA_FEATURE_JDBC=true
|
|
||||||
export BABASHKA_FEATURE_POSTGRESQL=true
|
|
||||||
script/test\nscript/run_lib_tests")
|
|
||||||
(run
|
|
||||||
"Create uberjar"
|
|
||||||
"mkdir -p /tmp/release
|
|
||||||
script/uberjar
|
|
||||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
|
||||||
jar=target/babashka-$VERSION-standalone.jar
|
|
||||||
cp $jar /tmp/release
|
|
||||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
|
||||||
export JAVA_HOME=$GRAALVM_HOME
|
|
||||||
java -jar $jar script/reflection.clj
|
|
||||||
reflection=\"babashka-$VERSION-reflection.json\"
|
|
||||||
java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$jar\"
|
|
||||||
java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$reflection\"")
|
|
||||||
{:store_artifacts {:path "/tmp/release"
|
|
||||||
:destination "release"}}
|
|
||||||
{:save_cache {:paths ["~/.m2"]
|
|
||||||
:key "v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"}}]))))
|
|
||||||
|
|
||||||
(defn unix
|
|
||||||
[shorted? static? musl? arch executor-conf resource-class graalvm-home platform]
|
|
||||||
(let [env {:LEIN_ROOT "true"
|
|
||||||
:GRAALVM_VERSION graalvm-version
|
|
||||||
:GRAALVM_HOME graalvm-home
|
|
||||||
:BABASHKA_PLATFORM (if (= "mac" platform)
|
|
||||||
"macos"
|
|
||||||
platform)
|
|
||||||
:BABASHKA_TEST_ENV "native"
|
|
||||||
:BABASHKA_XMX "-J-Xmx6500m"
|
|
||||||
:BABASHKA_SHA (System/getenv "CIRCLE_SHA1")}
|
|
||||||
env (if (= "aarch64" arch)
|
|
||||||
(assoc env :BABASHKA_ARCH arch)
|
|
||||||
env)
|
|
||||||
env (if static?
|
|
||||||
(assoc env :BABASHKA_STATIC "true")
|
|
||||||
env)
|
|
||||||
env (if musl?
|
|
||||||
(assoc env :BABASHKA_MUSL "true")
|
|
||||||
env)
|
|
||||||
env (if (= "mac" platform)
|
|
||||||
(assoc env :MACOSX_DEPLOYMENT_TARGET 10.13)
|
|
||||||
env)
|
|
||||||
base-install-cmd "sudo apt-get update\nsudo apt-get -y install build-essential zlib1g-dev"
|
|
||||||
cache-key (format "%s-%s{{ checksum \"project.clj\" }}-{{ checksum \".circleci/config.yml\" }}"
|
|
||||||
platform
|
|
||||||
(if (= "aarch64" arch)
|
|
||||||
"aarch64-"
|
|
||||||
""))]
|
|
||||||
(gen-job shorted?
|
|
||||||
(merge
|
|
||||||
executor-conf
|
|
||||||
(ordered-map
|
|
||||||
:working_directory "~/repo"
|
|
||||||
:environment env
|
|
||||||
:resource_class resource-class
|
|
||||||
:steps (gen-steps shorted?
|
|
||||||
(filter some?
|
|
||||||
[:checkout
|
|
||||||
(when (contains? #{"linux" "linux-aarch64"} platform)
|
|
||||||
(run "Check max glibc version" "script/check_glibc.sh"))
|
|
||||||
{:attach_workspace {:at "/tmp"}}
|
|
||||||
(run "Pull Submodules" "git submodule init\ngit submodule update")
|
|
||||||
{:restore_cache
|
|
||||||
{:keys [cache-key]}}
|
|
||||||
(when (= "mac" platform)
|
|
||||||
(run "Install Rosetta" "sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license"))
|
|
||||||
(run "Install Clojure" "sudo script/install-clojure")
|
|
||||||
(when (= "mac" platform)
|
|
||||||
(run "Install Leiningen" "script/install-leiningen"))
|
|
||||||
(when (not= "mac" platform)
|
|
||||||
(run "Install native dev tools"
|
|
||||||
(if (and static? musl? (not= "aarch64" arch))
|
|
||||||
(str base-install-cmd "\nsudo -E script/setup-musl")
|
|
||||||
base-install-cmd)))
|
|
||||||
(run "Download GraalVM" "script/install-graalvm")
|
|
||||||
#_(run "Download iprof" "curl -sLO 'https://github.com/babashka/pgo-profiles/releases/download/2023.10.11/default.iprof'")
|
|
||||||
(run "Build binary" (if (= "aarch64" arch)
|
|
||||||
"script/uberjar\nscript/compile -H:PageSize=64K # --pgo=default.iprof"
|
|
||||||
"script/uberjar\nscript/compile # --pgo=default.iprof") "30m")
|
|
||||||
(run "Release" ".circleci/script/release")
|
|
||||||
{:persist_to_workspace {:root "/tmp"
|
|
||||||
:paths ["release"]}}
|
|
||||||
(run "Run tests" "script/test\nscript/run_lib_tests")
|
|
||||||
(run "Release + publish"
|
|
||||||
(str/join "\n" ["export BABASHKA_RELEASE=true"
|
|
||||||
".circleci/script/release"]))
|
|
||||||
{:save_cache
|
|
||||||
{:paths ["~/.m2" "~/graalvm"]
|
|
||||||
:key cache-key}}
|
|
||||||
{:store_artifacts {:path "/tmp/release"
|
|
||||||
:destination "release"}}
|
|
||||||
(run "Publish artifact link to Slack"
|
|
||||||
"./bb .circleci/script/publish_artifact.clj || true")])))))))
|
|
||||||
|
|
||||||
(defn make-config
|
|
||||||
[shorted?]
|
|
||||||
(let [docker-executor-conf {:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]}
|
|
||||||
machine-executor-conf {:machine {:image "ubuntu-2004:2024.05.1"}}
|
|
||||||
mac-executor-conf {:macos {:xcode "13.4.1"}}
|
|
||||||
linux-graalvm-home (str "/home/circleci/graalvm-" graalvm-version)
|
|
||||||
mac-graalvm-home (format "/Users/distiller/graalvm-%s/Contents/Home" graalvm-version)]
|
|
||||||
(ordered-map
|
|
||||||
:version 2.1
|
|
||||||
:commands
|
|
||||||
{:setup-docker-buildx
|
|
||||||
{:steps
|
|
||||||
[{:run
|
|
||||||
{:name "Create multi-platform capabale buildx builder"
|
|
||||||
:command
|
|
||||||
"docker run --privileged --rm tonistiigi/binfmt --install all\ndocker buildx create --name ci-builder --use"}}]}}
|
|
||||||
:jobs (ordered-map
|
|
||||||
:jvm (jvm shorted? linux-graalvm-home)
|
|
||||||
:linux (unix shorted? false false "amd64" docker-executor-conf "large" linux-graalvm-home "linux")
|
|
||||||
:linux-static
|
|
||||||
(unix shorted? true true "amd64" docker-executor-conf "large" linux-graalvm-home "linux")
|
|
||||||
:linux-aarch64-static
|
|
||||||
(unix shorted? true false "aarch64" machine-executor-conf "arm.large" linux-graalvm-home "linux")
|
|
||||||
:mac (unix shorted? false false "amd64" mac-executor-conf "macos.m1.medium.gen1" mac-graalvm-home "mac")
|
|
||||||
:deploy (deploy shorted?)
|
|
||||||
:docker (docker shorted?))
|
|
||||||
:workflows (ordered-map
|
|
||||||
:version 2
|
|
||||||
:ci {:jobs ["jvm"
|
|
||||||
"linux"
|
|
||||||
"linux-static"
|
|
||||||
"mac"
|
|
||||||
"linux-aarch64-static"
|
|
||||||
{:deploy {:filters {:branches {:only "master"}}
|
|
||||||
:requires ["jvm" "linux"]}}
|
|
||||||
{:docker {:filters {:branches {:only "master"}}
|
|
||||||
:requires ["linux" "linux-static" "linux-aarch64-static"]}}]}))))
|
|
||||||
|
|
||||||
(def skip-config
|
|
||||||
{:skip-if-only [#".*.md$"
|
|
||||||
#"^logo\/.*$"]})
|
|
||||||
|
|
||||||
(defn get-changes
|
|
||||||
[]
|
|
||||||
(-> (tasks/shell {:out :string} "git diff --name-only HEAD~1")
|
|
||||||
(:out)
|
|
||||||
(str/split-lines)))
|
|
||||||
|
|
||||||
(defn irrelevant-change?
|
|
||||||
[change regexes]
|
|
||||||
(some? (some #(re-matches % change) regexes)))
|
|
||||||
|
|
||||||
(defn relevant?
|
|
||||||
[change-set regexes]
|
|
||||||
(some? (some #(not (irrelevant-change? % regexes)) change-set)))
|
|
||||||
|
|
||||||
(defn main
|
|
||||||
[]
|
|
||||||
(let [{:keys [skip-if-only]} skip-config
|
|
||||||
changed-files (get-changes)
|
|
||||||
conf (make-config (not (relevant? changed-files skip-if-only)))]
|
|
||||||
(println (yaml/generate-string conf
|
|
||||||
:dumper-options
|
|
||||||
{:flow-style :block}))))
|
|
||||||
|
|
||||||
(when (= *file* (System/getProperty "babashka.file"))
|
|
||||||
(main))
|
|
||||||
|
|
||||||
(comment
|
|
||||||
(main)
|
|
||||||
|
|
||||||
(def regexes
|
|
||||||
[#".*.md$"
|
|
||||||
#".*.clj$" ; ignore clojure files
|
|
||||||
#"^logo\/.*$"])
|
|
||||||
|
|
||||||
(:out (tasks/shell {:out :string} "ls"))
|
|
||||||
|
|
||||||
(irrelevant-change? "src/file.png" regexes)
|
|
||||||
|
|
||||||
(re-matches #".*.clj$" "src/file.clj.dfff")
|
|
||||||
|
|
||||||
(re-matches #"^logo\/.*$" "logo/foo/bar.jpg")
|
|
||||||
|
|
||||||
(relevant? ["src/file.clj"] regexes))
|
|
||||||
|
|
@ -29,9 +29,7 @@ tar zcvf "$archive" bb # bbk
|
||||||
|
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
if [ "$BABASHKA_RELEASE" = "true" ]; then
|
./bb --config .build/bb.edn --deps-root . release-artifact "/tmp/release/$archive"
|
||||||
./bb --config .build/bb.edn --deps-root . release-artifact "/tmp/release/$archive"
|
|
||||||
fi
|
|
||||||
|
|
||||||
## cleanup
|
## cleanup
|
||||||
|
|
||||||
|
|
|
||||||
271
.circleci/script/short_ci.clj
Normal file
271
.circleci/script/short_ci.clj
Normal file
|
|
@ -0,0 +1,271 @@
|
||||||
|
(ns short-ci
|
||||||
|
(:require
|
||||||
|
[babashka.tasks :as tasks]
|
||||||
|
[clj-yaml.core :as yaml]
|
||||||
|
[clojure.string :as str]
|
||||||
|
[flatland.ordered.map :refer [ordered-map]]))
|
||||||
|
|
||||||
|
(defn run
|
||||||
|
([cmd-name cmd]
|
||||||
|
(run cmd-name cmd nil))
|
||||||
|
([cmd-name cmd no-output-timeout]
|
||||||
|
(let [base {:run {:name cmd-name
|
||||||
|
:command cmd}}]
|
||||||
|
(if no-output-timeout
|
||||||
|
(assoc-in base [:run :no_output_timeout] no-output-timeout)
|
||||||
|
base))))
|
||||||
|
|
||||||
|
(defn gen-steps
|
||||||
|
[shorted? steps]
|
||||||
|
(if shorted?
|
||||||
|
[(run "Shorted" "echo 'Skipping Run'")]
|
||||||
|
steps))
|
||||||
|
|
||||||
|
(defn gen-job
|
||||||
|
[shorted? conf]
|
||||||
|
(if shorted?
|
||||||
|
(-> conf
|
||||||
|
(dissoc :machine :macos)
|
||||||
|
(assoc :resource_class "small" :docker [{:image "ubuntu:latest"}]))
|
||||||
|
conf))
|
||||||
|
|
||||||
|
(defn pull-submodules
|
||||||
|
[]
|
||||||
|
(run "Pull Submodules" "git submodule init\ngit submodule update"))
|
||||||
|
|
||||||
|
(defn deploy
|
||||||
|
[shorted?]
|
||||||
|
(gen-job shorted?
|
||||||
|
(ordered-map
|
||||||
|
:resource_class "large"
|
||||||
|
:docker [{:image "circleci/clojure:lein-2.9.8"}]
|
||||||
|
:working_directory "~/repo"
|
||||||
|
:environment {:LEIN_ROOT "true"}
|
||||||
|
:steps (gen-steps
|
||||||
|
shorted?
|
||||||
|
[:checkout
|
||||||
|
(pull-submodules)
|
||||||
|
{:restore_cache {:keys ["v1-dependencies-{{ checksum \"project.clj\" }}"
|
||||||
|
"v1-dependencies-"]}}
|
||||||
|
{:run ".circleci/script/deploy"}
|
||||||
|
{:save_cache {:paths ["~/.m2"]
|
||||||
|
:key "v1-dependencies-{{ checksum \"project.clj\" }}"}}]))))
|
||||||
|
|
||||||
|
(defn docker
|
||||||
|
[shorted?]
|
||||||
|
(gen-job
|
||||||
|
shorted?
|
||||||
|
(ordered-map
|
||||||
|
:machine {:image "ubuntu-2004:202111-01"}
|
||||||
|
:steps
|
||||||
|
(gen-steps
|
||||||
|
shorted?
|
||||||
|
[:checkout
|
||||||
|
(pull-submodules)
|
||||||
|
"setup-docker-buildx"
|
||||||
|
{:attach_workspace {:at "/tmp"}}
|
||||||
|
(run "Build uberjar" "script/uberjar")
|
||||||
|
{:run
|
||||||
|
{:name "Build Docker image"
|
||||||
|
:environment {:PLATFORMS "linux/amd64,linux/arm64"}
|
||||||
|
:command
|
||||||
|
"java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj"}}]))))
|
||||||
|
|
||||||
|
(defn jvm
|
||||||
|
[shorted?]
|
||||||
|
(gen-job
|
||||||
|
shorted?
|
||||||
|
(ordered-map
|
||||||
|
:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]
|
||||||
|
:working_directory "~/repo"
|
||||||
|
:environment {:LEIN_ROOT "true"
|
||||||
|
:BABASHKA_PLATFORM "linux"}
|
||||||
|
:resource_class "large"
|
||||||
|
:steps
|
||||||
|
(gen-steps
|
||||||
|
shorted?
|
||||||
|
[:checkout
|
||||||
|
(pull-submodules)
|
||||||
|
{:restore_cache {:keys ["v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"
|
||||||
|
"v1-dependencies-"]}}
|
||||||
|
(run "Install Clojure" "sudo script/install-clojure")
|
||||||
|
(run
|
||||||
|
"Run JVM tests"
|
||||||
|
"export BABASHKA_FEATURE_JDBC=true
|
||||||
|
export BABASHKA_FEATURE_POSTGRESQL=true
|
||||||
|
script/test\nscript/run_lib_tests")
|
||||||
|
(run "Run as lein command" ".circleci/script/lein")
|
||||||
|
(run
|
||||||
|
"Create uberjar"
|
||||||
|
"mkdir -p /tmp/release
|
||||||
|
script/uberjar
|
||||||
|
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||||
|
jar=target/babashka-$VERSION-standalone.jar
|
||||||
|
cp $jar /tmp/release
|
||||||
|
java -jar $jar script/reflection.clj
|
||||||
|
reflection=\"babashka-$VERSION-reflection.json\"
|
||||||
|
java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$jar\"
|
||||||
|
java -jar \"$jar\" --config .build/bb.edn --deps-root . release-artifact \"$reflection\"")
|
||||||
|
{:store_artifacts {:path "/tmp/release"
|
||||||
|
:destination "release"}}
|
||||||
|
{:save_cache {:paths ["~/.m2"]
|
||||||
|
:key "v1-dependencies-{{ checksum \"project.clj\" }}-{{ checksum \"deps.edn\" }}"}}]))))
|
||||||
|
|
||||||
|
(defn unix
|
||||||
|
[shorted? static? musl? arch executor-conf resource-class graalvm-home platform]
|
||||||
|
(let [env {:LEIN_ROOT "true"
|
||||||
|
:GRAALVM_VERSION "22.2.0"
|
||||||
|
:GRAALVM_HOME graalvm-home
|
||||||
|
:BABASHKA_PLATFORM (if (= "mac" platform)
|
||||||
|
"macos"
|
||||||
|
platform)
|
||||||
|
:BABASHKA_TEST_ENV "native"
|
||||||
|
:BABASHKA_XMX "-J-Xmx6500m"}
|
||||||
|
env (if (= "aarch64" arch)
|
||||||
|
(assoc env :BABASHKA_ARCH arch)
|
||||||
|
env)
|
||||||
|
env (if static?
|
||||||
|
(assoc env :BABASHKA_STATIC "true")
|
||||||
|
env)
|
||||||
|
env (if musl?
|
||||||
|
(assoc env :BABASHKA_MUSL "true")
|
||||||
|
env)
|
||||||
|
env (if (= "mac" platform)
|
||||||
|
(assoc env :MACOSX_DEPLOYMENT_TARGET 10.13)
|
||||||
|
env)
|
||||||
|
base-install-cmd "sudo apt-get update\nsudo apt-get -y install build-essential zlib1g-dev"
|
||||||
|
cache-key (format "%s-%s{{ checksum \"project.clj\" }}-{{ checksum \".circleci/config.yml\" }}"
|
||||||
|
platform
|
||||||
|
(if (= "aarch64" arch)
|
||||||
|
"aarch64-"
|
||||||
|
""))]
|
||||||
|
(gen-job shorted?
|
||||||
|
(merge
|
||||||
|
executor-conf
|
||||||
|
(ordered-map
|
||||||
|
:working_directory "~/repo"
|
||||||
|
:environment env
|
||||||
|
:resource_class resource-class
|
||||||
|
:steps (gen-steps shorted?
|
||||||
|
(filter some?
|
||||||
|
[:checkout
|
||||||
|
{:attach_workspace {:at "/tmp"}}
|
||||||
|
(run "Pull Submodules" "git submodule init\ngit submodule update")
|
||||||
|
{:restore_cache
|
||||||
|
{:keys [cache-key]}}
|
||||||
|
(run "Install Clojure" "sudo script/install-clojure")
|
||||||
|
(when (= "mac" platform)
|
||||||
|
(run "Install Leiningen" "script/install-leiningen"))
|
||||||
|
(when (not= "mac" platform)
|
||||||
|
(run "Install native dev tools"
|
||||||
|
(if (and static? musl? (not= "aarch64" arch))
|
||||||
|
(str base-install-cmd "\nsudo -E script/setup-musl")
|
||||||
|
base-install-cmd)))
|
||||||
|
(run "Download GraalVM" "script/install-graalvm")
|
||||||
|
(run "Build binary" "script/uberjar\nscript/compile" "30m")
|
||||||
|
(run "Run tests" "script/test\nscript/run_lib_tests")
|
||||||
|
(run "Release" ".circleci/script/release")
|
||||||
|
{:persist_to_workspace {:root "/tmp"
|
||||||
|
:paths ["release"]}}
|
||||||
|
{:save_cache
|
||||||
|
{:paths ["~/.m2" "~/graalvm-ce-java11-22.2.0"]
|
||||||
|
:key cache-key}}
|
||||||
|
{:store_artifacts {:path "/tmp/release"
|
||||||
|
:destination "release"}}
|
||||||
|
(run "Publish artifact link to Slack"
|
||||||
|
"./bb .circleci/script/publish_artifact.clj || true")])))))))
|
||||||
|
|
||||||
|
(defn make-config
|
||||||
|
[shorted?]
|
||||||
|
(let [docker-executor-conf {:docker [{:image "circleci/clojure:openjdk-11-lein-2.9.8-bullseye"}]}
|
||||||
|
machine-executor-conf {:machine {:image "ubuntu-2004:202111-01"}}
|
||||||
|
mac-executor-conf {:macos {:xcode "14.0.0"}}
|
||||||
|
linux-graalvm-home "/home/circleci/graalvm-ce-java11-22.2.0"
|
||||||
|
mac-graalvm-home "/Users/distiller/graalvm-ce-java11-22.2.0/Contents/Home"]
|
||||||
|
(ordered-map
|
||||||
|
:version 2.1
|
||||||
|
:commands
|
||||||
|
{:setup-docker-buildx
|
||||||
|
{:steps
|
||||||
|
[{:run
|
||||||
|
{:name "Create multi-platform capabale buildx builder"
|
||||||
|
:command
|
||||||
|
"docker run --privileged --rm tonistiigi/binfmt --install all\ndocker buildx create --name ci-builder --use"}}]}}
|
||||||
|
:jobs (ordered-map
|
||||||
|
:jvm (jvm shorted?)
|
||||||
|
:linux (unix shorted? false false "amd64" docker-executor-conf "large" linux-graalvm-home "linux")
|
||||||
|
:linux-static
|
||||||
|
(unix shorted? true true "amd64" docker-executor-conf "large" linux-graalvm-home "linux")
|
||||||
|
:linux-aarch64 (unix shorted?
|
||||||
|
false
|
||||||
|
false
|
||||||
|
"aarch64"
|
||||||
|
machine-executor-conf
|
||||||
|
"arm.large"
|
||||||
|
linux-graalvm-home
|
||||||
|
"linux")
|
||||||
|
:linux-aarch64-static
|
||||||
|
(unix shorted? true false "aarch64" machine-executor-conf "arm.large" linux-graalvm-home "linux")
|
||||||
|
:mac (unix shorted? false false "amd64" mac-executor-conf "large" mac-graalvm-home "mac")
|
||||||
|
:deploy (deploy shorted?)
|
||||||
|
:docker (docker shorted?))
|
||||||
|
:workflows (ordered-map
|
||||||
|
:version 2
|
||||||
|
:ci {:jobs ["jvm"
|
||||||
|
"linux"
|
||||||
|
"linux-static"
|
||||||
|
"mac"
|
||||||
|
"linux-aarch64"
|
||||||
|
"linux-aarch64-static"
|
||||||
|
{:deploy {:filters {:branches {:only "master"}}
|
||||||
|
:requires ["jvm" "linux"]}}
|
||||||
|
{:docker {:filters {:branches {:only "master"}}
|
||||||
|
:requires ["linux" "linux-static" "linux-aarch64"]}}]}))))
|
||||||
|
|
||||||
|
(def skip-config
|
||||||
|
{:skip-if-only [#".*.md$"
|
||||||
|
#"^logo\/.*$"]})
|
||||||
|
|
||||||
|
(defn get-changes
|
||||||
|
[]
|
||||||
|
(-> (tasks/shell {:out :string} "git diff --name-only HEAD~1")
|
||||||
|
(:out)
|
||||||
|
(str/split-lines)))
|
||||||
|
|
||||||
|
(defn irrelevant-change?
|
||||||
|
[change regexes]
|
||||||
|
(some? (some #(re-matches % change) regexes)))
|
||||||
|
|
||||||
|
(defn relevant?
|
||||||
|
[change-set regexes]
|
||||||
|
(some? (some #(not (irrelevant-change? % regexes)) change-set)))
|
||||||
|
|
||||||
|
(defn main
|
||||||
|
[]
|
||||||
|
(let [{:keys [skip-if-only]} skip-config
|
||||||
|
changed-files (get-changes)
|
||||||
|
conf (make-config (not (relevant? changed-files skip-if-only)))]
|
||||||
|
(println (yaml/generate-string conf
|
||||||
|
:dumper-options
|
||||||
|
{:flow-style :block}))))
|
||||||
|
|
||||||
|
(when (= *file* (System/getProperty "babashka.file"))
|
||||||
|
(main))
|
||||||
|
|
||||||
|
(comment
|
||||||
|
(main)
|
||||||
|
|
||||||
|
(def regexes
|
||||||
|
[#".*.md$"
|
||||||
|
#".*.clj$" ; ignore clojure files
|
||||||
|
#"^logo\/.*$"])
|
||||||
|
|
||||||
|
(:out (tasks/shell {:out :string} "ls"))
|
||||||
|
|
||||||
|
(irrelevant-change? "src/file.png" regexes)
|
||||||
|
|
||||||
|
(re-matches #".*.clj$" "src/file.clj.dfff")
|
||||||
|
|
||||||
|
(re-matches #"^logo\/.*$" "logo/foo/bar.jpg")
|
||||||
|
|
||||||
|
(relevant? ["src/file.clj"] regexes))
|
||||||
10
.cirrus.yml
10
.cirrus.yml
|
|
@ -5,8 +5,8 @@ task:
|
||||||
skip: "changesIncludeOnly('logo/*', '**.md')"
|
skip: "changesIncludeOnly('logo/*', '**.md')"
|
||||||
env:
|
env:
|
||||||
LEIN_ROOT: "true"
|
LEIN_ROOT: "true"
|
||||||
GRAALVM_VERSION: "24"
|
GRAALVM_VERSION: "22.2.0"
|
||||||
GRAALVM_HOME: ${HOME}/graalvm-${GRAALVM_VERSION}/Contents/Home
|
GRAALVM_HOME: ${HOME}/graalvm-ce-java11-22.2.0/Contents/Home
|
||||||
BABASHKA_PLATFORM: macos # used in release script
|
BABASHKA_PLATFORM: macos # used in release script
|
||||||
BABASHKA_ARCH: aarch64
|
BABASHKA_ARCH: aarch64
|
||||||
BABASHKA_TEST_ENV: native
|
BABASHKA_TEST_ENV: native
|
||||||
|
|
@ -20,15 +20,11 @@ task:
|
||||||
sudo script/install-leiningen
|
sudo script/install-leiningen
|
||||||
script/install-graalvm
|
script/install-graalvm
|
||||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||||
export JAVA_HOME=$GRAALVM_HOME
|
|
||||||
sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
||||||
java -version
|
java -version
|
||||||
|
|
||||||
export BABASHKA_SHA=$(git rev-parse HEAD)
|
|
||||||
|
|
||||||
script/uberjar
|
script/uberjar
|
||||||
# curl -sLO 'https://github.com/babashka/pgo-profiles/releases/download/2023.10.11/default.iprof'
|
script/compile
|
||||||
script/compile # --pgo=default.iprof
|
|
||||||
|
|
||||||
# script/test
|
# script/test
|
||||||
# script/run_lib_tests
|
# script/run_lib_tests
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,4 @@
|
||||||
babashka.impl.File/gen-wrapper-fn-2 clojure.core/def
|
babashka.impl.File/gen-wrapper-fn-2 clojure.core/def
|
||||||
babashka.impl.Pattern/gen-wrapper-fn-2 clojure.core/def
|
babashka.impl.Pattern/gen-wrapper-fn-2 clojure.core/def
|
||||||
babashka.impl.Pattern/gen-constants clojure.core/declare}
|
babashka.impl.Pattern/gen-constants clojure.core/declare}
|
||||||
:linters {:unsorted-required-namespaces {:level :warning}}
|
:linters {:unsorted-required-namespaces {:level :warning}}}
|
||||||
:hooks {:analyze-call {clojure.core/requiring-resolve hooks.mine/req-resolve}}}
|
|
||||||
|
|
|
||||||
99
.github/workflows/build-windows.yml
vendored
99
.github/workflows/build-windows.yml
vendored
|
|
@ -1,99 +0,0 @@
|
||||||
name: build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- "**.md"
|
|
||||||
- "logo/**"
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- "**.md"
|
|
||||||
- "logo/**"
|
|
||||||
|
|
||||||
# TODO: Add deploy if needed
|
|
||||||
jobs:
|
|
||||||
native:
|
|
||||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: windows-2022
|
|
||||||
name: windows
|
|
||||||
static: false
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
env:
|
|
||||||
LEIN_ROOT: "true"
|
|
||||||
GRAALVM_VERSION: "24"
|
|
||||||
BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script
|
|
||||||
BABASHKA_TEST_ENV: native
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
BABASHKA_SHA: ${{ github.sha }}
|
|
||||||
steps:
|
|
||||||
- name: Git checkout
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
submodules: 'true'
|
|
||||||
|
|
||||||
- name: Cache deps
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: cache-deps
|
|
||||||
with:
|
|
||||||
path: ~/.m2/repository
|
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
|
||||||
restore-keys: ${{ runner.os }}-maven-
|
|
||||||
|
|
||||||
- name: Setup GraalVM
|
|
||||||
if: "matrix.static == false"
|
|
||||||
uses: graalvm/setup-graalvm@v1.3.3
|
|
||||||
with:
|
|
||||||
java-version: '24'
|
|
||||||
distribution: 'graalvm'
|
|
||||||
components: 'native-image'
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Install clojure tools
|
|
||||||
uses: DeLaGuardo/setup-clojure@13.2
|
|
||||||
with:
|
|
||||||
cli: latest
|
|
||||||
# lein: latest -- skipped because this uses some PS bullshit
|
|
||||||
|
|
||||||
- name: Babashka version
|
|
||||||
id: babashka-version
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
|
||||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat', 'lein.bat')"
|
|
||||||
call lein self-install
|
|
||||||
|
|
||||||
set GRAALVM_HOME=%JAVA_HOME%
|
|
||||||
call script/uberjar.bat
|
|
||||||
|
|
||||||
call script/compile.bat
|
|
||||||
|
|
||||||
echo Creating zip archive
|
|
||||||
|
|
||||||
set zip=babashka-%BABASHKA_VERSION%-windows-amd64.zip
|
|
||||||
|
|
||||||
jar -cMf %zip% bb.exe
|
|
||||||
|
|
||||||
bb --config .build/bb.edn --deps-root . release-artifact %zip%
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
path: bb.exe
|
|
||||||
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64
|
|
||||||
|
|
||||||
- name: Test binary and libs
|
|
||||||
shell: cmd
|
|
||||||
run: |
|
|
||||||
set BABASHKA_CLASSPATH=
|
|
||||||
set BABASHKA_TEST_ENV=native
|
|
||||||
call script/test.bat :windows
|
|
||||||
call script/run_lib_tests.bat
|
|
||||||
55
.github/workflows/build.yml
vendored
55
.github/workflows/build.yml
vendored
|
|
@ -24,7 +24,6 @@ jobs:
|
||||||
LEIN_ROOT: "true"
|
LEIN_ROOT: "true"
|
||||||
BABASHKA_PLATFORM: linux # could be used in jar name
|
BABASHKA_PLATFORM: linux # could be used in jar name
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
BABASHKA_SHA: ${{ github.sha }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
@ -33,7 +32,7 @@ jobs:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- name: Cache deps
|
- name: Cache deps
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v2
|
||||||
id: cache-deps
|
id: cache-deps
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
|
|
@ -44,7 +43,7 @@ jobs:
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: 'adopt-hotspot'
|
distribution: 'adopt-hotspot'
|
||||||
java-version: '19'
|
java-version: '11'
|
||||||
|
|
||||||
- name: Install clojure tools
|
- name: Install clojure tools
|
||||||
uses: DeLaGuardo/setup-clojure@5.0
|
uses: DeLaGuardo/setup-clojure@5.0
|
||||||
|
|
@ -60,6 +59,9 @@ jobs:
|
||||||
script/test
|
script/test
|
||||||
script/run_lib_tests
|
script/run_lib_tests
|
||||||
|
|
||||||
|
- name: Run as lein command
|
||||||
|
run: echo '{:a 1}' | lein bb '(:a *in*)'
|
||||||
|
|
||||||
- name: Build uberjar
|
- name: Build uberjar
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /tmp/release
|
mkdir -p /tmp/release
|
||||||
|
|
@ -78,7 +80,7 @@ jobs:
|
||||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v1
|
||||||
with:
|
with:
|
||||||
name: babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
name: babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||||
path: target/babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
path: target/babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||||
|
|
@ -88,7 +90,7 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: macos-13
|
- os: macos-12
|
||||||
name: macos
|
name: macos
|
||||||
static: false
|
static: false
|
||||||
#- os: ubuntu-latest
|
#- os: ubuntu-latest
|
||||||
|
|
@ -100,12 +102,11 @@ jobs:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
LEIN_ROOT: "true"
|
LEIN_ROOT: "true"
|
||||||
GRAALVM_VERSION: "24"
|
GRAALVM_VERSION: "22.2.0"
|
||||||
BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script
|
BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script
|
||||||
BABASHKA_TEST_ENV: native
|
BABASHKA_TEST_ENV: native
|
||||||
BABASHKA_XMX: "-J-Xmx6500m"
|
BABASHKA_XMX: "-J-Xmx6500m"
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
BABASHKA_SHA: ${{ github.sha }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
@ -114,7 +115,7 @@ jobs:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
|
|
||||||
- name: Cache deps
|
- name: Cache deps
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v2
|
||||||
id: cache-deps
|
id: cache-deps
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
|
|
@ -125,8 +126,8 @@ jobs:
|
||||||
if: "matrix.static == false"
|
if: "matrix.static == false"
|
||||||
uses: graalvm/setup-graalvm@v1
|
uses: graalvm/setup-graalvm@v1
|
||||||
with:
|
with:
|
||||||
java-version: '24'
|
version: '22.2.0'
|
||||||
distribution: 'graalvm'
|
java-version: '11'
|
||||||
components: 'native-image'
|
components: 'native-image'
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
@ -134,8 +135,8 @@ jobs:
|
||||||
if: "matrix.static == true"
|
if: "matrix.static == true"
|
||||||
uses: graalvm/setup-graalvm@v1
|
uses: graalvm/setup-graalvm@v1
|
||||||
with:
|
with:
|
||||||
version: '24'
|
version: '22.2.0'
|
||||||
distribution: 'graalvm'
|
java-version: '11'
|
||||||
components: 'native-image'
|
components: 'native-image'
|
||||||
native-image-musl: true
|
native-image-musl: true
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
@ -172,19 +173,6 @@ jobs:
|
||||||
BABASHKA_MUSL: "true"
|
BABASHKA_MUSL: "true"
|
||||||
run: script/compile
|
run: script/compile
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
path: bb
|
|
||||||
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64
|
|
||||||
|
|
||||||
- name: Upload static artifact
|
|
||||||
if: "matrix.static == true"
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
path: bb
|
|
||||||
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-static-amd64
|
|
||||||
|
|
||||||
- name: Test binary and libs
|
- name: Test binary and libs
|
||||||
run: |
|
run: |
|
||||||
script/test
|
script/test
|
||||||
|
|
@ -193,6 +181,19 @@ jobs:
|
||||||
- name: Release
|
- name: Release
|
||||||
run: .circleci/script/release
|
run: .circleci/script/release
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: bb
|
||||||
|
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-amd64
|
||||||
|
|
||||||
|
- name: Upload static artifact
|
||||||
|
if: "matrix.static == true"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
path: bb
|
||||||
|
name: babashka-${{ steps.babashka-version.outputs.version }}-${{ matrix.name }}-static-amd64
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
if: ${{ false }} # Disabled
|
if: ${{ false }} # Disabled
|
||||||
# if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
|
# if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
|
||||||
|
|
@ -216,13 +217,13 @@ jobs:
|
||||||
run: mkdir -p /tmp/release
|
run: mkdir -p /tmp/release
|
||||||
|
|
||||||
- name: Download linux binary
|
- name: Download linux binary
|
||||||
uses: actions/download-artifact@v4.1.7
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip
|
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip
|
||||||
path: /tmp/release
|
path: /tmp/release
|
||||||
|
|
||||||
- name: Download static linux binary
|
- name: Download static linux binary
|
||||||
uses: actions/download-artifact@v4.1.7
|
uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip
|
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip
|
||||||
path: /tmp/release-static
|
path: /tmp/release-static
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -36,6 +36,3 @@ bb.build_artifacts.txt
|
||||||
target
|
target
|
||||||
.nrepl-port
|
.nrepl-port
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.portal
|
|
||||||
default.iprof
|
|
||||||
scratch.clj
|
|
||||||
|
|
|
||||||
492
CHANGELOG.md
492
CHANGELOG.md
|
|
@ -5,490 +5,12 @@ For a list of breaking changes, check [here](#breaking-changes).
|
||||||
A preview of the next release can be installed from
|
A preview of the next release can be installed from
|
||||||
[babashka-dev-builds](https://github.com/babashka/babashka-dev-builds).
|
[babashka-dev-builds](https://github.com/babashka/babashka-dev-builds).
|
||||||
|
|
||||||
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
- [#1818](https://github.com/babashka/babashka/issues/1818): wrong argument order in `clojure.java.io/resource` implementation
|
|
||||||
- Add `java.text.BreakIterator`
|
|
||||||
- Bump `fs` to `0.5.25`
|
|
||||||
- Bump `jsoup` to `1.20.1`
|
|
||||||
- Bump `edamame` to `1.4.30`
|
|
||||||
- [#1815](https://github.com/babashka/babashka/issues/1815): Make install-script wget-compatible ([@eval](https://github.com/eval))
|
|
||||||
|
|
||||||
|
|
||||||
## 1.12.200 (2025-04-26)
|
|
||||||
|
|
||||||
- Improve Java reflection based on provided type hints (read blog post [here](https://blog.michielborkent.nl/babashka-java-reflection-type-hints.html))
|
|
||||||
- Add compatibility with the [fusebox](https://github.com/potetm/fusebox) library
|
|
||||||
- Fix virtual `ThreadBuilder` interop
|
|
||||||
- Add `java.util.concurrent.ThreadLocalRandom`
|
|
||||||
- Add `java.util.concurrent.locks.ReentrantLock`
|
|
||||||
- Add classes:
|
|
||||||
- `java.time.chrono.ChronoLocalDate`
|
|
||||||
- `java.time.temporal.TemporalUnit`
|
|
||||||
- `java.time.chrono.ChronoLocalDateTime`
|
|
||||||
- `java.time.chrono.ChronoZonedDateTime`
|
|
||||||
- `java.time.chrono.Chronology`
|
|
||||||
|
|
||||||
## 1.12.199 (2025-04-18)
|
|
||||||
|
|
||||||
- [#1806](https://github.com/babashka/babashka/issues/1806): Add `cheshire.factory` namespace ([@lread](https://github.com/lread))
|
|
||||||
|
|
||||||
## 1.12.198 (2025-04-17)
|
|
||||||
|
|
||||||
- Bump GraalVM to `24`
|
|
||||||
- Bump SCI to `0.9.45`
|
|
||||||
- Bump edamame to `1.4.28`
|
|
||||||
- [#1801](https://github.com/babashka/babashka/issues/1801): Add `java.util.regex.PatternSyntaxException`
|
|
||||||
- Bump core.async to `1.8.735`
|
|
||||||
- Bump cheshire to `6.0.0`
|
|
||||||
- Bump babashka.cli to `0.8.65`
|
|
||||||
|
|
||||||
## 1.12.197 (2025-02-28)
|
|
||||||
|
|
||||||
- [#1785](https://github.com/babashka/babashka/issues/1785): Allow subclasses of `Throwable` to have instance methods invoked ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1791](https://github.com/babashka/babashka/issues/1791): interop problem on Jsoup form element
|
|
||||||
- [#1793](https://github.com/babashka/babashka/issues/1793): Bump `rewrite-clj` to `1.1.49` (fixes parsing of `foo//` among other things)
|
|
||||||
- Bump `deps.clj`
|
|
||||||
- Bump `fs`
|
|
||||||
|
|
||||||
## 1.12.196 (2024-12-24)
|
|
||||||
|
|
||||||
- [#1771](https://github.com/babashka/babashka/issues/1771): `*e*` in REPL should contain exception thrown by user, not a wrapped one
|
|
||||||
- [#1777](https://github.com/babashka/babashka/issues/1777) Add `java.nio.file.attribute.UserDefinedFileAttributeView`
|
|
||||||
- [#1776](https://github.com/babashka/babashka/issues/1776) `Add java.nio.file.attribute.PosixFileAttributes`
|
|
||||||
- [#1761](https://github.com/babashka/babashka/issues/1761) Support calling `clojure.lang.RT/iter`
|
|
||||||
- [#1760](https://github.com/babashka/babashka/issues/1760) For compatibility with [Fireworks v0.10.3](https://github.com/paintparty/fireworks), added the following to `:instance-checks` entry in `babashka.impl.classes/classes`([@paintparty](https://github.com/paintparty))
|
|
||||||
- `clojure.lang.PersistentArrayMap$TransientArrayMap`
|
|
||||||
- `clojure.lang.PersistentHashMap$TransientHashMap`
|
|
||||||
- `clojure.lang.PersistentVector$TransientVector`
|
|
||||||
- `java.lang.NoSuchFieldException`
|
|
||||||
- `java.util.AbstractMap`
|
|
||||||
- `java.util.AbstractSet`
|
|
||||||
- `java.util.AbstractList`
|
|
||||||
- [#1760](https://github.com/babashka/babashka/issues/1760) For compatibility with [Fireworks v0.10.3](https://github.com/paintparty/fireworks), added `volatile?` entry to `babashka.impl.clojure.core/core-extras`([@paintparty](https://github.com/paintparty))
|
|
||||||
- Bump `babashka.cli` to `0.8.61`
|
|
||||||
- Bump `clj-yaml` to `1.0.29`
|
|
||||||
- [#1768](https://github.com/babashka/babashka/issues/1768): Add `taoensso.timbre` `color-str` function
|
|
||||||
- Add classes:
|
|
||||||
- `javax.crypto.KeyAgreement`
|
|
||||||
- `java.security.KeyPairGenerator`
|
|
||||||
- `java.security.KeyPair`
|
|
||||||
- `java.security.spec.ECGenParameterSpec`
|
|
||||||
- `java.security.spec.PKCS8EncodedKeySpec`
|
|
||||||
- `java.security.spec.X509EncodedKeySpec`
|
|
||||||
- `java.security.Signature`
|
|
||||||
- Add `java.util.concurrent.CompletionStage`
|
|
||||||
- Bump `core.async` to `1.7.701`
|
|
||||||
- Bump `org.babashka/cli` to `0.8.162`
|
|
||||||
|
|
||||||
## 1.12.195 (2024-11-12)
|
|
||||||
|
|
||||||
- Include [jsoup](https://jsoup.org/) for HTML parsing. This makes bb compatible with the [hickory](https://github.com/clj-commons/hickory) library (and possibly other libraries?).
|
|
||||||
- [#1752](https://github.com/babashka/babashka/issues/1752): include `java.lang.SecurityException` for `java.net.http.HttpClient` support ([@grzm](https://github.com/grzm))
|
|
||||||
- [#1748](https://github.com/babashka/babashka/issues/1748): add `clojure.core/ensure`
|
|
||||||
- Upgrade `taoensso/timbre`to `v6.6.0`
|
|
||||||
- Upgrade `babashka.http-client` to `v0.4.22`
|
|
||||||
- Add `:git/sha` from build to `bb describe` output ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- Fix NPE with determining if executing from self-contained executable
|
|
||||||
|
|
||||||
## 1.12.194 (2024-10-12)
|
|
||||||
|
|
||||||
- Upgrade to GraalVM 23
|
|
||||||
- [#1743](https://github.com/babashka/babashka/issues/1743): fix new fully qualified instance method in call position with GraalVM 23
|
|
||||||
|
|
||||||
## 1.12.193 (2024-10-11)
|
|
||||||
|
|
||||||
- Clojure 1.12 interop: method thunks, FI coercion, array notation (see below)
|
|
||||||
- Upgrade SCI reflector based on clojure 1.12 and remove specific workaround for
|
|
||||||
`Thread/sleep` interop
|
|
||||||
- Add `tools.reader.edn/read`
|
|
||||||
- Fix [#1741](https://github.com/babashka/babashka/issues/1741): `(taoensso.timbre/spy)` now relies on macros from `taoensso.encore` previously not available in bb
|
|
||||||
|
|
||||||
Examples of the new Clojure interop:
|
|
||||||
|
|
||||||
``` clojure
|
|
||||||
;; Qualified methods in call position:
|
|
||||||
(String/.length "123") ;;=> 3
|
|
||||||
(String/new "123") ;;=> "123"
|
|
||||||
|
|
||||||
;; Qualified methods in value position, as functions:
|
|
||||||
(map Integer/parseInt ["1" "22" "333"]) ;;=> (1 22 333)
|
|
||||||
(map String/.length ["1" "22" "333"]) ;;=> (1 2 3)
|
|
||||||
(map String/new ["1" "22" "333"]) ;;=> ("1" "22" "333")
|
|
||||||
|
|
||||||
;; Typed multi-dimensional array class notation:
|
|
||||||
long/1 ;;=> 1-dimensional long array class
|
|
||||||
String/2 ;;=> 2-dimensional String array class
|
|
||||||
|
|
||||||
;; Pass Clojure IFn to Java where `java.util.function.Predicate`, etc. is expected:
|
|
||||||
(into [] (doto (java.util.ArrayList. [1 2 3]) (.removeIf even?))) ;;=> [1 3]
|
|
||||||
(.computeIfAbsent (java.util.HashMap.) "abc" #(str % %)) ;;=> "abcabc"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 1.4.192 (2024-09-12)
|
|
||||||
|
|
||||||
- Upgrade Clojure to `1.12.0`
|
|
||||||
- [#1722](https://github.com/babashka/babashka/issues/1722): add new clojure 1.12 vars
|
|
||||||
- [#1720](https://github.com/babashka/babashka/issues/1720): include new clojure 1.12's `clojure.java.process`
|
|
||||||
- [#1719](https://github.com/babashka/babashka/issues/1719): add new clojure 1.12 `clojure.repl.deps` namespace. Only calls with explicit versions are supported.
|
|
||||||
- [#1598](https://github.com/babashka/babashka/issues/1598): use Rosetta on CircleCI to build x64 images
|
|
||||||
- [#1716](https://github.com/babashka/babashka/issues/1716): expose `babashka.http-client.interceptors` namespace
|
|
||||||
- [#1707](https://github.com/babashka/babashka/issues/1707): support `aset` on primitive array
|
|
||||||
- [#1676](https://github.com/babashka/babashka/issues/1676): restore compatibility with newest [at-at](https://github.com/overtone/at-at/) version (1.3.58)
|
|
||||||
- Bump SCI
|
|
||||||
- Bump `fs`
|
|
||||||
- Bump `process`
|
|
||||||
- Bump `deps.clj`
|
|
||||||
- Bump `http-client`
|
|
||||||
- Bump `clj-yaml`
|
|
||||||
- Bump `edamame`
|
|
||||||
- Bump `rewrite-clj`
|
|
||||||
- Add `java.io.LineNumberReader`
|
|
||||||
|
|
||||||
## 1.3.191 (2024-06-19)
|
|
||||||
|
|
||||||
- Fix [#1688](https://github.com/babashka/babashka/issues/1688): `use-fixtures` should add metadata to `*ns*`
|
|
||||||
- Fix [#1692](https://github.com/babashka/babashka/issues/1692): Add support for `ITransientSet` and `org.flatland/ordered-set`
|
|
||||||
- Bump org.flatland/ordered to `1.15.12`.
|
|
||||||
- Partially Fix [#1695](https://github.com/babashka/babashka/issues/1695): `--repl` arg handling should consume only one arg (itself) ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Partially Fix [#1695](https://github.com/babashka/babashka/issues/1695): make `*command-line-args*` value available in the REPL ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Fix [#1686](https://github.com/babashka/babashka/issues/1686): do not fetch dependencies/invoke java for `version`, `help`, and `describe` options ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1696](https://github.com/babashka/babashka/issues/1696): add `clojure.lang.DynamicClassLoader` constructors ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1696](https://github.com/babashka/babashka/issues/1696): add `clojure.core/*source-path*` (points to the same sci var as `*file*`) ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1696](https://github.com/babashka/babashka/issues/1696): add `clojure.main/with-read-known` ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1696](https://github.com/babashka/babashka/issues/1696): add `clojure.core.server/repl-read` ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1696](https://github.com/babashka/babashka/issues/1696): make the `cognitect-labs/transcriptor` library work ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1700](https://github.com/babashka/babashka/issues/1700): catch exceptions from resolving symbolic links during `bb.edn` lookup ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Support `java.nio.channels.ByteChannel` + several other related interop
|
|
||||||
- Bump `nrepl/bencode` to `1.2.0`
|
|
||||||
- Bump `babashka/fs`
|
|
||||||
- Bump `org.babashka/http-client` to `0.4.18`
|
|
||||||
|
|
||||||
## 1.3.190 (2024-04-17)
|
|
||||||
|
|
||||||
- Fix [#1679](https://github.com/babashka/babashka/issues/1679): bump timbre and fix wrapping `timbre/log!`
|
|
||||||
- Add `java.util.concurrent.CountDownLatch`
|
|
||||||
- Add `java.lang.ThreadLocal`
|
|
||||||
- Bump `babashka.process`
|
|
||||||
- Bump httpkit to `2.8.0-RC1`
|
|
||||||
- Bump clojure to `1.11.2`
|
|
||||||
- Bump deps.clj
|
|
||||||
- Bump `babashka.cli`
|
|
||||||
- Bump `cheshire` to `5.13.0`
|
|
||||||
- Bump `http-client` to `0.4.17`
|
|
||||||
|
|
||||||
## 1.3.189 (2024-02-22)
|
|
||||||
|
|
||||||
- [#1660](https://github.com/babashka/babashka/issues/1660): add `:deps-root` as part of hash to avoid caching issue with `deps.clj`
|
|
||||||
- [#1632](https://github.com/babashka/babashka/issues/1632): fix `(.readPassword (System/console))` by upgrading GraalVM to `21.0.2`
|
|
||||||
- [#1661](https://github.com/babashka/babashka/issues/1661): follow symlink when reading adjacent bb.edn
|
|
||||||
- [#1665](https://github.com/babashka/babashka/issues/1665): `read-string` should use non-indexing reader for compatibilty with Clojure
|
|
||||||
- Bump edamame to 1.4.24
|
|
||||||
- Bump http-client to 0.4.16
|
|
||||||
- Bump babashka.cli to 0.8.57
|
|
||||||
- Uberjar task: support reader conditional in .cljc file
|
|
||||||
- Support reader conditional in .cljc file when creating uberjar
|
|
||||||
- Add more `javax.net.ssl` classes
|
|
||||||
- [#1675](https://github.com/babashka/babashka/issues/1675): add `hash-unordered-coll`
|
|
||||||
|
|
||||||
## 1.3.188 (2024-01-12)
|
|
||||||
|
|
||||||
- [#1658](https://github.com/babashka/babashka/issues/1658): fix command line parsing for scripts that parse `--version` or `version` etc
|
|
||||||
|
|
||||||
## 1.3.187 (2024-01-09)
|
|
||||||
|
|
||||||
- Add `clojure.reflect/reflect`
|
|
||||||
- Add `java.util.ScheduledFuture`, `java.time.temporal.WeekFields`
|
|
||||||
- Support `Runnable` to be used without import
|
|
||||||
- Allow `catch` to be used as var name
|
|
||||||
- [#1646](https://github.com/babashka/babashka/issues/1646): command-line-args are dropped when file exists with same name
|
|
||||||
- [#1645](https://github.com/babashka/babashka/issues/1645): Support for `clojure.lang.LongRange`
|
|
||||||
- [#1652](https://github.com/babashka/babashka/issues/1652): allow `bb.edn` to be empty
|
|
||||||
- [#1586](https://github.com/babashka/babashka/issues/1586): warn when config file doesn't exist and `--debug` is enabled
|
|
||||||
- [#1410](https://github.com/babashka/babashka/issues/1410): better error message when exec fn doesn't exist
|
|
||||||
- Bump `babashka.cli` to `0.8.55` which contains subcommand improvements
|
|
||||||
- Bump `deps.clj` to `1.11.1.1435`
|
|
||||||
- Bump `babashka.fs` to `0.5.20`
|
|
||||||
- Compatibility with `plumbing.core`
|
|
||||||
- Compatibility with `shadow.css` by improving `tools.reader` compatibility
|
|
||||||
- [#1647](https://github.com/babashka/babashka/issues/1647): Allow capturing env vars at build time (only relevant for building bb)
|
|
||||||
|
|
||||||
## 1.3.186 (2023-11-02)
|
|
||||||
|
|
||||||
- [Support self-contained binaries as uberjars!](https://github.com/babashka/babashka/wiki/Self-contained-executable#uberjar)
|
|
||||||
- Add `java.security.KeyFactory`, `java.security.spec.PKCS8EncodedKeySpec`, `java.net.URISyntaxException`, `javax.crypto.spec.IvParameterSpec`
|
|
||||||
- Fix babashka.process/exec wrt `babashka.process/*defaults*`
|
|
||||||
- [#1632](https://github.com/babashka/babashka/issues/1632): Partial fix for `(.readPassword (System/console))`
|
|
||||||
- Enable producing self-contained binaries using [uberjars](https://github.com/babashka/babashka/wiki/Self-contained-executable#uberjar)
|
|
||||||
- Bump httpkit to `2.8.0-beta3` (fixes GraalVM issue with virtual threads)
|
|
||||||
- Bump `deps.clj` and `fs`
|
|
||||||
- Expose `taoensso.timbre.appenders.core`
|
|
||||||
- nREPL: implement `ns-list` op
|
|
||||||
- SCI: optimize `swap!`, `deref` and `reset!` for normal atoms (rather than user-created `IAtom`s)
|
|
||||||
- Add test for [#1639](https://github.com/babashka/babashka/issues/1639)
|
|
||||||
- Upgrade to GraalVM 21.0.1
|
|
||||||
|
|
||||||
## 1.3.185 (2023-09-28)
|
|
||||||
|
|
||||||
- [#1624](https://github.com/babashka/babashka/pull/1624): Use Oracle GraalVM 21 ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- Use PGO to speed up loops (now 2-3x faster for `(time (loop [val 0 cnt 10000000] (if (pos? cnt) (recur (inc val) (dec cnt)) val)))`!)
|
|
||||||
- Bump babashka.http-client to v0.4.15
|
|
||||||
- Bump rewrite-clj to v0.1.1.47
|
|
||||||
- [#1619](https://github.com/babashka/babashka/issues/1619): Fix reflection issue with `Thread/sleep` in `core.async/timeout`
|
|
||||||
- Support interop on `java.util.stream.IntStream`
|
|
||||||
- [#1513](https://github.com/babashka/babashka/issues/1513): Fix interop on `Thread/sleep` with numbers that aren't already longs
|
|
||||||
- Bump babashka.cli to 0.7.53
|
|
||||||
- Fix [#babashka.nrepl/66](https://github.com/babashka/babashka.nrepl/issues/66)
|
|
||||||
- Various nREPL server improvements (classpath op, file lookup information for `cider-find-var`)
|
|
||||||
- Bump cheshire to 5.12.0
|
|
||||||
|
|
||||||
## 1.3.184 (2023-08-22)
|
|
||||||
|
|
||||||
- Remove leftover debugging output from deps.clj
|
|
||||||
|
|
||||||
## 1.3.183 (2023-08-22)
|
|
||||||
|
|
||||||
- [#1592](https://github.com/babashka/babashka/issues/1592): expose `sci.core` in babashka
|
|
||||||
- [#1596](https://github.com/babashka/babashka/issues/1596): Fix `clojure.java.browse/browse-url` truncates URLs with multiple query parameters on Windows
|
|
||||||
- [#1599](https://github.com/babashka/babashka/issues/1599): propagate error from `run` when task does not exist
|
|
||||||
- Bump clj-yaml to `1.0.27`
|
|
||||||
- [#1604](https://github.com/babashka/babashka/issues/1604): throw `FileNotFoundException` when requiring namespace whose file cannot be found (as JVM Clojure does)
|
|
||||||
- Bump integrant CI tests
|
|
||||||
- [#1600](https://github.com/babashka/babashka/issues/1600): use pagesize of 64K on linux aarch64, so it works on Asahi linux
|
|
||||||
- Expose `selmer.parser/resolve-arg`
|
|
||||||
- [#1610](https://github.com/babashka/babashka/issues/1610): expose `babashka.http-client.websocket` namespace
|
|
||||||
- Bump `babashka.http-client` to `0.4.14`
|
|
||||||
- [#1568](https://github.com/babashka/babashka/issues/1568): warn when task overrides built-in command
|
|
||||||
|
|
||||||
## 1.3.182 (2023-07-20)
|
|
||||||
|
|
||||||
- [#1579](https://github.com/babashka/babashka/issues/1579): add `clojure.tools.reader/resolve-symbol`
|
|
||||||
- [#1581](https://github.com/babashka/babashka/issues/1581): `bb print-deps`: sort dependencies ([@teodorlu](https://github.com/teodorlu))
|
|
||||||
- Upgrade `babashka.http-client` to `0.4.12`, fixes `:insecure` option
|
|
||||||
- Bump [edamame](https://github.com/borkdude/edamame) to `1.3.23`: fixes infinite loop with reader conditional expression
|
|
||||||
- Bump [Selmer](https://github.com/yogthos/Selmer) to Bumping to `1.12.59`
|
|
||||||
- Bump [deps.clj](https://github.com/borkdude/deps.clj) with more fixes which should make downloading/installation of tools jar more robust
|
|
||||||
- Add `javax.net.ssl.X509ExtendedTrustManager` class
|
|
||||||
- Bump [babashka.process](https://github.com/babashka/process): accept path or file as `:dir` argument
|
|
||||||
- Bump [hiccup](https://github.com/weavejester/hiccup) to `2.0.0-RC1`
|
|
||||||
|
|
||||||
## 1.3.181 (2023-06-13)
|
|
||||||
|
|
||||||
- [#1575](https://github.com/babashka/babashka/issues/1575): fix command line parsing problem with `-e` + `*command-line-args*`
|
|
||||||
- [#1576](https://github.com/babashka/babashka/issues/1576): make downloading/unzipping of deps.clj tools .zip file more robust
|
|
||||||
|
|
||||||
## 1.3.180 (2023-05-28)
|
|
||||||
|
|
||||||
- [#1524](https://github.com/babashka/babashka/issues/1524): Remove dynamic builds for linux-aarch64 ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- [#1577](https://github.com/babashka/babashka/issues/1557): Add support for `babashka.process/exec` after namespace reload of `babashka.process` ([@lread](https://github.com/lread))
|
|
||||||
- [#1548](https://github.com/babashka/babashka/issues/1548): shell and sh should respect `babashka.process/*defaults*`
|
|
||||||
- [#1524](https://github.com/babashka/babashka/issues/1524): deprecate (remove) linux-aarch64 dynamic binary build
|
|
||||||
- Expose `org.graalvm.nativeimage.ProcessProperties/exec`
|
|
||||||
- Bump `babashka.http-client` to `0.3.11`
|
|
||||||
- Bump `babashka.fs` to `0.4.19`
|
|
||||||
- Bump `babashka.process` to `0.5.21`
|
|
||||||
|
|
||||||
## 1.3.179 (2023-04-26)
|
|
||||||
|
|
||||||
- [#1544](https://github.com/babashka/babashka/issues/1544): `:local/root` in script-adjacent bb.edn should resolve relative to script
|
|
||||||
- [#1545](https://github.com/babashka/babashka/issues/1545): Adjacent `bb.edn` not respected with explicit `-f` option
|
|
||||||
- [#1546](https://github.com/babashka/babashka/issues/1546): add `.contains` for vector and lazy-seq
|
|
||||||
|
|
||||||
## 1.3.178 (2023-04-21)
|
|
||||||
|
|
||||||
- Fix regression with [#1541](https://github.com/babashka/babashka/issues/1541)
|
|
||||||
|
|
||||||
## 1.3.177 (2023-04-21)
|
|
||||||
|
|
||||||
- [#1541](https://github.com/babashka/babashka/issues/1541): respect `bb.edn`
|
|
||||||
adjacent to invoked file. This eases writing system-global scripts from
|
|
||||||
projects without using bbin. See [docs](https://book.babashka.org/#_script_adjacent_bb_edn).
|
|
||||||
- [#1523](https://github.com/babashka/babashka/pull/1523): Reduce the size of the Docker images ([@raszi](https://github.com/raszi))
|
|
||||||
- Upgrade deps.clj to v1.11.1.1273
|
|
||||||
- Upgrade transit-clj to 1.0.333
|
|
||||||
- Add `java.security.cert.CertificateFactory`
|
|
||||||
- Bump clj-yaml to 1.0.26
|
|
||||||
- Bump edamame to 1.3.21
|
|
||||||
- Add `UnsupportedOperationException`
|
|
||||||
- Bump babashka CLI to 0.7.51
|
|
||||||
- Bump babashka http-client to 0.2.9
|
|
||||||
- Add `--install-exit-handlers` to native-image build to support shutdown hook + SIGTERM
|
|
||||||
|
|
||||||
## 1.3.176 (2023-03-18)
|
|
||||||
|
|
||||||
- Upgrade http-client to 0.1.8, fixes binary file uploads (which messed up the previous release)
|
|
||||||
- Downgrade org.flatland/ordered to 1.5.9 due to this [issue](https://github.com/clj-commons/ordered/issues/71)
|
|
||||||
|
|
||||||
## 1.3.175 (2023-03-18)
|
|
||||||
|
|
||||||
- [#1507](https://github.com/babashka/babashka/issues/1507): Expose methods on java.lang.VirtualThread ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- [#1510](https://github.com/babashka/babashka/issues/1510): add virtual thread interop on `Thread`
|
|
||||||
- [#1511](https://github.com/babashka/babashka/issues/1511): support for domain sockets
|
|
||||||
- [#1521](https://github.com/babashka/babashka/issues/1521): push images to GHCR ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- Bump edamame to 1.3.20
|
|
||||||
- Bump deps.clj to 1.11.1.1257
|
|
||||||
- Bump org.flatland/ordered to 1.15.10
|
|
||||||
- Support `clojure.lang.MapEntry/create`
|
|
||||||
- clojure.core.async `go` macro now uses virtual threads
|
|
||||||
- Bump babashka.cli to 0.6.50
|
|
||||||
- Bump http-client to 0.1.7
|
|
||||||
|
|
||||||
## 1.2.174 (2023-03-01)
|
|
||||||
|
|
||||||
- Use GraalVM 22.3.1 on JDK 19.0.2. This adds virtual thread support. See [demo](https://twitter.com/borkdude/status/1572222344684531717).
|
|
||||||
- Expose more `jaxax.crypto` classes
|
|
||||||
- Add more `java.time` and related classes with the goal of supporting [juxt.tick](https://github.com/juxt/tick) ([issue](https://github.com/juxt/tick/issues/86))
|
|
||||||
- Compatibility with [kaocha](https://github.com/lambdaisland/kaocha) test runner
|
|
||||||
- [#1000](https://github.com/babashka/babashka/issues/1000): add lib tests for xforms ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1482](https://github.com/babashka/babashka/issues/1482): make loading of libs thread safe
|
|
||||||
- [#1487](https://github.com/babashka/babashka/issues/1487): `babashka.tasks/clojure` should be supported without arguments to start a REPL
|
|
||||||
- [#1496](https://github.com/babashka/babashka/issues/1496): Add `set-agent-send-executor!` and `set-agent-send-off-executor!`
|
|
||||||
- [#1489](https://github.com/babashka/babashka/issues/1489): Don't overwrite non-empty, non-jar files when writing uberscript/uberjar ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- [#1506](https://github.com/babashka/babashka/issues/1506): `:exec-args` in task should override `:exec-args` on fn metadata
|
|
||||||
- [#1501](https://github.com/babashka/babashka/issues/1501): equals on deftype
|
|
||||||
- Add support for `.getWatches` on atoms
|
|
||||||
- Bump `babashka.fs` to `0.3.17`
|
|
||||||
- Bump `deps.clj` to `1.11.1.1237`
|
|
||||||
- Bump `babashka.http-client` to `0.1.5`
|
|
||||||
- Bump `babashka.cli` to `0.6.46`
|
|
||||||
|
|
||||||
## 1.1.173 (2023-02-04)
|
|
||||||
|
|
||||||
- [#1473](https://github.com/babashka/babashka/issues/1473): support `--config` in other dir + `:local/root` ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- Compatibility with `clojure.tools.namespace.repl/refresh` and `clojure.java.classpath`
|
|
||||||
- `(clojure.lang.RT/baseLoader)` now returns classloader with babashka dependencies on classpath
|
|
||||||
- Support reading tags from `data_readers.clj` and `data_readers.cljc`
|
|
||||||
- Don't exit REPL when `babashka.deps/add-deps` fails
|
|
||||||
- Fix [#1474](https://github.com/babashka/babashka/issues/1474): when `.bb` file is in different artifact, `.clj` file is loaded first if it appears first on classpath
|
|
||||||
- Support for `*loaded-libs*` and `(loaded-libs)`
|
|
||||||
- Bump rewrite-clj to `1.1.46`
|
|
||||||
- Bump http-client to `0.0.3`
|
|
||||||
- Bump fs to `0.2.15`
|
|
||||||
- Bump process to `0.4.16`
|
|
||||||
|
|
||||||
## 1.1.172 (2023-01-23)
|
|
||||||
|
|
||||||
- [#1472](https://github.com/babashka/babashka/issues/1472): fix tokenization of `babashka.tasks/clojure`: command was tokenized twice (regression was introduced in `1.0.168`)
|
|
||||||
- **BREAKING**: Bump `babashka.process`: change default for `:out :append` to `:out :write`. This default is undocumented so the impact should be small.
|
|
||||||
|
|
||||||
## 1.1.171 (2023-01-23)
|
|
||||||
|
|
||||||
- [#1467](https://github.com/babashka/babashka/issues/1467): **BREAKING**: avoid printing results, unless `--prn` is enabled (aside from `-e`, `-o` and `-O`).
|
|
||||||
- Include [http-client](https://github.com/babashka/http-client) as built-in library
|
|
||||||
- SCI: support `add-watch` on vars
|
|
||||||
- Compatibility with [eftest](https://github.com/weavejester/eftest) test runner (see [demo](https://twitter.com/borkdude/status/1616886788898885632))
|
|
||||||
- Add classes:
|
|
||||||
- `java.util.concurrent.Callable`
|
|
||||||
- `java.util.concurrent.ExecutorService`
|
|
||||||
- Expose `clojure.main` `main` and `repl-caught`
|
|
||||||
- Switch `clojure.test/*report-counters*` to ref instead of atom for compatibility with [kaocha](https://github.com/lambdaisland/kaocha)
|
|
||||||
- Allow `java.io.OutputStream` to be proxied, for [kaocha](https://github.com/lambdaisland/kaocha)
|
|
||||||
- Support qualified method names in `proxy` and ignore namespace
|
|
||||||
|
|
||||||
## 1.0.170 (2023-01-19)
|
|
||||||
|
|
||||||
- [#1463](https://github.com/babashka/babashka/issues/1463): Add `java.util.jar.Attributes` class ([@jeroenvandijk](https://github.com/jeroenvandijk))
|
|
||||||
- [#1456](https://github.com/babashka/babashka/issues/1456): allow `*warn-on-reflection*` and `*unchecked-math*` to be set in socket REPL and nREPL ([@axks](https://github.com/axks))
|
|
||||||
- SCI: macroexpansion error location improvement
|
|
||||||
- Add compatibility with [tab](https://github.com/eerohele/tab) and [solenoid](https://github.com/adam-james-v/solenoid)
|
|
||||||
- Bump babashka.cli and babashka.fs
|
|
||||||
- New classes:
|
|
||||||
- `java.util.jar.Attributes`
|
|
||||||
- `java.util.concurrent.ThreadFactory`
|
|
||||||
- `java.lang.Thread$UncaughtExceptionHandler`
|
|
||||||
- `java.lang.Thread$UncaughtExceptionHandler`
|
|
||||||
- `java.util.concurrent.BlockingQueue`
|
|
||||||
- `java.util.concurrent.ArrayBlockingQueue`
|
|
||||||
- `java.util.concurrent.ThreadFactory`
|
|
||||||
- `java.lang.Thread$UncaughtExceptionHandler`
|
|
||||||
- `java.util.concurrent.Semaphore`
|
|
||||||
- Expose more httpkit.server functions: `with-channel`, `on-close`, `close`
|
|
||||||
|
|
||||||
## 1.0.169 (2023-01-03)
|
|
||||||
|
|
||||||
- Implement `ns`, `lazy-seq` as macro
|
|
||||||
- Support `--dev-build` flag in installation script
|
|
||||||
- [#1451](https://github.com/babashka/babashka/issues/1451): Allow passing explicit file and line number to clojure.test ([@matthewdowney](https://github.com/matthewdowney))
|
|
||||||
- [#1280](https://github.com/babashka/babashka/issues/1280): babashka REPL doesn't quit right after Ctrl-d ([@formerly-a-trickster](https://github.com/formerly-a-trickster) and Alice Margatroid)
|
|
||||||
- [#1446](https://github.com/babashka/babashka/issues/1446): add `pprint/code-dispatch`
|
|
||||||
- Update zlib to version `1.2.13` ([@thiagokokada](https://github.com/thiagokokada))
|
|
||||||
- [#1454](https://github.com/babashka/babashka/issues/1454): Add `babashka.process` to `print-deps` output
|
|
||||||
- Update `deps.clj` / clojure tools to `1.11.1.1208`
|
|
||||||
- Add `reader-conditional` function
|
|
||||||
- Fix pretty printing (with `clojure.pprint`) of vars
|
|
||||||
- Upgrade built-in `spec.alpha`
|
|
||||||
- SCI performance improvements: faster JVM interop
|
|
||||||
|
|
||||||
## 1.0.168 (2022-12-07)
|
|
||||||
|
|
||||||
- `loop*`, `fn*` are now special forms and `loop`, `fn`, `defn`, `defmacro`, `and` and `or` are implemented as macros. This restores compatibility with [rcf](https://github.com/borkdude/hyperfiddle-rcf)
|
|
||||||
- fs: don't touch dirs in `split-ext`
|
|
||||||
- Update to babashka process to v0.4.13: support `(process opts? & args)` syntax everywhere
|
|
||||||
- [#1438](https://github.com/babashka/babashka/issues/1438): expose `query-string` and `url-encode` functions from org.httpkit.client ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Add `java.util.InputMismatchException`
|
|
||||||
|
|
||||||
## 1.0.167 (2022-11-30)
|
|
||||||
|
|
||||||
- [#1433](https://github.com/babashka/babashka/issues/1433): spec source as built-in fallback. When not including the
|
|
||||||
[clojure.spec.alpha](https://github.com/babashka/spec.alpha) fork as a
|
|
||||||
library, babashka loads a bundled version, when `clojure.spec.alpha` is required.
|
|
||||||
- [#1430](https://github.com/babashka/babashka/issues/1430): Fix issue with `bb tasks` throwing on empty display tasks list.
|
|
||||||
- Add note about BSOD when using WSL1, see [README.md/quickstart](https://github.com/LouDnl/babashka#quickstart)
|
|
||||||
- SCI: performance improvements
|
|
||||||
- Better error locations for interop ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Fix [babashka/babashka.nrepl#59](https://github.com/babashka/babashka.nrepl/issues/59): do not output extra new line with cider pprint
|
|
||||||
- Use `namespace-munge` instead of `munge` for doing ns -> file lookup
|
|
||||||
|
|
||||||
## 1.0.166 (2022-11-24)
|
|
||||||
|
|
||||||
See the [Testing babashka scripts](https://blog.michielborkent.nl/babashka-test-runner.html) blog post for how to run tests with this release.
|
|
||||||
|
|
||||||
- Compatibility with Cognitest [test-runner](https://github.com/cognitect-labs/test-runner) and [tools.namespace](https://github.com/clojure/tools.namespace)
|
|
||||||
- Add `run-test` and `run-test-var` to `clojure.test`
|
|
||||||
- Compile distributed uberjar using GraalVM, fixes `babashka.process/exec` for Nix
|
|
||||||
- [#1414](https://github.com/babashka/babashka/issues/1414): preserve metadata on exec task function argument map
|
|
||||||
- [#1269](https://github.com/babashka/babashka/issues/1269): add lib tests for sluj ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Update nix app example in docs
|
|
||||||
- Add `java.lang.Error` and `java.net.URLClassLoader` (only for compatibility with the `clojure.java.classpath` lib)
|
|
||||||
- Deps.clj `deps.clj: 1.11.1.1200`
|
|
||||||
- Upgrade timbre to `6.0.1`
|
|
||||||
- Performance improvements in SCI
|
|
||||||
- SCI: preserve stack information on `throw` expressions
|
|
||||||
|
|
||||||
## 1.0.165 (2022-11-01)
|
|
||||||
|
|
||||||
- Fix [#1401](https://github.com/babashka/babashka/issues/1401): mutation of `deftype` field should be visible in protocol method
|
|
||||||
- Fix [#1405](https://github.com/babashka/babashka/issues/1405): drop name metadata from conditionally defined var
|
|
||||||
- [#602](https://github.com/babashka/babashka/issues/602): add lib tests for clj-commons/fs ([@bobisageek](https://github.com/bobisageek))
|
|
||||||
- Add `java.net.URLConnection` class
|
|
||||||
- Add `java.time.zone.ZoneRules` class
|
|
||||||
- Copy more docstrings for core macros and vars
|
|
||||||
- Bump `core.async` to `1.6.673`
|
|
||||||
- Implement `in-ns` as function, rather than special form ([@SignSpice](https://github.com/SignSpice))
|
|
||||||
- Bump `deps.clj` to `1.11.1.1182`
|
|
||||||
- Bump GraalVM to `22.3.0`
|
|
||||||
- SCI: don't rely on metadata for record implementation
|
|
||||||
|
|
||||||
## 1.0.164 (2022-10-17)
|
|
||||||
|
|
||||||
- SCI: optimizations for `let`
|
|
||||||
- Add single argument read method support to PipedInputStream proxy ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
- Add single argument read method support to PipedInputStream proxy ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
||||||
- feat: Honor `*print-namespace-maps*` in pprint ([@ghoseb](https://github.com/ghoseb))
|
- feat: Honor `*print-namespace-maps*` in pprint ([@ghoseb](https://github.com/ghoseb))
|
||||||
- [#1369](https://github.com/babashka/babashka/issues/1369): provide `.sha256` files for every released asset
|
- [#1369](https://github.com/babashka/babashka/issues/1369): provide `.sha256` files for every released asset
|
||||||
- [#1397](https://github.com/babashka/babashka/issues/1397): Add `clojure.lang.Namespace` as alias for `sci.lang.Namespace`, such that `(instance? clojure.lang.Namespace *ns*)` returns `true` in bb
|
- [#1390](https://github.com/babashka/babashka/pull/1390): Add support for distributing pods as Clojure libraries containing just the manifest.
|
||||||
- [#1384](https://github.com/babashka/babashka/issues/1384): allow `.indexOf` on `LazySeq`
|
|
||||||
- [#1330](https://github.com/babashka/babashka/issues/1330): allow `(set! *warn-on-reflection*)` in programmatic nREPL
|
|
||||||
- Better error message when failing to load `bb.edn` ([@lispyclouds](https://github.com/lispyclouds))
|
|
||||||
- Pods: print and flush to `*out*` and `*err*` instead of using `println` ([@justone](https://github.com/justone))
|
|
||||||
- deps.clj: support for `CLJ_JVM_OPTS` and `JAVA_OPTS` ([@ikappaki](https://github.com/ikappaki))
|
|
||||||
- Fix `*print-namespace-maps*` when using `clojure.pprint` ([@ghoseb](https://github.com/ghoseb))
|
|
||||||
- Process: only slurp `*err*` when inputstream ([@ikappaki](https://github.com/ikappaki))
|
|
||||||
- Process: add `alive?` API function ([@grzm](https://github.com/grzm))
|
|
||||||
- Bump libraries: tools.cli, babashka.cli
|
|
||||||
- [#1391](https://github.com/babashka/babashka/issues/1391): include raw in `hiccup2.core` ns
|
|
||||||
- [#1391](https://github.com/babashka/babashka/issues/1391): support loading `hiccup.page` when adding hiccup to deps
|
|
||||||
|
|
||||||
## 0.10.163 (2022-09-24)
|
## 0.10.163 (2022-09-24)
|
||||||
|
|
||||||
|
|
@ -1029,7 +551,7 @@ Babashka.pods:
|
||||||
- Add `babashka.task` `System` property [#837](https://github.com/babashka/babashka/issues/837)
|
- Add `babashka.task` `System` property [#837](https://github.com/babashka/babashka/issues/837)
|
||||||
- Allow thread-first with `shell` like `babashka.process` [#829](https://github.com/babashka/babashka/issues/829)
|
- Allow thread-first with `shell` like `babashka.process` [#829](https://github.com/babashka/babashka/issues/829)
|
||||||
|
|
||||||
## 0.4.0 (2021-05-08)
|
## 0.4.0
|
||||||
|
|
||||||
Babashka proper:
|
Babashka proper:
|
||||||
|
|
||||||
|
|
@ -1039,7 +561,7 @@ Babashka proper:
|
||||||
[jasentaa](https://github.com/rm-hull/jasentaa) parser combinator library
|
[jasentaa](https://github.com/rm-hull/jasentaa) parser combinator library
|
||||||
- Update Selmer to 1.12.40
|
- Update Selmer to 1.12.40
|
||||||
|
|
||||||
SCI:
|
Sci:
|
||||||
|
|
||||||
- Better error msg for protocol not found or class
|
- Better error msg for protocol not found or class
|
||||||
|
|
||||||
|
|
@ -1609,14 +1131,6 @@ Details about releases prior to v0.1.0 can be found
|
||||||
|
|
||||||
## Breaking changes
|
## Breaking changes
|
||||||
|
|
||||||
### v1.1.172
|
|
||||||
|
|
||||||
- Bump `babashka.process`: change default for `:out :append` to `:out :write`. This default is undocumented so the impact should be small.
|
|
||||||
|
|
||||||
### v1.1.171
|
|
||||||
|
|
||||||
- [#1467](https://github.com/babashka/babashka/issues/1467): avoid printing results, unless `--prn` is enabled (aside from `-e`, `-o` and `-O`).
|
|
||||||
|
|
||||||
### v0.2.4
|
### v0.2.4
|
||||||
|
|
||||||
- Remove cheshire smile functions [#658](https://github.com/babashka/babashka/issues/658)
|
- Remove cheshire smile functions [#658](https://github.com/babashka/babashka/issues/658)
|
||||||
|
|
|
||||||
23
Dockerfile
23
Dockerfile
|
|
@ -5,25 +5,24 @@ RUN apt update
|
||||||
RUN apt install --no-install-recommends -yy build-essential zlib1g-dev
|
RUN apt install --no-install-recommends -yy build-essential zlib1g-dev
|
||||||
WORKDIR "/opt"
|
WORKDIR "/opt"
|
||||||
|
|
||||||
ENV GRAALVM_VERSION="24"
|
ENV GRAALVM_VERSION="22.2.0"
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
# Do not set those directly, use TARGETARCH instead
|
ENV BABASHKA_ARCH=${TARGETARCH}
|
||||||
ENV BABASHKA_ARCH=
|
ENV GRAALVM_ARCH=${TARGETARCH}
|
||||||
ENV GRAALVM_ARCH=
|
|
||||||
RUN if [ "${TARGETARCH}" = "" ] || [ "${TARGETARCH}" = "amd64" ]; then \
|
RUN if [ "${TARGETARCH}" = "" ] || [ "${TARGETARCH}" = "amd64" ]; then \
|
||||||
export GRAALVM_ARCH=x64; export BABASHKA_ARCH=x86_64; \
|
export GRAALVM_ARCH=amd64; export BABASHKA_ARCH=x86_64; \
|
||||||
elif [ "${TARGETARCH}" = "arm64" ]; then \
|
elif [ "${TARGETARCH}" = "arm64" ]; then \
|
||||||
export GRAALVM_ARCH=aarch64; \
|
export GRAALVM_ARCH=aarch64; \
|
||||||
fi && \
|
fi && \
|
||||||
echo "Installing GraalVM for ${GRAALVM_ARCH}" && \
|
echo "Installing GraalVM for ${GRAALVM_ARCH}" && \
|
||||||
curl -sLO https://download.oracle.com/graalvm/${GRAALVM_VERSION}/archive/graalvm-jdk-${GRAALVM_VERSION}_linux-${GRAALVM_ARCH}_bin.tar.gz && \
|
curl -sLO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${GRAALVM_VERSION}/graalvm-ce-java11-linux-${GRAALVM_ARCH}-${GRAALVM_VERSION}.tar.gz && \
|
||||||
mkdir "graalvm-$GRAALVM_VERSION" && \
|
tar -xzf graalvm-ce-java11-linux-${GRAALVM_ARCH}-${GRAALVM_VERSION}.tar.gz && \
|
||||||
tar -xzf graalvm-jdk-${GRAALVM_VERSION}_linux-${GRAALVM_ARCH}_bin.tar.gz -C graalvm-$GRAALVM_VERSION --strip-components 1
|
rm graalvm-ce-java11-linux-${GRAALVM_ARCH}-${GRAALVM_VERSION}.tar.gz
|
||||||
|
|
||||||
ARG BABASHKA_XMX="-J-Xmx4500m"
|
ARG BABASHKA_XMX="-J-Xmx4500m"
|
||||||
|
|
||||||
ENV GRAALVM_HOME="/opt/graalvm-$GRAALVM_VERSION"
|
ENV GRAALVM_HOME="/opt/graalvm-ce-java11-${GRAALVM_VERSION}"
|
||||||
ENV JAVA_HOME="$GRAALVM_HOME/bin"
|
ENV JAVA_HOME="/opt/graalvm-ce-java11-${GRAALVM_VERSION}/bin"
|
||||||
ENV PATH="$JAVA_HOME:$PATH"
|
ENV PATH="$JAVA_HOME:$PATH"
|
||||||
ENV BABASHKA_XMX=$BABASHKA_XMX
|
ENV BABASHKA_XMX=$BABASHKA_XMX
|
||||||
|
|
||||||
|
|
@ -73,9 +72,7 @@ RUN ./script/compile
|
||||||
|
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
RUN apt-get update && apt-get install -y curl \
|
RUN apt-get update && apt-get install -y curl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& mkdir -p /usr/local/bin
|
||||||
&& mkdir -p /usr/local/bin
|
|
||||||
|
|
||||||
COPY --from=BASE /opt/target/metabom.jar /opt/babashka-metabom.jar
|
COPY --from=BASE /opt/target/metabom.jar /opt/babashka-metabom.jar
|
||||||
COPY --from=BASE /opt/bb /usr/local/bin/bb
|
COPY --from=BASE /opt/bb /usr/local/bin/bb
|
||||||
CMD ["bb"]
|
CMD ["bb"]
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,15 @@ COPY bb /bin/bb
|
||||||
|
|
||||||
RUN chmod +x /bin/bb
|
RUN chmod +x /bin/bb
|
||||||
|
|
||||||
# TODO: See https://github.com/sgerrand/alpine-pkg-glibc/issues/185 and remove the `--force-overwrite`s when resolved.
|
|
||||||
|
|
||||||
RUN apk --no-cache add curl ca-certificates tar && \
|
RUN apk --no-cache add curl ca-certificates tar && \
|
||||||
curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \
|
curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \
|
||||||
apk add --allow-untrusted --force-overwrite /tmp/glibc-2.28-r0.apk
|
apk add --allow-untrusted /tmp/glibc-2.28-r0.apk
|
||||||
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
|
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
|
||||||
|
|
||||||
# TODO: Run actual native tests when they are ported
|
# TODO: Run actual native tests when they are ported
|
||||||
|
|
||||||
RUN curl --version
|
RUN bb -e "(curl/get \"https://httpstat.us/200\")" # cURL http test
|
||||||
# RUN bb -e '(prn (java.io.File/createTempFile "babashka.curl" ".headers"))'
|
RUN bb -e "(require '[org.httpkit.client :as http]) (when-let [error (:error @(http/get \"https://httpstat.us/200\"))] (throw error))" # JVM http test
|
||||||
# RUN bb -e '(spit (java.io.File/createTempFile "babashka.curl" ".headers") "hello")'
|
|
||||||
# RUN bb -e "(curl/get \"https://clojure.org\")" # cURL http test
|
|
||||||
RUN bb -e "(require '[org.httpkit.client :as http]) (when-let [error (:error @(http/get \"https://clojure.org\"))] (throw error))" # JVM http test
|
|
||||||
RUN bb -e "(.length \"Hello, Babashka\")" # Java interop test
|
RUN bb -e "(.length \"Hello, Babashka\")" # Java interop test
|
||||||
RUN bb -e "(require '[babashka.pods :as pods]) (pods/load-pod 'org.babashka/go-sqlite3 \"0.0.1\") (require '[pod.babashka.go-sqlite3 :as sqlite]) (sqlite/execute! \"/tmp/foo.db\" [\"SELECT 1 + 1\"])" # Pod test
|
RUN bb -e "(require '[babashka.pods :as pods]) (pods/load-pod 'org.babashka/go-sqlite3 \"0.0.1\") (require '[pod.babashka.go-sqlite3 :as sqlite]) (sqlite/execute! \"/tmp/foo.db\" [\"SELECT 1 + 1\"])" # Pod test
|
||||||
|
|
||||||
|
|
@ -26,7 +21,7 @@ FROM alpine:3
|
||||||
|
|
||||||
RUN apk --no-cache add curl ca-certificates tar && \
|
RUN apk --no-cache add curl ca-certificates tar && \
|
||||||
curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \
|
curl -Ls https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk > /tmp/glibc-2.28-r0.apk && \
|
||||||
apk add --allow-untrusted --force-overwrite /tmp/glibc-2.28-r0.apk && rm /tmp/glibc-2.28-r0.apk
|
apk add --allow-untrusted /tmp/glibc-2.28-r0.apk
|
||||||
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
|
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf
|
||||||
|
|
||||||
COPY metabom.jar /opt/babashka-metabom.jar
|
COPY metabom.jar /opt/babashka-metabom.jar
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ FROM ubuntu:latest
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y curl \
|
&& apt-get install -y curl \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
|
||||||
&& mkdir -p /usr/local/bin
|
&& mkdir -p /usr/local/bin
|
||||||
|
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
|
||||||
243
README.md
243
README.md
|
|
@ -4,7 +4,7 @@
|
||||||
[](https://app.slack.com/client/T03RZGPFR/CLX41ASCS)
|
[](https://app.slack.com/client/T03RZGPFR/CLX41ASCS)
|
||||||
[](https://opencollective.com/babashka) [](https://clojars.org/babashka/babashka)
|
[](https://opencollective.com/babashka) [](https://clojars.org/babashka/babashka)
|
||||||
[](https://twitter.com/search?q=%23babashka&src=typed_query&f=live)
|
[](https://twitter.com/search?q=%23babashka&src=typed_query&f=live)
|
||||||
[](https://book.babashka.org) [](https://gurubase.io/g/babashka)
|
[](https://book.babashka.org)
|
||||||
|
|
||||||
<blockquote class="twitter-tweet" data-lang="en">
|
<blockquote class="twitter-tweet" data-lang="en">
|
||||||
<p lang="en" dir="ltr">Life's too short to remember how to write Bash code. I feel liberated.</p>
|
<p lang="en" dir="ltr">Life's too short to remember how to write Bash code. I feel liberated.</p>
|
||||||
|
|
@ -12,6 +12,12 @@
|
||||||
<a href="https://github.com/laheadle">@laheadle</a> on Clojurians Slack
|
<a href="https://github.com/laheadle">@laheadle</a> on Clojurians Slack
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
Please leave some feedback about babashka in the [Q1 Survey](https://forms.gle/ko3NjDg2SwXeEoNQ9)!
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
Babashka is a native Clojure interpreter for scripting with fast startup. Its
|
Babashka is a native Clojure interpreter for scripting with fast startup. Its
|
||||||
|
|
@ -40,10 +46,10 @@ As one user described it:
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
For installation options check [Installation](https://github.com/babashka/babashka#installation).
|
For installation options check [Installation](https://github.com/babashka/babashka#installation).
|
||||||
For quick installation using `bash`, use:
|
For quick installation use:
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
|
$ bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install)
|
||||||
```
|
```
|
||||||
|
|
||||||
or grab a binary from [Github
|
or grab a binary from [Github
|
||||||
|
|
@ -53,36 +59,11 @@ anywhere on the path.
|
||||||
Then you're ready to go:
|
Then you're ready to go:
|
||||||
|
|
||||||
``` shellsession
|
``` shellsession
|
||||||
time bb -e '(->> (fs/list-dir ".") (filter fs/directory?) (map fs/normalize) (map str) (take 3))'
|
$ ls | bb -i '(filter #(-> % io/file .isDirectory) *input*)'
|
||||||
|
("doc" "resources" "sci" "script" "src" "target" "test")
|
||||||
|
bb took 4ms.
|
||||||
```
|
```
|
||||||
|
|
||||||
``` clojure
|
|
||||||
(".build" "feature-lanterna" ".repl")
|
|
||||||
bb -e 0,01s user 0,01s system 70% cpu 0,017 total
|
|
||||||
```
|
|
||||||
|
|
||||||
## Support :heart:
|
|
||||||
|
|
||||||
You can support this project via [Github
|
|
||||||
Sponsors](https://github.com/sponsors/borkdude),
|
|
||||||
[OpenCollective](https://opencollective.com/babashka),
|
|
||||||
[Ko-fi](https://ko-fi.com/borkdude) or indirectly via [Clojurists
|
|
||||||
Together](https://www.clojuriststogether.org/).
|
|
||||||
|
|
||||||
<details>
|
|
||||||
|
|
||||||
<summary>Top sponsors</summary>
|
|
||||||
|
|
||||||
- [Clojurists Together](https://clojuriststogether.org/)
|
|
||||||
- [Roam Research](https://roamresearch.com/)
|
|
||||||
- [Nextjournal](https://nextjournal.com/)
|
|
||||||
- [Toyokumo](https://toyokumo.co.jp/)
|
|
||||||
- [Cognitect](https://www.cognitect.com/)
|
|
||||||
- [Kepler16](https://kepler16.com/)
|
|
||||||
- [Adgoji](https://www.adgoji.com/)
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Babashka users
|
## Babashka users
|
||||||
|
|
||||||
See [companies](doc/companies.md) for a list of companies using babashka.
|
See [companies](doc/companies.md) for a list of companies using babashka.
|
||||||
|
|
@ -107,7 +88,7 @@ and is unlikely to change. Changes may happen in other parts of babashka,
|
||||||
although we will try our best to prevent them. Always check the release notes or
|
although we will try our best to prevent them. Always check the release notes or
|
||||||
[CHANGELOG.md](CHANGELOG.md) before upgrading.
|
[CHANGELOG.md](CHANGELOG.md) before upgrading.
|
||||||
|
|
||||||
## Talk
|
### Talk
|
||||||
|
|
||||||
To get an overview of babashka, you can watch this talk ([slides](https://speakerdeck.com/borkdude/babashka-and-the-small-clojure-interpreter-at-clojured-2020)):
|
To get an overview of babashka, you can watch this talk ([slides](https://speakerdeck.com/borkdude/babashka-and-the-small-clojure-interpreter-at-clojured-2020)):
|
||||||
|
|
||||||
|
|
@ -118,10 +99,44 @@ To get an overview of babashka, you can watch this talk ([slides](https://speake
|
||||||
The [babashka book](https://book.babashka.org) contains detailed information
|
The [babashka book](https://book.babashka.org) contains detailed information
|
||||||
about how to get the most out of babashka scripting.
|
about how to get the most out of babashka scripting.
|
||||||
|
|
||||||
There is also the book [Babashka Babooka](https://www.braveclojure.com/quests/babooka/),
|
## Examples
|
||||||
by Daniel Higginbotham, who has also helped a lot of people learn Clojure with
|
|
||||||
[Clojure for the Brave and
|
Read the output from a shell command as a lazy seq of strings:
|
||||||
True](https://www.braveclojure.com/clojure-for-the-brave-and-true/).
|
|
||||||
|
``` shell
|
||||||
|
$ ls | bb -i '(take 2 *input*)'
|
||||||
|
("CHANGES.md" "Dockerfile")
|
||||||
|
```
|
||||||
|
|
||||||
|
Read EDN from stdin and write the result to stdout:
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
$ bb '(vec (dedupe *input*))' <<< '[1 1 1 1 2]'
|
||||||
|
[1 2]
|
||||||
|
```
|
||||||
|
|
||||||
|
Read more about input and output flags [here](https://book.babashka.org/#_input_and_output_flags).
|
||||||
|
|
||||||
|
Execute a script. E.g. print the current time in California using the
|
||||||
|
`java.time` API:
|
||||||
|
|
||||||
|
File `pst.clj`:
|
||||||
|
``` clojure
|
||||||
|
#!/usr/bin/env bb
|
||||||
|
|
||||||
|
(def now (java.time.ZonedDateTime/now))
|
||||||
|
(def LA-timezone (java.time.ZoneId/of "America/Los_Angeles"))
|
||||||
|
(def LA-time (.withZoneSameInstant now LA-timezone))
|
||||||
|
(def pattern (java.time.format.DateTimeFormatter/ofPattern "HH:mm"))
|
||||||
|
(println (.format LA-time pattern))
|
||||||
|
```
|
||||||
|
|
||||||
|
``` shell
|
||||||
|
$ pst.clj
|
||||||
|
05:17
|
||||||
|
```
|
||||||
|
|
||||||
|
More examples can be found [here](examples/README.md).
|
||||||
|
|
||||||
## Try online
|
## Try online
|
||||||
|
|
||||||
|
|
@ -138,6 +153,11 @@ Install:
|
||||||
|
|
||||||
brew install borkdude/brew/babashka
|
brew install borkdude/brew/babashka
|
||||||
|
|
||||||
|
<!-- On macOS with an M1 processor: -->
|
||||||
|
|
||||||
|
<!-- softwareupdate --install-rosetta -->
|
||||||
|
<!-- arch -x86_64 brew install borkdude/brew/babashka -->
|
||||||
|
|
||||||
Upgrade:
|
Upgrade:
|
||||||
|
|
||||||
brew upgrade babashka
|
brew upgrade babashka
|
||||||
|
|
@ -160,12 +180,6 @@ Upgrade:
|
||||||
|
|
||||||
You can find more documentation on how to use babashka with nix [here](./doc/nix.md).
|
You can find more documentation on how to use babashka with nix [here](./doc/nix.md).
|
||||||
|
|
||||||
### Alpine
|
|
||||||
|
|
||||||
On Alpine it's recommended to download the binary manually from [Github
|
|
||||||
Releases](https://github.com/babashka/babashka/releases) and use the static
|
|
||||||
linux binary.
|
|
||||||
|
|
||||||
### Arch (Linux)
|
### Arch (Linux)
|
||||||
|
|
||||||
`babashka` is [available](https://aur.archlinux.org/packages/babashka-bin/) in the [Arch User Repository](https://aur.archlinux.org). It can be installed using your favorite [AUR](https://aur.archlinux.org) helper such as
|
`babashka` is [available](https://aur.archlinux.org/packages/babashka-bin/) in the [Arch User Repository](https://aur.archlinux.org). It can be installed using your favorite [AUR](https://aur.archlinux.org) helper such as
|
||||||
|
|
@ -175,25 +189,13 @@ linux binary.
|
||||||
|
|
||||||
### asdf
|
### asdf
|
||||||
|
|
||||||
[asdf](https://github.com/asdf-vm/asdf) is an extendable version manager for linux and macOS. Note that asdf will add significant startup time to any babashka script, consider using [mise](#mise) instead.
|
[asdf](https://github.com/asdf-vm/asdf) is an extendable version manager for linux and macOS.
|
||||||
|
|
||||||
Babashka can be installed using a plugin as follows:
|
Babashka can be installed using a plugin as follows:
|
||||||
|
|
||||||
asdf plugin add babashka https://github.com/pitch-io/asdf-babashka
|
asdf plugin add babashka
|
||||||
asdf install babashka latest
|
asdf install babashka latest
|
||||||
|
|
||||||
### mise
|
|
||||||
|
|
||||||
[mise](https://mise.jdx.dev/) is a development environment setup tool for linux and macOS.
|
|
||||||
|
|
||||||
Install:
|
|
||||||
|
|
||||||
mise use --global babashka@latest
|
|
||||||
|
|
||||||
Upgrade:
|
|
||||||
|
|
||||||
mise upgrade babashka
|
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
#### Scoop
|
#### Scoop
|
||||||
|
|
@ -218,22 +220,12 @@ If scoop does not work for you, then you can also just download the `bb.exe`
|
||||||
binary from [Github releases](https://github.com/babashka/babashka/releases) and
|
binary from [Github releases](https://github.com/babashka/babashka/releases) and
|
||||||
place it on your path manually.
|
place it on your path manually.
|
||||||
|
|
||||||
#### WSL1
|
|
||||||
> Note: WSL1 users might experience a BSOD, please use the --static install option when installing
|
|
||||||
``` shell
|
|
||||||
$ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
|
|
||||||
$ chmod +x install
|
|
||||||
$ ./install --static
|
|
||||||
```
|
|
||||||
|
|
||||||
### Installer script
|
### Installer script
|
||||||
|
|
||||||
Install via the installer script for linux and macOS:
|
Install via the installer script:
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
$ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
|
$ curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
|
||||||
# or
|
|
||||||
$ wget -qO install https://raw.githubusercontent.com/babashka/babashka/master/install
|
|
||||||
$ chmod +x install
|
$ chmod +x install
|
||||||
$ ./install
|
$ ./install
|
||||||
```
|
```
|
||||||
|
|
@ -282,12 +274,6 @@ You may also download a binary from
|
||||||
[Github](https://github.com/babashka/babashka/releases). For linux there is a
|
[Github](https://github.com/babashka/babashka/releases). For linux there is a
|
||||||
static binary available which can be used on Alpine.
|
static binary available which can be used on Alpine.
|
||||||
|
|
||||||
### CI
|
|
||||||
|
|
||||||
- On Github Actions it's recommended to use [setup-clojure](https://github.com/DeLaGuardo/setup-clojure) with `bb: latest`.
|
|
||||||
- You can use the [installer script](https://github.com/babashka/babashka#installer-script) on any non-Windows CI system. CircleCI requires `sudo`.
|
|
||||||
- On Appveyor + Windows you can use a bit of [Powershell](https://github.com/clj-kondo/clj-kondo/blob/39b5cb2b0d3d004c005e8975b6fafe0e314eec68/appveyor.yml#L60-L64).
|
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
|
|
||||||
Check out the image on [Docker hub](https://hub.docker.com/r/babashka/babashka/).
|
Check out the image on [Docker hub](https://hub.docker.com/r/babashka/babashka/).
|
||||||
|
|
@ -305,20 +291,63 @@ Go [here](https://book.babashka.org/#built-in-namespaces) to see the full list o
|
||||||
A list of projects (scripts, libraries, pods and tools) known to work with babashka.
|
A list of projects (scripts, libraries, pods and tools) known to work with babashka.
|
||||||
|
|
||||||
## Badges
|
## Badges
|
||||||
|
<!-- note to editor: it seems a blank line must appear before code blocks within <details> -->
|
||||||
|
|
||||||
|
[](https://babashka.org)
|
||||||
|
|
||||||
|
The babashka compatible badge indicates that a [library can be used as babashka dependency](doc/projects.md).
|
||||||
|
|
||||||
[](https://book.babashka.org#badges)
|
|
||||||
The babashka compatible badge indicates that a library can be used as babashka dependency.
|
|
||||||
If this is the case for your library, we encourage you to proudly display this badge.
|
If this is the case for your library, we encourage you to proudly display this badge.
|
||||||
|
|
||||||
[](https://book.babashka.org#badges)
|
<details><summary>Markdown</summary>
|
||||||
The babashka built-in badge means that a library has been built directly into babashka and requires no extra dependencies to use it.
|
|
||||||
|
```markdown
|
||||||
|
[](https://babashka.org)
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>AsciiDoc</summary>
|
||||||
|
|
||||||
|
```asciidoc
|
||||||
|
https://babashka.org[image:https://raw.githubusercontent.com/babashka/babashka/master/logo/badge.svg[bb compatible]]
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>HTML</summary>
|
||||||
|
|
||||||
|
```html
|
||||||
|
<a href="https://babashka.org" rel="nofollow"><img src="https://github.com/babashka/babashka/raw/master/logo/badge.svg" alt="bb compatible" style="max-width: 100%;"></a>
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
[](https://babashka.org)
|
||||||
|
|
||||||
|
The babashka built-in badge means that a [library has been built directly into babashka](https://book.babashka.org/#built-in-namespaces) and requires no extra dependencies to use it.
|
||||||
|
|
||||||
If this rare honor belongs to your library, you should display this badge.
|
If this rare honor belongs to your library, you should display this badge.
|
||||||
|
|
||||||
See [the babashka book for details](https://book.babashka.org#badges).
|
<details><summary>Markdown</summary>
|
||||||
|
|
||||||
## Swag
|
```markdown
|
||||||
|
[](https://babashka.org)
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
- [t-shirt](https://www.etsy.com/listing/1241766068/babashka-clj-kondo-nbb-shirt)
|
<details><summary>AsciiDoc</summary>
|
||||||
|
|
||||||
|
```asciidoc
|
||||||
|
https://babashka.org[image:https://raw.githubusercontent.com/babashka/babashka/master/logo/built-in-badge.svg[bb built-in]]
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary>HTML</summary>
|
||||||
|
|
||||||
|
```html
|
||||||
|
<a href="https://babashka.org" rel="nofollow"><img src="https://github.com/babashka/babashka/raw/master/logo/built-in-badge.svg" alt="bb built-in" style="max-width: 100%;"></a>
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
</br>
|
||||||
|
|
||||||
## [Pods](https://github.com/babashka/babashka.pods)
|
## [Pods](https://github.com/babashka/babashka.pods)
|
||||||
|
|
||||||
|
|
@ -326,7 +355,7 @@ Pods are programs that can be used as a Clojure library by
|
||||||
babashka. Documentation is available in the [pod library
|
babashka. Documentation is available in the [pod library
|
||||||
repo](https://github.com/babashka/pods).
|
repo](https://github.com/babashka/pods).
|
||||||
|
|
||||||
A list of available pods can be found in the [pod registry](https://github.com/babashka/pod-registry).
|
A list of available pods can be found [here](doc/projects.md#pods).
|
||||||
|
|
||||||
## Differences with Clojure
|
## Differences with Clojure
|
||||||
|
|
||||||
|
|
@ -368,21 +397,6 @@ handling of SIGINT and SIGPIPE. This can be done by setting
|
||||||
|
|
||||||
## Articles, podcasts and videos
|
## Articles, podcasts and videos
|
||||||
|
|
||||||
- [Blambda analyses sites](https://jmglov.net/blog/2023-01-04-blambda-analyses-sites.html) by Josh Glover
|
|
||||||
- [The wizard of HOP - How we built the web based HOP CLI Settings Editor using Babashka and Scittle](https://www.gethop.dev/post/the-wizard-of-hop-how-we-built-the-web-based-hop-cli-settings-editor-using-babashka-and-scittle) by Bingen Galartza
|
|
||||||
- [Simple TUIs with Babashka and Gum](https://rattlin.blog/bbgum.html) by Rattlin.blog
|
|
||||||
- [Babashka And Dialog Part Ii: Announcing The Bb-Dialog Library](https://www.pixelated-noise.com/blog/2023/01/20/bb-dialog-announcement/index.html) by A.C. Danvers
|
|
||||||
- [Babashka Babooka](https://www.braveclojure.com/quests/babooka/): Write Command-Line Clojure by Daniel Higginbotham
|
|
||||||
- [Re-Writing a GlobalProtect OpenConnect VPN Connect script in Babashka](https://tech.toryanderson.com/2023/01/14/re-writing-a-globalprotect-openconnect-vpn-connect-script-in-babashka/) by Tory Anderson
|
|
||||||
- [Babashka: How GraalVM Helped Create a Fast-Starting Scripting Environment for Clojure](https://medium.com/graalvm/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure-b0fcc38b0746) by Michiel Borkent (Japanese version [here]((https://logico-jp.io/2023/01/07/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure/)))
|
|
||||||
- [Adding Prompts To Your Babashka Scripts With Dialog](https://www.pixelated-noise.com/blog/2022/12/09/dialog-and-babashka/index.html) by A.C. Danvers
|
|
||||||
- [Scraping an HTML dictionary with Babashka and Bootleg](https://blog.exupero.org/scraping-an-html-dictionary-with-babashka-and-bootleg/) by exupero
|
|
||||||
- [Using Babashka to Get Electricity Prices](https://www.karimarttila.fi/clojure/2022/12/04/using-babashka-to-get-electricity-prices.html) by Kari Marttila
|
|
||||||
- [How to Do Things With Babashka](https://presumably.de/how-to-do-things-with-babashka.html) by Paulus Esterhazy (2022-12)
|
|
||||||
- [Using nREPL as a system interface](https://yogthos.net/posts/2022-11-26-nREPL-system-interaction.html) by Dmitri Sotnikov
|
|
||||||
- [Manage git hooks with babashka tasks](https://blaster.ai/blog/posts/manage-git-hooks-w-babashka.html) by Mykhaylo Bilyanskyy
|
|
||||||
- [Messing around with babashka](https://ian-muge.medium.com/messing-around-with-babashka-f181a9003faa) by Ian Muge
|
|
||||||
- Introducing [bbin](https://radsmith.com/bbin) by Radford Smith (2022-09)
|
|
||||||
- [Deleting AWS Glacier vaults with babashka](https://javahippie.net/clojure/2022/07/23/deleting-aws-glacier-vaults-with-babashka.html) by Tim Zöller
|
- [Deleting AWS Glacier vaults with babashka](https://javahippie.net/clojure/2022/07/23/deleting-aws-glacier-vaults-with-babashka.html) by Tim Zöller
|
||||||
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
||||||
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
|
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
|
||||||
|
|
@ -469,10 +483,47 @@ commit](https://github.com/babashka/babashka/commit/02c7c51ad4b2b1ab9aa95c26a744
|
||||||
|
|
||||||
Thanks to all the people that contributed to babashka:
|
Thanks to all the people that contributed to babashka:
|
||||||
|
|
||||||
|
- [Adgoji](https://www.adgoji.com/) for financial support
|
||||||
- [CircleCI](https://circleci.com/) for CI and additional support
|
- [CircleCI](https://circleci.com/) for CI and additional support
|
||||||
- [Nikita Prokopov](https://github.com/tonsky) for the logo
|
- [Nikita Prokopov](https://github.com/tonsky) for the logo
|
||||||
- [Contributors](https://github.com/babashka/babashka/graphs/contributors) and
|
- [Contributors](https://github.com/babashka/babashka/graphs/contributors) and
|
||||||
other users posting issues with bug reports and ideas
|
other users posting issues with bug reports and ideas
|
||||||
|
- [Github sponsors](https://github.com/sponsors/borkdude)
|
||||||
|
- [OpenCollective sponsors](https://opencollective.com/babashka)
|
||||||
|
- [Clojurists Together](https://www.clojuriststogether.org/)
|
||||||
|
|
||||||
|
### Code Contributors
|
||||||
|
|
||||||
|
This project exists thanks to all the people who contribute. [[Contribute](doc/dev.md)].
|
||||||
|
<a href="https://github.com/babashka/babashka/graphs/contributors"><img src="https://opencollective.com/babashka/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|
||||||
|
### Financial Contributors
|
||||||
|
|
||||||
|
#### Github Sponsors
|
||||||
|
|
||||||
|
- [Dig Gashinsky](https://github.com/digash)
|
||||||
|
|
||||||
|
#### OpenCollective
|
||||||
|
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/babashka/contribute)]
|
||||||
|
|
||||||
|
##### Individuals
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/babashka"><img src="https://opencollective.com/babashka/individuals.svg?width=890"></a>
|
||||||
|
|
||||||
|
##### Organizations
|
||||||
|
|
||||||
|
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/babashka/contribute)]
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/babashka/organization/0/website"><img src="https://opencollective.com/babashka/organization/0/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/1/website"><img src="https://opencollective.com/babashka/organization/1/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/2/website"><img src="https://opencollective.com/babashka/organization/2/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/3/website"><img src="https://opencollective.com/babashka/organization/3/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/4/website"><img src="https://opencollective.com/babashka/organization/4/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/5/website"><img src="https://opencollective.com/babashka/organization/5/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/6/website"><img src="https://opencollective.com/babashka/organization/6/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/7/website"><img src="https://opencollective.com/babashka/organization/7/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/8/website"><img src="https://opencollective.com/babashka/organization/8/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/babashka/organization/9/website"><img src="https://opencollective.com/babashka/organization/9/avatar.svg"></a>
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
22
appveyor.yml
22
appveyor.yml
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
version: "v-{build}"
|
version: "v-{build}"
|
||||||
|
|
||||||
image: Visual Studio 2022
|
image: Visual Studio 2017
|
||||||
|
|
||||||
clone_folder: C:\projects\babashka
|
clone_folder: C:\projects\babashka
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
GRAALVM_HOME: C:\projects\babashka\graalvm\graalvm-jdk-24+36.1
|
GRAALVM_HOME: C:\projects\babashka\graalvm\graalvm-ce-java11-22.2.0
|
||||||
JAVA_HOME: C:\projects\babashka\graalvm\graalvm-jdk-24+36.1
|
JAVA_HOME: C:\projects\babashka\graalvm\graalvm-ce-java11-22.2.0
|
||||||
BABASHKA_XMX: "-J-Xmx5g"
|
BABASHKA_XMX: "-J-Xmx5g"
|
||||||
|
|
||||||
skip_commits:
|
skip_commits:
|
||||||
|
|
@ -23,9 +23,6 @@ cache:
|
||||||
|
|
||||||
clone_script:
|
clone_script:
|
||||||
- cmd: git config --global core.autocrlf true
|
- cmd: git config --global core.autocrlf true
|
||||||
|
|
||||||
- cmd: git config --global core.symlinks true
|
|
||||||
|
|
||||||
- ps: >-
|
- ps: >-
|
||||||
if(-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
if(-not $env:APPVEYOR_PULL_REQUEST_NUMBER) {
|
||||||
git clone -q --branch=$env:APPVEYOR_REPO_BRANCH https://github.com/$env:APPVEYOR_REPO_NAME.git $env:APPVEYOR_BUILD_FOLDER
|
git clone -q --branch=$env:APPVEYOR_REPO_BRANCH https://github.com/$env:APPVEYOR_REPO_NAME.git $env:APPVEYOR_BUILD_FOLDER
|
||||||
|
|
@ -39,12 +36,9 @@ clone_script:
|
||||||
}
|
}
|
||||||
- cmd: git submodule update --init --recursive
|
- cmd: git submodule update --init --recursive
|
||||||
|
|
||||||
- cmd: git reset --hard
|
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
# TODO: Extract the zip by removing the top level folder to remove the hardcoded path for GRAALVM_HOME
|
|
||||||
- cmd: >-
|
- cmd: >-
|
||||||
powershell -Command "if (Test-Path('graalvm')) { return } else { (New-Object Net.WebClient).DownloadFile('https://download.oracle.com/graalvm/24/archive/graalvm-jdk-24_windows-x64_bin.zip', 'graalvm.zip') }"
|
powershell -Command "if (Test-Path('graalvm')) { return } else { (New-Object Net.WebClient).DownloadFile('https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.2.0/graalvm-ce-java11-windows-amd64-22.2.0.zip', 'graalvm.zip') }"
|
||||||
|
|
||||||
powershell -Command "if (Test-Path('graalvm')) { return } else { Expand-Archive graalvm.zip graalvm }"
|
powershell -Command "if (Test-Path('graalvm')) { return } else { Expand-Archive graalvm.zip graalvm }"
|
||||||
|
|
||||||
|
|
@ -61,7 +55,7 @@ build_script:
|
||||||
# see https://github.com/quarkusio/quarkus/pull/7663
|
# see https://github.com/quarkusio/quarkus/pull/7663
|
||||||
|
|
||||||
- cmd: >-
|
- cmd: >-
|
||||||
set BABASHKA_SHA=%APPVEYOR_REPO_COMMIT%
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
|
||||||
call script/uberjar.bat
|
call script/uberjar.bat
|
||||||
|
|
||||||
|
|
@ -75,15 +69,11 @@ build_script:
|
||||||
|
|
||||||
bb --config .build/bb.edn --deps-root . release-artifact %zip%
|
bb --config .build/bb.edn --deps-root . release-artifact %zip%
|
||||||
|
|
||||||
before_test:
|
|
||||||
- cmd: >-
|
|
||||||
set BABASHKA_CLASSPATH=
|
set BABASHKA_CLASSPATH=
|
||||||
|
|
||||||
set BABASHKA_TEST_ENV=native
|
set BABASHKA_TEST_ENV=native
|
||||||
|
|
||||||
test_script:
|
call script/test.bat
|
||||||
- cmd: >-
|
|
||||||
call script/test.bat :windows
|
|
||||||
|
|
||||||
call script/run_lib_tests.bat
|
call script/run_lib_tests.bat
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit e936acd40544eb637b6041c7e89454b21eb7ee34
|
Subproject commit 8a27e6060a739c7580cc89ba2bfddf48881e7178
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit edd3d613bfb9bf3adabfd0bda5c3f5c6ee85ec20
|
Subproject commit c8c8a766e026d5f87e0968a179dad70e13aa13ee
|
||||||
2
deps.clj
2
deps.clj
|
|
@ -1 +1 @@
|
||||||
Subproject commit 976cf7b0e54901ada3f7e83f12a4c0aed039adc9
|
Subproject commit c8c4d79c5fd8cb1d6e8daec4eec7b0a4d739f36c
|
||||||
67
deps.edn
67
deps.edn
|
|
@ -17,42 +17,40 @@
|
||||||
"depstar/src" "process/src"
|
"depstar/src" "process/src"
|
||||||
"deps.clj/src" "deps.clj/resources"
|
"deps.clj/src" "deps.clj/resources"
|
||||||
"resources" "sci/resources"
|
"resources" "sci/resources"
|
||||||
"impl-java/src"],
|
"reify/src"],
|
||||||
:deps {org.clojure/clojure {:mvn/version "1.12.0"},
|
:deps {org.clojure/clojure {:mvn/version "1.11.1"},
|
||||||
org.babashka/sci {:local/root "sci"}
|
org.babashka/sci {:local/root "sci"}
|
||||||
org.babashka/babashka.impl.java {:mvn/version "0.1.10"}
|
org.babashka/babashka.impl.reify {:mvn/version "0.1.3"}
|
||||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||||
babashka/babashka.curl {:local/root "babashka.curl"}
|
babashka/babashka.curl {:local/root "babashka.curl"}
|
||||||
babashka/fs {:local/root "fs"}
|
babashka/fs {:local/root "fs"}
|
||||||
babashka/babashka.core {:local/root "babashka.core"}
|
babashka/babashka.core {:local/root "babashka.core"}
|
||||||
org.clojure/core.async {:mvn/version "1.8.741"},
|
borkdude/graal.locking {:mvn/version "0.0.2"},
|
||||||
|
org.clojure/core.async {:mvn/version "1.5.648"},
|
||||||
org.clojure/tools.cli {:mvn/version "1.0.214"},
|
org.clojure/tools.cli {:mvn/version "1.0.214"},
|
||||||
org.clojure/data.csv {:mvn/version "1.0.0"},
|
org.clojure/data.csv {:mvn/version "1.0.0"},
|
||||||
cheshire/cheshire {:mvn/version "6.0.0"}
|
cheshire/cheshire {:mvn/version "5.11.0"}
|
||||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha8"}
|
org.clojure/data.xml {:mvn/version "0.2.0-alpha8"}
|
||||||
clj-commons/clj-yaml {:mvn/version "1.0.29"}
|
clj-commons/clj-yaml {:mvn/version "0.7.169"}
|
||||||
com.cognitect/transit-clj {:mvn/version "1.0.333"}
|
com.cognitect/transit-clj {:mvn/version "1.0.329"}
|
||||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||||
nrepl/bencode {:mvn/version "1.2.0"}
|
nrepl/bencode {:mvn/version "1.1.0"}
|
||||||
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
||||||
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
||||||
org.hsqldb/hsqldb {:mvn/version "2.5.1"}
|
org.hsqldb/hsqldb {:mvn/version "2.5.1"}
|
||||||
datascript/datascript {:mvn/version "1.0.1"}
|
datascript/datascript {:mvn/version "1.0.1"}
|
||||||
http-kit/http-kit {:mvn/version "2.8.0-RC1"}
|
http-kit/http-kit {:mvn/version "2.6.0-RC1"}
|
||||||
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-RC1"}
|
hiccup/hiccup {:mvn/version "2.0.0-alpha2"}
|
||||||
rewrite-clj/rewrite-clj {:mvn/version "1.1.49"}
|
rewrite-clj/rewrite-clj {:mvn/version "1.1.45"}
|
||||||
selmer/selmer {:mvn/version "1.12.59"}
|
selmer/selmer {:mvn/version "1.12.50"}
|
||||||
com.taoensso/timbre {:mvn/version "6.6.0"}
|
com.taoensso/timbre {:mvn/version "5.2.1"}
|
||||||
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
||||||
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
||||||
insn/insn {:mvn/version "0.5.2"}
|
insn/insn {:mvn/version "0.5.2"}
|
||||||
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
||||||
org.babashka/cli {:mvn/version "0.8.65"}
|
org.babashka/cli {:mvn/version "0.5.40"}}
|
||||||
org.babashka/http-client {:mvn/version "0.4.22"}
|
|
||||||
org.flatland/ordered {:mvn/version "1.15.12"}
|
|
||||||
org.jsoup/jsoup {:mvn/version "1.20.1"}}
|
|
||||||
:aliases {:babashka/dev
|
:aliases {:babashka/dev
|
||||||
{:main-opts ["-m" "babashka.main"]}
|
{:main-opts ["-m" "babashka.main"]}
|
||||||
:profile
|
:profile
|
||||||
|
|
@ -65,8 +63,8 @@
|
||||||
:lib-tests
|
:lib-tests
|
||||||
{:extra-paths ["process/src" "process/test" "test-resources/lib_tests"]
|
{:extra-paths ["process/src" "process/test" "test-resources/lib_tests"]
|
||||||
:extra-deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}
|
:extra-deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}
|
||||||
#_#_org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
||||||
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
||||||
lambdaisland/regal {:mvn/version "0.0.143"}
|
lambdaisland/regal {:mvn/version "0.0.143"}
|
||||||
cprop/cprop {:mvn/version "0.1.16"}
|
cprop/cprop {:mvn/version "0.1.16"}
|
||||||
comb/comb {:mvn/version "0.1.1"}
|
comb/comb {:mvn/version "0.1.1"}
|
||||||
|
|
@ -108,18 +106,16 @@
|
||||||
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
||||||
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
||||||
expound/expound {:mvn/version "0.8.10"}
|
expound/expound {:mvn/version "0.8.10"}
|
||||||
integrant/integrant {:git/url "https://github.com/weavejester/integrant", :git/sha "a9fd7c02bd7201f36344b47142badc3c3ef22f88"}
|
integrant/integrant {:mvn/version "0.8.0"}
|
||||||
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
||||||
listora/again {:mvn/version "1.0.0"}
|
listora/again {:mvn/version "1.0.0"}
|
||||||
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
||||||
environ/environ {:mvn/version "1.2.0"}
|
environ/environ {:mvn/version "1.2.0"}
|
||||||
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
||||||
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
||||||
org.clojure/tools.namespace {:git/sha "daf82a10e70182aea4c0716a48f3922163441b32",
|
org.clojure/tools.namespace {:git/url "https://github.com/babashka/tools.namespace", :sha "a13b037215e21a2e71aa34b27e1dd52c801a2a7b"}
|
||||||
:git/url "https://github.com/clojure/tools.namespace"}
|
|
||||||
medley/medley {:mvn/version "1.3.0"}
|
medley/medley {:mvn/version "1.3.0"}
|
||||||
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner",
|
io.github.cognitect-labs/test-runner {:git/tag "v0.5.0", :git/sha "b3fd0d2"}
|
||||||
:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}
|
|
||||||
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
||||||
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
||||||
testdoc/testdoc {:mvn/version "1.4.1"}
|
testdoc/testdoc {:mvn/version "1.4.1"}
|
||||||
|
|
@ -160,25 +156,7 @@
|
||||||
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
||||||
:deps/manifest :deps}
|
:deps/manifest :deps}
|
||||||
lambdaisland/uri {:git/url "https://github.com/lambdaisland/uri"
|
lambdaisland/uri {:git/url "https://github.com/lambdaisland/uri"
|
||||||
:git/sha "ac4f1f9c8e4f45a088db1c6383ce2191c973987c"
|
:git/sha "ac4f1f9c8e4f45a088db1c6383ce2191c973987c"}}
|
||||||
:deps/manifest :deps}
|
|
||||||
clj-commons/fs {:mvn/version "1.6.310"}
|
|
||||||
postmortem/postmortem {:git/url "https://github.com/athos/Postmortem"
|
|
||||||
:git/sha "1a29775a3d286f9f6fe3f979c78b6e2bf298d5ba"}
|
|
||||||
com.github.rawleyfowler/sluj {:git/url "https://github.com/rawleyfowler/sluj"
|
|
||||||
:git/sha "4a92e772b4e07bf127423448d4140748b5782198"
|
|
||||||
:deps/manifest :deps}
|
|
||||||
net.cgrand/xforms {:git/url "https://github.com/cgrand/xforms"
|
|
||||||
:git/sha "550dbc150a79c6ecc148d8a7e260e10bc36321c6"
|
|
||||||
:deps/manifest :deps}
|
|
||||||
prismatic/plumbing {:git/url "https://github.com/plumatic/plumbing",
|
|
||||||
:git/sha "424bc704f2db422de34269c139a5494314b3a43b"}
|
|
||||||
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
|
|
||||||
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
|
|
||||||
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
|
|
||||||
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}
|
|
||||||
net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules"
|
|
||||||
:git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}}
|
|
||||||
:classpath-overrides {org.clojure/clojure nil
|
:classpath-overrides {org.clojure/clojure nil
|
||||||
org.clojure/spec.alpha nil}}
|
org.clojure/spec.alpha nil}}
|
||||||
:clj-nvd
|
:clj-nvd
|
||||||
|
|
@ -188,8 +166,7 @@
|
||||||
:test
|
:test
|
||||||
{:extra-paths ["test"]
|
{:extra-paths ["test"]
|
||||||
:extra-deps {io.github.cognitect-labs/test-runner
|
:extra-deps {io.github.cognitect-labs/test-runner
|
||||||
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
|
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}}
|
||||||
nubank/matcher-combinators {:mvn/version "3.6.0"}}
|
|
||||||
:main-opts ["-m" "cognitect.test-runner"]
|
:main-opts ["-m" "cognitect.test-runner"]
|
||||||
:exec-fn cognitect.test-runner.api/test}
|
:exec-fn cognitect.test-runner.api/test}
|
||||||
:test-pod
|
:test-pod
|
||||||
|
|
|
||||||
2
depstar
2
depstar
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2bf9d3c9f15298d7dd9de033674a42f830e23d6f
|
Subproject commit c419b8c82041855d55593c5b561fc7cea8234712
|
||||||
14
doc/build.md
14
doc/build.md
|
|
@ -3,24 +3,24 @@
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
- Install [lein](https://leiningen.org/) for producing uberjars
|
- Install [lein](https://leiningen.org/) for producing uberjars
|
||||||
- Download [GraalVM](https://www.graalvm.org/downloads/). Currently we use *Oracle GraalVM 24*.
|
- Download [GraalVM](https://www.graalvm.org/downloads/). Currently we use *java11-22.2.0*.
|
||||||
- For Windows, installing Visual Studio 2019 with the "Desktop development
|
- For Windows, installing Visual Studio 2019 with the "Desktop development
|
||||||
with C++" workload is recommended.
|
with C++" workload is recommended.
|
||||||
- Set `$GRAALVM_HOME` to the GraalVM distribution directory. On macOS this can look like:
|
- Set `$GRAALVM_HOME` to the GraalVM distribution directory. On macOS this can look like:
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
export GRAALVM_HOME=~/Downloads/graalvm-jdk-21.0.0.1/Contents/Home
|
export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-22.2.0/Contents/Home
|
||||||
```
|
```
|
||||||
|
|
||||||
On linux:
|
On linux:
|
||||||
|
|
||||||
``` shell
|
``` shell
|
||||||
export GRAALVM_HOME=~/Downloads/graalvm-jdk-21.0.0.1
|
export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-22.2.0
|
||||||
```
|
```
|
||||||
|
|
||||||
On Windows, from the [Visual Studio 2019 x64 Native Tools Command Prompt](https://github.com/oracle/graal/issues/2116#issuecomment-590470806) or `cmd.exe` (not Powershell):
|
On Windows, from the [Visual Studio 2019 x64 Native Tools Command Prompt](https://github.com/oracle/graal/issues/2116#issuecomment-590470806) or `cmd.exe` (not Powershell):
|
||||||
```
|
```
|
||||||
set GRAALVM_HOME=%USERPROFILE%\Downloads\graalvm-ce-jdk-21.0.0.1
|
set GRAALVM_HOME=%USERPROFILE%\Downloads\graalvm-ce-java11-22.2.0
|
||||||
```
|
```
|
||||||
If you are not running from the x64 Native Tools Command Prompt, you will need to set additional environment variables using:
|
If you are not running from the x64 Native Tools Command Prompt, you will need to set additional environment variables using:
|
||||||
```
|
```
|
||||||
|
|
@ -62,7 +62,7 @@ take long to complete.
|
||||||
|
|
||||||
### Alternative: Build inside Docker
|
### Alternative: Build inside Docker
|
||||||
|
|
||||||
To build a Linux version of babashka, you can use `docker build`, enabling the
|
To build a Linux version of babashka, you can use `docker build`, enabling the
|
||||||
desired features via `--build-arg` like this:
|
desired features via `--build-arg` like this:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
@ -113,8 +113,8 @@ Babashka supports the following feature flags:
|
||||||
| `BABASHKA_FEATURE_ORACLEDB` | Includes the [Oracle](https://www.oracle.com/database/technologies/appdev/jdbc.html) JDBC driver | `false` |
|
| `BABASHKA_FEATURE_ORACLEDB` | Includes the [Oracle](https://www.oracle.com/database/technologies/appdev/jdbc.html) JDBC driver | `false` |
|
||||||
| `BABASHKA_FEATURE_DATASCRIPT` | Includes [datascript](https://github.com/tonsky/datascript) | `false` |
|
| `BABASHKA_FEATURE_DATASCRIPT` | Includes [datascript](https://github.com/tonsky/datascript) | `false` |
|
||||||
| `BABASHKA_FEATURE_LANTERNA` | Includes [clojure-lanterna](https://github.com/babashka/clojure-lanterna) | `false` |
|
| `BABASHKA_FEATURE_LANTERNA` | Includes [clojure-lanterna](https://github.com/babashka/clojure-lanterna) | `false` |
|
||||||
| `BABASHKA_FEATURE_LOGGING` | Includes [clojure.tools.logging](https://github.com/clojure/tools.logging) with [taoensso.timbre](https://github.com/ptaoussanis/timbre) as the default implementation| `true` |
|
| `BABASHKA_FEATURE_LOGGING` | Includes [clojure.tools.logging](https://github.com/clojure/tools.logging) with [taoensso.timbre](https://github.com/ptaoussanis/timbre) as the default implementation| `true` |
|
||||||
| `BABASHKA_FEATURE_PRIORITY_MAP` | Includes [clojure.data.priority-map](https://github.com/clojure/data.priority-map) | `true` |
|
| `BABASHKA_FEATURE_PRIORITY_MAP` | Includes [clojure.data.priority-map](https://github.com/clojure/data.priority-map) | `true` |
|
||||||
|
|
||||||
Note that httpkit server is currently experimental, the feature flag could be toggled to `false` in a future release.
|
Note that httpkit server is currently experimental, the feature flag could be toggled to `false` in a future release.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,6 @@ Sponsoring via [Cognitect](https://www.cognitect.com/).
|
||||||
- [Fluree](https://flur.ee/)
|
- [Fluree](https://flur.ee/)
|
||||||
- [Hi](https://www.hi.group/)
|
- [Hi](https://www.hi.group/)
|
||||||
- [Juxt](https://www.juxt.pro/)
|
- [Juxt](https://www.juxt.pro/)
|
||||||
- [Kleene](https://www.kleene.ai/)
|
|
||||||
- [Latacora](https://www.latacora.com/)
|
- [Latacora](https://www.latacora.com/)
|
||||||
- [Metosin](https://www.metosin.fi/en/)
|
- [Metosin](https://www.metosin.fi/en/)
|
||||||
- [Nextdoc](https://www.nextdoc.io/)
|
- [Nextdoc](https://www.nextdoc.io/)
|
||||||
|
|
|
||||||
56
doc/dev.md
56
doc/dev.md
|
|
@ -22,9 +22,6 @@ agreement, the PR will be merged.
|
||||||
Each bug fix, change or new feature should be tested well to prevent future
|
Each bug fix, change or new feature should be tested well to prevent future
|
||||||
regressions.
|
regressions.
|
||||||
|
|
||||||
If possible, tests should use public APIs. If the bug is in private/internal
|
|
||||||
code, try to trigger it from a public API.
|
|
||||||
|
|
||||||
### Force-push
|
### Force-push
|
||||||
|
|
||||||
Please do not use `git push --force` on your PR branch for the following
|
Please do not use `git push --force` on your PR branch for the following
|
||||||
|
|
@ -40,7 +37,7 @@ reasons:
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
You need [lein](https://leiningen.org/) for running JVM tests and/or producing uberjars. For building binaries you need GraalVM. Currently we use Oracle GraalVM 24.
|
You need [lein](https://leiningen.org/) for running JVM tests and/or producing uberjars. For building binaries you need GraalVM. Currently we use java11-22.2.0.
|
||||||
|
|
||||||
## Clone repository
|
## Clone repository
|
||||||
|
|
||||||
|
|
@ -84,14 +81,8 @@ Test the native version:
|
||||||
## Tests for Libraries
|
## Tests for Libraries
|
||||||
|
|
||||||
Babashka runs tests of libraries that are compatible with it through
|
Babashka runs tests of libraries that are compatible with it through
|
||||||
`script/run_lib_tests`.
|
`script/run_lib_tests`. The script `add-libtest.clj` makes adding new libraries
|
||||||
|
fairly easy. Some examples:
|
||||||
You can check out [this
|
|
||||||
commit](https://github.com/babashka/babashka/commit/8d9ac4c4d18a5588a4a258a61a9db3835b4f4e5c)
|
|
||||||
for how to add tests for a library that needs no changes to its tests.
|
|
||||||
The library is cloned as a git dependency, which also includes the tests, that are then added to the test's classpath and ran.
|
|
||||||
|
|
||||||
If a library's tests needs changes, we copy the tests using the `add-libtest.clj` script. Examples:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# To add tests for a new library on clojars
|
# To add tests for a new library on clojars
|
||||||
|
|
@ -114,47 +105,6 @@ If the library you want to add doesn't work automatically, you can manually do t
|
||||||
Note: If you have to modify any test file or configuration to have it work with
|
Note: If you have to modify any test file or configuration to have it work with
|
||||||
bb, add an inline comment with prefix `BB-TEST-PATCH:` explaining what you did.
|
bb, add an inline comment with prefix `BB-TEST-PATCH:` explaining what you did.
|
||||||
|
|
||||||
## Windows
|
|
||||||
We have corresponding `.bat` scripts for Windows, examples from a CMD Shell:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
script\test.bat
|
|
||||||
script\run_lib_tests.bat
|
|
||||||
set BABASHKA_TEST_ENV=native
|
|
||||||
script\run_lib_tests.bat
|
|
||||||
```
|
|
||||||
|
|
||||||
### Enable Windows Symbolic Links
|
|
||||||
You'll need to **enable symbolic links**.
|
|
||||||
You must do this before you git clone babashka otherwise some tests will fail.
|
|
||||||
There seems to be many ways to achieve this; I found the following worked from PowerShell:
|
|
||||||
```shell
|
|
||||||
Install-Module -Name Carbon -Force
|
|
||||||
Import-Module Carbon
|
|
||||||
Grant-CPrivilege -Identity lee -Privilege SeCreateSymbolicLinkPrivilege
|
|
||||||
```
|
|
||||||
You'll need to reboot:
|
|
||||||
```shell
|
|
||||||
shutdown /r /t 0
|
|
||||||
```
|
|
||||||
After reboot, verify the new privilege via:
|
|
||||||
```shell
|
|
||||||
whoami /priv
|
|
||||||
```
|
|
||||||
Test if you can create a symbolic link via:
|
|
||||||
```
|
|
||||||
mklink foofoo barbar
|
|
||||||
```
|
|
||||||
|
|
||||||
> **TIP**: Symbolic links are not supported in some folder-sharing technologies.
|
|
||||||
For example, if you are running Windows as a VirtualBox guest, sharing babashka
|
|
||||||
source folders from your host OS will not share the symbolic links as symbolic links.
|
|
||||||
One solution is to re-clone babashka to a non-shared folder on Windows.
|
|
||||||
|
|
||||||
### Git for Windows
|
|
||||||
Install [Git for Windows](https://gitforwindows.org/).
|
|
||||||
It includes a version of `cat` that babashka tests currently rely on.
|
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
See [build.md](build.md).
|
See [build.md](build.md).
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,9 @@ borkdude/deps,https://github.com/borkdude/deps.clj
|
||||||
borkdude/missing.test.assertions,https://github.com/borkdude/missing.test.assertions
|
borkdude/missing.test.assertions,https://github.com/borkdude/missing.test.assertions
|
||||||
borkdude/rewrite-edn,https://github.com/borkdude/rewrite-edn
|
borkdude/rewrite-edn,https://github.com/borkdude/rewrite-edn
|
||||||
camel-snake-kebab/camel-snake-kebab,https://github.com/clj-commons/camel-snake-kebab
|
camel-snake-kebab/camel-snake-kebab,https://github.com/clj-commons/camel-snake-kebab
|
||||||
cc.qbits/auspex,https://github.com/mpenet/auspex
|
|
||||||
cheshire/cheshire,https://github.com/dakrone/cheshire
|
|
||||||
circleci/bond,https://github.com/circleci/bond
|
circleci/bond,https://github.com/circleci/bond
|
||||||
cli-matic/cli-matic,https://github.com/l3nz/cli-matic.git
|
cli-matic/cli-matic,https://github.com/l3nz/cli-matic.git
|
||||||
clj-commons/clj-yaml,https://github.com/clj-commons/clj-yaml
|
clj-commons/clj-yaml,https://github.com/clj-commons/clj-yaml
|
||||||
clj-commons/fs,https://github.com/clj-commons/fs
|
|
||||||
clj-commons/multigrep,https://github.com/clj-commons/multigrep
|
clj-commons/multigrep,https://github.com/clj-commons/multigrep
|
||||||
clj-stacktrace/clj-stacktrace,https://github.com/mmcgrana/clj-stacktrace
|
clj-stacktrace/clj-stacktrace,https://github.com/mmcgrana/clj-stacktrace
|
||||||
clojure-csv/clojure-csv,https://github.com/davidsantiago/clojure-csv
|
clojure-csv/clojure-csv,https://github.com/davidsantiago/clojure-csv
|
||||||
|
|
@ -21,7 +18,6 @@ clojure-msgpack/clojure-msgpack,https://github.com/edma2/clojure-msgpack
|
||||||
clojure-term-colors/clojure-term-colors,https://github.com/trhura/clojure-term-colors
|
clojure-term-colors/clojure-term-colors,https://github.com/trhura/clojure-term-colors
|
||||||
com.exoscale/lingo,https://github.com/exoscale/lingo
|
com.exoscale/lingo,https://github.com/exoscale/lingo
|
||||||
com.github.askonomm/clarktown,https://github.com/askonomm/clarktown
|
com.github.askonomm/clarktown,https://github.com/askonomm/clarktown
|
||||||
com.github.rawleyfowler/sluj,https://github.com/rawleyfowler/sluj
|
|
||||||
com.github.seancorfield/expectations,https://github.com/clojure-expectations/clojure-test
|
com.github.seancorfield/expectations,https://github.com/clojure-expectations/clojure-test
|
||||||
com.github.seancorfield/honeysql,https://github.com/seancorfield/honeysql
|
com.github.seancorfield/honeysql,https://github.com/seancorfield/honeysql
|
||||||
com.grammarly/omniconf,https://github.com/grammarly/omniconf
|
com.grammarly/omniconf,https://github.com/grammarly/omniconf
|
||||||
|
|
@ -40,7 +36,6 @@ douglass/clj-psql,https://github.com/DarinDouglass/clj-psql
|
||||||
edn-query-language/eql,https://github.com/edn-query-language/eql
|
edn-query-language/eql,https://github.com/edn-query-language/eql
|
||||||
environ/environ,https://github.com/weavejester/environ
|
environ/environ,https://github.com/weavejester/environ
|
||||||
exoscale/coax,https://github.com/exoscale/coax
|
exoscale/coax,https://github.com/exoscale/coax
|
||||||
exoscale/interceptor,https://github.com/exoscale/interceptor
|
|
||||||
expound/expound,https://github.com/bhb/expound
|
expound/expound,https://github.com/bhb/expound
|
||||||
failjure/failjure,https://github.com/adambard/failjure
|
failjure/failjure,https://github.com/adambard/failjure
|
||||||
ffclj/ffclj,https://github.com/luissantos/ffclj
|
ffclj/ffclj,https://github.com/luissantos/ffclj
|
||||||
|
|
@ -62,13 +57,10 @@ java-http-clj/java-http-clj,http://www.github.com/schmee/java-http-clj
|
||||||
lambdaisland/regal,https://github.com/lambdaisland/regal
|
lambdaisland/regal,https://github.com/lambdaisland/regal
|
||||||
listora/again,https://github.com/liwp/again
|
listora/again,https://github.com/liwp/again
|
||||||
markdown-clj/markdown-clj,https://github.com/yogthos/markdown-clj
|
markdown-clj/markdown-clj,https://github.com/yogthos/markdown-clj
|
||||||
meander/epsilon,https://github.com/noprompt/meander
|
|
||||||
medley/medley,https://github.com/weavejester/medley
|
medley/medley,https://github.com/weavejester/medley
|
||||||
meta-merge/meta-merge,https://github.com/weavejester/meta-merge
|
meta-merge/meta-merge,https://github.com/weavejester/meta-merge
|
||||||
metosin/malli,https://github.com/metosin/malli
|
|
||||||
minimallist/minimallist,https://github.com/green-coder/minimallist
|
minimallist/minimallist,https://github.com/green-coder/minimallist
|
||||||
mvxcvi/arrangement,https://github.com/greglook/clj-arrangement
|
mvxcvi/arrangement,https://github.com/greglook/clj-arrangement
|
||||||
net.cgrand/xforms,https://github.com/cgrand/xforms
|
|
||||||
orchestra/orchestra,https://github.com/jeaye/orchestra
|
orchestra/orchestra,https://github.com/jeaye/orchestra
|
||||||
org.babashka/spec.alpha,https://github.com/babashka/spec.alpha
|
org.babashka/spec.alpha,https://github.com/babashka/spec.alpha
|
||||||
org.clj-commons/clj-http-lite,https://github.com/clj-commons/clj-http-lite
|
org.clj-commons/clj-http-lite,https://github.com/clj-commons/clj-http-lite
|
||||||
|
|
@ -85,9 +77,7 @@ org.clojure/math.combinatorics,https://github.com/clojure/math.combinatorics
|
||||||
org.clojure/math.numeric-tower,https://github.com/clojure/math.numeric-tower
|
org.clojure/math.numeric-tower,https://github.com/clojure/math.numeric-tower
|
||||||
org.clojure/test.check,https://github.com/clojure/test.check
|
org.clojure/test.check,https://github.com/clojure/test.check
|
||||||
org.clojure/tools.gitlibs,https://github.com/clojure/tools.gitlibs
|
org.clojure/tools.gitlibs,https://github.com/clojure/tools.gitlibs
|
||||||
org.clojure/tools.namespace,https://github.com/clojure/tools.namespace
|
org.clojure/tools.namespace,https://github.com/babashka/tools.namespace
|
||||||
postmortem/postmortem,https://github.com/athos/Postmortem
|
|
||||||
prismatic/schema,https://github.com/plumatic/schema
|
|
||||||
progrock/progrock,https://github.com/weavejester/progrock
|
progrock/progrock,https://github.com/weavejester/progrock
|
||||||
reifyhealth/specmonstah,https://github.com/reifyhealth/specmonstah
|
reifyhealth/specmonstah,https://github.com/reifyhealth/specmonstah
|
||||||
rewrite-clj/rewrite-clj,https://github.com/clj-commons/rewrite-clj
|
rewrite-clj/rewrite-clj,https://github.com/clj-commons/rewrite-clj
|
||||||
|
|
|
||||||
|
240
doc/news.md
240
doc/news.md
|
|
@ -5,234 +5,8 @@ you have anything to add. Also see
|
||||||
[#babashka](https://twitter.com/hashtag/babashka?src=hashtag_click&f=live) on
|
[#babashka](https://twitter.com/hashtag/babashka?src=hashtag_click&f=live) on
|
||||||
Twitter.
|
Twitter.
|
||||||
|
|
||||||
## 2023-05 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-05-01%20until%3A2023-06-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
## [2022-07](https://twitter.com/search?q=(%23babashka)%20until%3A2022-08-01%20since%3A2022-07-01&src=typed_query&f=live)
|
||||||
|
|
||||||
### Releases
|
|
||||||
|
|
||||||
1.3.178
|
|
||||||
|
|
||||||
Mostly a boring maintenance release with lib upgrades!
|
|
||||||
|
|
||||||
### Events
|
|
||||||
|
|
||||||
- [Babashka-conf](https://babashka.org/conf/) is happening June 10th in
|
|
||||||
Berlin. Only a few tickets left! See the [schedule](https://babashka.org/conf/schedule.html). Also you can buy a [conf t-shirt](https://www.etsy.com/listing/1475981599/babashka-conf-berlin-2023-t-shirt) now! See Nikita wearing it [here](https://twitter.com/nikitonsky/status/1658066530800742400)!
|
|
||||||
|
|
||||||
Thanks to conference sponsors:
|
|
||||||
|
|
||||||
<img src="https://pbs.twimg.com/media/Fw5h-0_XwA4DTIj?format=jpg&name=medium" width="200px">
|
|
||||||
|
|
||||||
- Babashka is going to the [Strange Loop](https://www.thestrangeloop.com/) conference!
|
|
||||||
|
|
||||||
### Projects
|
|
||||||
|
|
||||||
- [beep-boop](https://github.com/pesterhazy/beep-boop): Audible and visual feedback for test runs
|
|
||||||
- [panas.example](https://github.com/keychera/panas.example): All htmx examples ported to babashka!
|
|
||||||
- [utility-scripts](https://github.com/somecho/utility-scripts): A collection of helper scripts for Clojure, Java, Ledger and Taskwarrior. Written in Clojure
|
|
||||||
- [bb-scripts](https://github.com/techconative/bb-scripts): Babashka scripts for common utilities
|
|
||||||
- [Launching bb tasks from emacs](https://mastodon.social/@mykhaylo@fosstodon.org/110456087708592838)
|
|
||||||
|
|
||||||
### Articles
|
|
||||||
|
|
||||||
- [Clojure in security: Docker](https://www.juxt.pro/blog/clojure-in-docker/): mentions babashka and clj-kondo
|
|
||||||
- [Changing my mind: Converting a script from bash to Babashka](https://blog.agical.se/en/posts/changing-my-mind--converting-a-script-from-bash-to-babashka/)
|
|
||||||
- [How to create a really simple ClojureCLR dependency tool](https://blog.agical.se/en/posts/how-to-create-a-really-simple-clojureclr-dependency-tool/) with babashka
|
|
||||||
- [Making a resume with Node.js babashka (nbb)](https://yogthos.net/posts/2023-05-12-nbb-resume.html)
|
|
||||||
|
|
||||||
## 2023-04 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-04-01%20until%3A2023-05-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
|
||||||
|
|
||||||
[Babashka-conf](https://babashka.org/conf/) is happening June 10th in
|
|
||||||
Berlin. Save the date and/or submit your babashka/clojure-related talk or workshop
|
|
||||||
in the CfP!
|
|
||||||
|
|
||||||
### Releases
|
|
||||||
|
|
||||||
1.3.177
|
|
||||||
|
|
||||||
Biggest highlight: `bb.edn` is now respected relative of a script, no matter the directory you invoke it from! See [docs](https://book.babashka.org/#_script_adjacent_bb_edn).
|
|
||||||
|
|
||||||
### Projects
|
|
||||||
|
|
||||||
- [babashka-dl](https://github.com/mjhika/babashka-dl): simple install script for babashka on windows
|
|
||||||
- [instaparse-bb](https://github.com/babashka/instaparse-bb): Use instaparse from babashka, a new release
|
|
||||||
|
|
||||||
### Videos
|
|
||||||
|
|
||||||
- [Learning clojure w/ @lispyclouds](https://youtu.be/uBTRLBU-83A): a stream with teej_dv, a neovim core dev
|
|
||||||
|
|
||||||
## 2023-03 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-03-01%20until%3A2023-04-01&src=typed_query&f=top), [Mastodon](https://mastodon.social/tags/babashka))
|
|
||||||
|
|
||||||
### Releases
|
|
||||||
|
|
||||||
1.3.176, 1.3.175, 1.2.174:
|
|
||||||
|
|
||||||
Biggest highlight: Switch to GraalVM 19 and enable virtual threads!
|
|
||||||
|
|
||||||
### Videos
|
|
||||||
|
|
||||||
- [Blambda! The sound of babashka and AWS colliding](https://pitch.com/public/03fa9c7e-2b0e-45fb-8a22-d4a4d4d79d24), by Josh Glover from Pitch!
|
|
||||||
|
|
||||||
### Projects
|
|
||||||
|
|
||||||
- [babashka.json](https://github.com/babashka/json): JSON abstraction library
|
|
||||||
- [martian](https://github.com/oliyh/martian) is now babashka compatible!
|
|
||||||
- [panas.reload](https://github.com/keychera/panas.reload): a hot reload for babashka serving html+css (or htmx)
|
|
||||||
- [cljs-exif-reader](https://git.sr.ht/~rwv/cljs-exif-reader): Extract information from TIFF and JPEG images (works in babashka, despite the name)
|
|
||||||
|
|
||||||
### Jobs
|
|
||||||
|
|
||||||
- Write babashka at [Cognician](https://twitter.com/RobStuttaford/status/1641694501793038336)!
|
|
||||||
|
|
||||||
## 2023-02 ([Twitter](https://twitter.com/search?q=(%23babashka%20OR%20babashka)%20since%3A2023-02-01%20until%3A2023-03-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
|
||||||
|
|
||||||
## Releases
|
|
||||||
|
|
||||||
1.1.173: mostly bugfixes
|
|
||||||
|
|
||||||
### Articles
|
|
||||||
|
|
||||||
- [A technique for live coding simple web pages](https://github.com/whacked/cow/blob/main/a%20technique%20for%20live%20coding%20simple%20web%20pages.md) with babashka
|
|
||||||
|
|
||||||
### Videos
|
|
||||||
|
|
||||||
- [Stockholm Clojure Meetup Feb 23: Blambda! The sound of Babashka and Lambda colliding](https://www.youtube.com/watch?v=NfgYon96dsE)
|
|
||||||
|
|
||||||
### Projects
|
|
||||||
|
|
||||||
- [debux](https://github.com/philoskim/debux) is now babaskha-compatible
|
|
||||||
- [lines-of-code-bb](https://github.com/matthewdowney/linesofcode-bb): Babashka script to count lines of Clojure code, docs, comments, and more
|
|
||||||
- [deps-try](https://github.com/eval/deps-try): a babashka-script to try out Clojure libraries in rebel-readline
|
|
||||||
- [bb-dialog](https://github.com/pixelated-noise/bb-dialog) adds support for `--treeview`
|
|
||||||
- [A duckduck go CLI with babashka and (bbl)gum](https://mastodon.me.uk/@choffee/109845697304457129)
|
|
||||||
- [babashka http-client](https://github.com/babashka/http-client) now supports multipart uploads
|
|
||||||
- [sublime-pretty-edn](https://github.com/oakmac/sublime-pretty-edn): Format, Validate, Minify EDN files in Sublime Text
|
|
||||||
- [Play console tetris in babashka!](https://twitter.com/borkdude/status/1628473136969576449)
|
|
||||||
- [kaocha test runner](https://github.com/lambdaisland/kaocha) became babashka compatible!
|
|
||||||
|
|
||||||
## 2023-01 ([Twitter](https://twitter.com/search?q=%28%23babashka%20OR%20babashka%29%20until%3A2023-02-01%20since%3A2023-01-01&src=typed_query&f=live), [Mastodon](https://mastodon.social/tags/babashka))
|
|
||||||
|
|
||||||
### Releases
|
|
||||||
|
|
||||||
New releases in the past month: 1.0.170 - 1.1.173
|
|
||||||
Release highlights:
|
|
||||||
|
|
||||||
- Support for `data_readers.clj(c)`
|
|
||||||
- Include [http-client](https://github.com/babashka/http-client) as built-in library
|
|
||||||
- Compatibility with [clojure.tools.namespace.repl/refresh](https://github.com/clojure/tools.namespace)
|
|
||||||
- Compatibility with [clojure.java.classpath](https://github.com/clojure/java.classpath) (and other libraries which rely on `java.class.path` and `RT/baseLoader`)
|
|
||||||
- Compatibility with [eftest](https://github.com/weavejester/eftest) test runner (see demo)
|
|
||||||
- Compatibility with [cljfmt](https://github.com/weavejester/cljfmt)
|
|
||||||
- Support for `*loaded-libs*` and `(loaded-libs)`
|
|
||||||
- Support `add-watch` on vars (which adds compatibility with `potemkin.namespaces`)
|
|
||||||
- BREAKING: make printing of script results explicit with `--prn`
|
|
||||||
|
|
||||||
### Events
|
|
||||||
|
|
||||||
- [Babashka Workshop](https://clojure.stream/workshops/babashka) at ClojureStream with Rahul De
|
|
||||||
- [Blambda! The sound of Babashka and Lambda colliding](https://www.meetup.com/sthlm-clj/events/291204199/?utm_medium=referral&utm_campaign=share-btn_savedevents_share_modal&utm_source=twitter): sthlm.clj (Stockholm, Sweden)
|
|
||||||
|
|
||||||
### Articles
|
|
||||||
|
|
||||||
- [Babooka: write command line Clojure](https://www.braveclojure.com/quests/babooka/) by Daniel Higginbotham
|
|
||||||
- [Blambda analyses sites](https://jmglov.net/blog/2023-01-04-blambda-analyses-sites.html) by Josh Glover
|
|
||||||
- [Babashka: How GraalVM Helped Create a Fast-Starting Scripting Environment for Clojure](https://logico-jp.io/2023/01/07/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure/) in Japanese
|
|
||||||
- [The wizard of HOP - How we built the web based HOP CLI Settings Editor using Babashka and Scittle](https://www.gethop.dev/post/the-wizard-of-hop-how-we-built-the-web-based-hop-cli-settings-editor-using-babashka-and-scittle) by Bingen Galartza
|
|
||||||
- [Simple TUIs with Babashka and Gum](https://rattlin.blog/bbgum.html) by Rattlin.blog
|
|
||||||
- [Babashka And Dialog Part Ii: Announcing The Bb-Dialog Library](https://www.pixelated-noise.com/blog/2023/01/20/bb-dialog-announcement/index.html) by A.C. Danvers
|
|
||||||
- [Re-Writing a GlobalProtect OpenConnect VPN Connect script in Babashka](https://tech.toryanderson.com/2023/01/14/re-writing-a-globalprotect-openconnect-vpn-connect-script-in-babashka/) by Tory Anderson
|
|
||||||
|
|
||||||
### Projects
|
|
||||||
|
|
||||||
Projects that were new, had updates or were made compatible with babashka:
|
|
||||||
|
|
||||||
- [asdf-babashka](https://github.com/pitch-io/asdf-babashka): babashka plugin for the asdf version manager
|
|
||||||
- [babashka-htmx-todoapp](https://github.com/prestancedesign/babashka-htmx-todoapp): Quick example of a todo list SPA using Babashka and HTMX
|
|
||||||
- [bblgum](https://github.com/lispyclouds/bblgum): An extremely tiny and simple wrapper around charmbracelet/gum
|
|
||||||
- [bb-dialog](https://github.com/pixelated-noise/bb-dialog): A simple wrapper library for working with dialog from Babashka
|
|
||||||
- [carve](https://github.com/borkdude/carve): Remove unused Clojure vars
|
|
||||||
- [chr](https://github.com/ThaddeusJiang/chr): native commands history report for the default terminal users
|
|
||||||
- [clj-kondo-bb](https://github.com/clj-kondo/clj-kondo-bb): Invoke clj-kondo from babashka scripts!
|
|
||||||
- [cljfmt](https://github.com/weavejester/cljfmt): A tool for formatting Clojure code
|
|
||||||
- [drepl](https://github.com/claytn/drepl): Node JS dependency-repl. The node repl you already know with easy library installations
|
|
||||||
- [instaparse-bb](https://github.com/babashka/instaparse-bb): Wrapper library aroud pod-babashka-instaparse
|
|
||||||
- [lein2deps](https://github.com/borkdude/lein2deps): Lein project.clj to deps.edn converter
|
|
||||||
- [neil](https://github.com/babashka/neil): A CLI to add common aliases and features to deps.edn-based projects
|
|
||||||
- [obsidian-babashka](https://github.com/filipesilva/obsidian-babashka): Run Obsidian Clojure(Script) codeblocks in Babashka
|
|
||||||
- [pod-babashka-buddy](https://github.com/babashka/pod-babashka-buddy): A pod around buddy core (Cryptographic Api for Clojure)
|
|
||||||
- [quickblog](https://github.com/borkdude/quickblog): Light-weight static blog engine for Clojure and babashka
|
|
||||||
- [solenoid](https://github.com/adam-james-v/solenoid): A small clojure tool for making little control UIs while using the REPL!
|
|
||||||
- [tools.bbuild](https://github.com/babashka/tools.bbuild): babashka version of tools.build
|
|
||||||
- [weather](https://gist.github.com/yogthos/f86e63b856e1413180b2262024ece977): command line util for grabbing current weather for a city using OpenWeather API
|
|
||||||
|
|
||||||
## [2022-12](https://twitter.com/search?q=%28%23babashka%20OR%20babashka%29%20until%3A2023-01-01%20since%3A2022-12-01&src=typed_query&f=live)
|
|
||||||
|
|
||||||
- Releases: [1.0.168](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
|
||||||
- [How GraalVM Helped Create a Fast-Starting Scripting Environment for Clojure](https://medium.com/graalvm/babashka-how-graalvm-helped-create-a-fast-starting-scripting-environment-for-clojure-b0fcc38b0746)
|
|
||||||
- [http-client](https://github.com/babashka/http-client): a new HTTP client library for babashka
|
|
||||||
- [How to Do Things With Babashka](https://presumably.de/how-to-do-things-with-babashka.html) by Paulus Esterhazy (2022-12)
|
|
||||||
- [Using Babashka to Get Electricity Prices](https://www.karimarttila.fi/clojure/2022/12/04/using-babashka-to-get-electricity-prices) by Kari Marttila
|
|
||||||
- [Adding prompts to your babashka scripts with dialog](https://www.pixelated-noise.com/blog/2022/12/09/dialog-and-babashka/index.html) by A.C. Danvers
|
|
||||||
- [Scraping an HTML dictionary with Babashka and Bootleg](https://blog.exupero.org/scraping-an-html-dictionary-with-babashka-and-bootleg/) by exupero
|
|
||||||
- [quickblog](https://github.com/borkdude/quickblog) v0.1.0: Light-weight static blog engine for Clojure and babashka
|
|
||||||
- [bb-excel](https://github.com/kbosompem/bb-excel): Read Excel Files in babashka scripts
|
|
||||||
- [Get paginated list of issues from gitlab with clojure/babashka](https://gist.github.com/MrGung/29d0547fe45316c3438032fd164d42c6) by Steffen Glückselig
|
|
||||||
- Install development builds: `bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir /tmp`
|
|
||||||
- [JVM interop improvements in bb](https://twitter.com/borkdude/status/1606280110692352001)
|
|
||||||
- [A little trick to have conditional code for babashka in a .clj file without resorting to .cljc reader conditionals](https://twitter.com/borkdude/status/1599067149187764224)
|
|
||||||
- [Get Advent of Code input in babashka](https://gist.github.com/jeeger/6e39fea94ce49e33d1fa43f40cc36630) by Jan Seeger
|
|
||||||
- [Grabbing current weather for a city using OpenWeather API](https://gist.github.com/yogthos/f86e63b856e1413180b2262024ece977) by Dmitri Sotnikov
|
|
||||||
|
|
||||||
## [2022-11](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-12-01%20since%3A2022-11-01&src=typed_query&f=live)
|
|
||||||
|
|
||||||
- Releases: [1.0.165 - 1.0.167](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
|
||||||
- Registration for a [Babashka workshop](https://clojure.stream/workshops/babashka) with Rahul De at ClojureStream is now open!
|
|
||||||
- [Tutkain, a Sublime plugin for clojure based on socket REPL now with support for babashka](https://github.com/eerohele/Tutkain)
|
|
||||||
- [Manage git hooks in babashka](https://blaster.ai/blog/posts/manage-git-hooks-w-babashka.html) by Mykhaylo Bilyanskyy
|
|
||||||
- [Messing around with babashka](Messing around with Babashka) by Ian Muge
|
|
||||||
- [A babashka one liner to inspect data in portal](https://twitter.com/borkdude/status/1597505695800516609)
|
|
||||||
- [Using nREPL as a system interface](https://yogthos.net/posts/2022-11-26-nREPL-system-interaction.html) by Dmitri Sotnikov
|
|
||||||
- [deep-diff2](https://github.com/lambdaisland/deep-diff2) is now babashka-compatible!
|
|
||||||
- [A script to normalize auto-resolved keywords](https://github.com/babashka/babashka/blob/master/examples/normalize-keywords.clj)
|
|
||||||
- [Sum up page counts of books from Calibre library with babashka](https://gist.github.com/jeeger/d13159fefaee33c771be979639900ebc) by Jan Seeger
|
|
||||||
- [Tiny babashka script that returns a random clojure doc](https://gist.github.com/CarnunMP/c592cd3b6e711d56ddd4ca7832b9b251) by Carnun Marcus-Page
|
|
||||||
|
|
||||||
|
|
||||||
## [2022-10](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-11-01%20since%3A2022-10-01&src=typed_query&f=live)
|
|
||||||
|
|
||||||
- Releases: [1.0.164](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
|
||||||
- [bb-pod-racer](https://github.com/justone/bb-pod-racer): Speed up development of Babashka pods by Nate Jones
|
|
||||||
- [Babashka tasks VSCode plugin](https://marketplace.visualstudio.com/items?itemName=fbeyer.babashka-tasks) by Ferdinand Beyer
|
|
||||||
- A [PR](https://github.com/nextjournal/clerk/pull/232) to get Clerk working in babashka
|
|
||||||
- [lein2deps](https://github.com/borkdude/lein2deps): lein to deps.edn converter
|
|
||||||
- [awyeah-api](https://github.com/grzm/awyeah-api) by Michael Glaesemann v0.8.41 is now available! aws-api for Babashka. Aw yeah!
|
|
||||||
- [bbssh](https://github.com/epiccastle/bbssh/releases/tag/v0.2.0) by Crispin Wellington, v0.2.0 released
|
|
||||||
- [safely use rsync --archive --delete to backup a directory](https://gist.github.com/stelcodes/ddc8ff53de2192dca7d3fee1081ddb77) by Stel Abrego
|
|
||||||
|
|
||||||
## [2022-09](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-10-01%20since%3A2022-09-01&src=typed_query&f=live)
|
|
||||||
|
|
||||||
- Releases: [0.9.162 - 0.10.163](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
|
||||||
- Introducing [bbin](https://radsmith.com/bbin): a tool to install babashka scripts on your system by Radford Smith
|
|
||||||
- [bbssh](https://github.com/epiccastle/bbssh): Babashka pod for SSH support by [Epic Castle](https://github.com/epiccastle)
|
|
||||||
- [Loom virtual threads are coming to babashka](https://twitter.com/borkdude/status/1572222344684531717)
|
|
||||||
- [Tiny script to cycle through pulseaudio outputs (aka sinks)](https://gist.github.com/stelcodes/7d9136a5839b645b6cd5bc829a9fe541) by Stel Abrego
|
|
||||||
- [Tetris in the console via pod-babashka-lantera](https://twitter.com/borkdude/status/1569351199404576770)
|
|
||||||
- [org-mode gets support for babashka](https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=764642f55b7a9821acbabcfa1e2d354afab99be7)
|
|
||||||
- [docs for combining babashka process with promesa](https://github.com/babashka/process#promesa)
|
|
||||||
[exoscale/interceptor](https://github.com/exoscale/interceptor) became babashka-compatible!
|
|
||||||
- [Tutkain, socket REPL Sublime plugin, gets better support for babashka](https://twitter.com/borkdude/status/1568315151404924933)
|
|
||||||
- [babashka tweepy](https://github.com/davclark/babashka-tweepy): kicking the tires on using the tweepy library from a babashka task by Dav Clark
|
|
||||||
- [aoc helper](https://github.com/jjcomer/aoc-helper) by Josh Comer
|
|
||||||
- [Dogfooding blambda part 5](https://jmglov.net/blog/2022-09-02-dogfooding-blambda-logs.html) by Josh Glover
|
|
||||||
|
|
||||||
## [2022-08](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-09-01%20since%3A2022-08-01&src=typed_query&f=live)
|
|
||||||
- It's babashka's third birthday on August 9th 2022!
|
|
||||||
- [etaoin](https://github.com/clj-commons/etaoin), Pure Clojure Webdriver protocol implementation, is now babashka-compatible!
|
|
||||||
- [xforms](https://github.com/cgrand/xforms) is now babashka-compatible!
|
|
||||||
- [squint](https://github.com/squint-cljs/squint) and [cherry](https://github.com/squint-cljs/cherry) are CLJS-compilers that work with babashka!
|
|
||||||
|
|
||||||
## [2022-07](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-08-01%20since%3A2022-07-01&src=typed_query&f=live)
|
|
||||||
|
|
||||||
- Releases: [0.8.157 - 0.9.161](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
|
||||||
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/) by Teodor Heggelund
|
||||||
- [Babashka toolbox](https://babashka.org/toolbox/): A categorised directory of libraries and tools for Babashka
|
- [Babashka toolbox](https://babashka.org/toolbox/): A categorised directory of libraries and tools for Babashka
|
||||||
- [Quickblog](https://github.com/borkdude/quickblog): Light-weight static blog engine for Clojure and babashka
|
- [Quickblog](https://github.com/borkdude/quickblog): Light-weight static blog engine for Clojure and babashka
|
||||||
|
|
@ -249,7 +23,7 @@ Projects that were new, had updates or were made compatible with babashka:
|
||||||
- [Deleting AWS Glacier vaults with babashka](https://javahippie.net/clojure/2022/07/23/deleting-aws-glacier-vaults-with-babashka.html) by Tim Zöller
|
- [Deleting AWS Glacier vaults with babashka](https://javahippie.net/clojure/2022/07/23/deleting-aws-glacier-vaults-with-babashka.html) by Tim Zöller
|
||||||
|
|
||||||
|
|
||||||
## [2022-06](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-07-01%20since%3A2022-06-01&src=typed_query&f=live)
|
## [2022-06](https://twitter.com/search?q=(%23babashka)%20until%3A2022-07-01%20since%3A2022-06-01&src=typed_query&f=live)
|
||||||
|
|
||||||
- Releases: [0.8.156](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
- Releases: [0.8.156](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||||
- [AWS wiki page](https://github.com/babashka/babashka/wiki/AWS)
|
- [AWS wiki page](https://github.com/babashka/babashka/wiki/AWS)
|
||||||
|
|
@ -263,7 +37,7 @@ Projects that were new, had updates or were made compatible with babashka:
|
||||||
- [Logseq bb tasks](https://github.com/logseq/bb-tasks): Reusable babashka tasks used by logseq team
|
- [Logseq bb tasks](https://github.com/logseq/bb-tasks): Reusable babashka tasks used by logseq team
|
||||||
- [Breakneck Babashka on K8s](Breakneck Babashka on K8s) by Heow Goodman
|
- [Breakneck Babashka on K8s](Breakneck Babashka on K8s) by Heow Goodman
|
||||||
|
|
||||||
## [2022-05](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-06-01%20since%3A2022-05-01&src=typed_query&f=live)
|
## [2022-05](https://twitter.com/search?q=(%23babashka)%20until%3A2022-06-01%20since%3A2022-05-01&src=typed_query&f=live)
|
||||||
|
|
||||||
- Releases: [0.8.2](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
- Releases: [0.8.2](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||||
- [Etaoin](https://github.com/clj-commons/etaoin) moved to clj-commons and now works with babashka as well.
|
- [Etaoin](https://github.com/clj-commons/etaoin) moved to clj-commons and now works with babashka as well.
|
||||||
|
|
@ -273,7 +47,7 @@ Projects that were new, had updates or were made compatible with babashka:
|
||||||
- [Quickdoc](https://github.com/borkdude/quickdoc): (Quick and minimal API doc generation for Clojure
|
- [Quickdoc](https://github.com/borkdude/quickdoc): (Quick and minimal API doc generation for Clojure
|
||||||
- [Awyeah-api](https://github.com/grzm/awyeah-api) - Cognitect's aws-api for babashka
|
- [Awyeah-api](https://github.com/grzm/awyeah-api) - Cognitect's aws-api for babashka
|
||||||
|
|
||||||
## [2022-04](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-05-01%20since%3A2022-04-01&src=typed_query&f=live)
|
## [2022-04](https://twitter.com/search?q=(%23babashka)%20until%3A2022-05-01%20since%3A2022-04-01&src=typed_query&f=live)
|
||||||
|
|
||||||
- Releases: [0.8.0 - 0.8.1](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
- Releases: [0.8.0 - 0.8.1](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||||
- [Babashka and Clojure](https://youtu.be/ZvOs5Ele6VE) by Rahul Dé at North Virginia Linux Users Group
|
- [Babashka and Clojure](https://youtu.be/ZvOs5Ele6VE) by Rahul Dé at North Virginia Linux Users Group
|
||||||
|
|
@ -281,7 +55,7 @@ Projects that were new, had updates or were made compatible with babashka:
|
||||||
- Control Chrome via devtools using [clj-chrome-devtools](https://github.com/tatut/clj-chrome-devtools/blob/master/bb.clj) which runs with bb!
|
- Control Chrome via devtools using [clj-chrome-devtools](https://github.com/tatut/clj-chrome-devtools/blob/master/bb.clj) which runs with bb!
|
||||||
- Use pods directly in `bb.edn`: [tweet](https://twitter.com/borkdude/status/1510995356229767172)
|
- Use pods directly in `bb.edn`: [tweet](https://twitter.com/borkdude/status/1510995356229767172)
|
||||||
|
|
||||||
## [2022-03](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-04-01%20since%3A2022-03-01&src=typed_query&f=live)
|
## [2022-03](https://twitter.com/search?q=(%23babashka)%20until%3A2022-04-01%20since%3A2022-03-01&src=typed_query&f=live)
|
||||||
|
|
||||||
- Releases: [0.7.7 - 0.7.8](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
- Releases: [0.7.7 - 0.7.8](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||||
- [Create a password manager with Clojure using Babashka, sqlite, honeysql and stash](https://youtu.be/jm0RXmyjRJ8) by Daniel Amber
|
- [Create a password manager with Clojure using Babashka, sqlite, honeysql and stash](https://youtu.be/jm0RXmyjRJ8) by Daniel Amber
|
||||||
|
|
@ -291,7 +65,7 @@ Projects that were new, had updates or were made compatible with babashka:
|
||||||
- The [loom](https://github.com/aysylu/loom) library is now compatible [(tweet)](https://twitter.com/borkdude/status/1502237220811550723)
|
- The [loom](https://github.com/aysylu/loom) library is now compatible [(tweet)](https://twitter.com/borkdude/status/1502237220811550723)
|
||||||
- The [at-at](https://github.com/overtone/at-at) library is now compatible
|
- The [at-at](https://github.com/overtone/at-at) library is now compatible
|
||||||
|
|
||||||
## [2022-02](https://twitter.com/search?q=%28%23babashka%29%20until%3A2022-03-01%20since%3A2022-02-01&src=typed_query&f=live)
|
## [2022-02](https://twitter.com/search?q=(%23babashka)%20until%3A2022-03-01%20since%3A2022-02-01&src=typed_query&f=live)
|
||||||
|
|
||||||
- Releases: [0.7.5 - 0.7.6](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
- Releases: [0.7.5 - 0.7.6](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||||
- [Spire is available as a babashka pod](https://twitter.com/epic_castle/status/1496784352256008194)
|
- [Spire is available as a babashka pod](https://twitter.com/epic_castle/status/1496784352256008194)
|
||||||
|
|
@ -304,7 +78,7 @@ Projects that were new, had updates or were made compatible with babashka:
|
||||||
- [Apptemplate](https://github.com/redstarssystems/apptemplate): Application project template for Clojure featuring bb tasks
|
- [Apptemplate](https://github.com/redstarssystems/apptemplate): Application project template for Clojure featuring bb tasks
|
||||||
|
|
||||||
|
|
||||||
## [2022-01](https://twitter.com/search?f=live&q=%28%23babashka%29%20until%3A2022-02-01%20since%3A2022-01-01&src=typed_query)
|
## [2022-01](https://twitter.com/search?f=live&q=(%23babashka)%20until%3A2022-02-01%20since%3A2022-01-01&src=typed_query)
|
||||||
|
|
||||||
- Releases: [0.7.4](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
- Releases: [0.7.4](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||||
- [Babashka dev builds](https://github.com/babashka/babashka-dev-builds)
|
- [Babashka dev builds](https://github.com/babashka/babashka-dev-builds)
|
||||||
|
|
|
||||||
36
doc/nix.md
36
doc/nix.md
|
|
@ -81,7 +81,39 @@ After running `direnv allow`, babashka should be available on the `$PATH`, when
|
||||||
|
|
||||||
You can write babashka scripts with native dependencies using [WriteBabashkaApplication](https://github.com/sohalt/write-babashka-application).
|
You can write babashka scripts with native dependencies using [WriteBabashkaApplication](https://github.com/sohalt/write-babashka-application).
|
||||||
|
|
||||||
The WriteBabashkaApplication repository has an [example](https://github.com/Sohalt/write-babashka-application/tree/main/example) `flake.nix` using `cowsay` as an external dependency.
|
Here is an example `flake.nix` using `cowsay` as an external dependency:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.wbba.url = "github:sohalt/write-babashka-application";
|
||||||
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
outputs = { nixpkgs, flake-utils, wbba, ... }:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [ wbba.overlay ];
|
||||||
|
};
|
||||||
|
hello-babashka = pkgs.writeBabashkaApplication {
|
||||||
|
name = "hello";
|
||||||
|
runtimeInputs = with pkgs;[
|
||||||
|
cowsay # add your dependencies here
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
(ns hello
|
||||||
|
(:require [babashka.process :refer [sh]]))
|
||||||
|
|
||||||
You can download that example, and then build the application using `nix build` or run it using `nix run`.
|
(-> (sh ["cowsay" "hello from babashka"])
|
||||||
|
:out
|
||||||
|
print)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
defaultApp = hello-babashka;
|
||||||
|
defaultPackage = hello-babashka;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then build the application using `nix build` or run it using `nix run`.
|
||||||
|
|
|
||||||
113
doc/pod-libraries.md
Normal file
113
doc/pod-libraries.md
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
# Pods distributed as manifest libraries
|
||||||
|
|
||||||
|
Babashka library pods are a way of distributing pods that uses the normal
|
||||||
|
Clojure library dependency system to install and load pods.
|
||||||
|
It eliminates the need for the centralized babashka pod registry because the
|
||||||
|
pod manifest is (the only thing) downloaded in the library JAR file.
|
||||||
|
This document assumes you are already familiar with Babashka pods themselves
|
||||||
|
and only covers distributing them via Clojure libraries.
|
||||||
|
|
||||||
|
Let's break down the various components of how this works:
|
||||||
|
|
||||||
|
1. The `pod-manifest.edn` file
|
||||||
|
1. The first thing your pod needs is a `pod-manifest.edn` file. It is
|
||||||
|
recommended to store this in your pod project's `resources` dir under a
|
||||||
|
directory hierarchy matching your pod's top-level exposed namespace (but
|
||||||
|
replacing hyphens with underscores as usual in Clojure → Java name
|
||||||
|
munging). So, for example, if your pod exposes namespaces starting with
|
||||||
|
`pod.foo`, you should put your `pod-manifest.edn` in this path in your
|
||||||
|
pod project: `resources/pod/foo/pod-manifest.edn`.
|
||||||
|
1. By putting your `pod-manifest.edn` file in this namespace-mirroring
|
||||||
|
directory hierarchy inside your `resources` dir, you can consume it
|
||||||
|
while developing your pod using tools.deps' handy `:local/root`
|
||||||
|
feature.
|
||||||
|
2. If you have more than one pod in the same project (or just prefer
|
||||||
|
it), you can nest the `pod-manifest.edn` files deeper into their
|
||||||
|
respective namespace hierarchies. As long as there are at least two
|
||||||
|
namespace element directories, babashka will find the corresponding
|
||||||
|
`pod-manifest.edn` at runtime. So, for example, you can have
|
||||||
|
`foo.bar.baz.qux` → `resources/foo/bar/baz/qux/pod-manifest.edn` but
|
||||||
|
not just `foo` → `resources/foo/pod-manifest.edn`. This is because
|
||||||
|
a) single-element namespaces are frowned upon anyway in Clojure and
|
||||||
|
b) the first namespace element is often just `com` or `pod` or
|
||||||
|
similar and `pod/pod-manifest.edn` would be a very ambiguous
|
||||||
|
resource path to look for in a typical classpath.
|
||||||
|
2. Make sure the `resources` dir is in the `:paths` vector in your pod
|
||||||
|
project's `deps.edn` file. E.g. `:paths ["src" "resources"]`.
|
||||||
|
3. The format of the `pod-manifest.edn` file looks like this:
|
||||||
|
|
||||||
|
```clojure
|
||||||
|
{:pod/name pod.foo/bar
|
||||||
|
:pod/description "Foo bar pod"
|
||||||
|
:pod/version "0.4.0"
|
||||||
|
:pod/license "MIT"
|
||||||
|
:pod/artifacts
|
||||||
|
[{:os/name "Linux.*"
|
||||||
|
:os/arch "amd64"
|
||||||
|
:artifact/url "https://github.com/foo/pod-bar/releases/download/v0.4.0/pod-foo-bar-linux-amd64.zip"
|
||||||
|
:artifact/executable "pod-foo-bar"}
|
||||||
|
{:os/name "Linux.*"
|
||||||
|
:os/arch "aarch64"
|
||||||
|
:artifact/url "https://github.com/foo/pod-bar/releases/download/v0.4.0/pod-foo-bar-linux-arm64.zip"
|
||||||
|
:artifact/executable "pod-foo-bar"}
|
||||||
|
{:os/name "Mac.*"
|
||||||
|
:os/arch "amd64"
|
||||||
|
:artifact/url "https://github.com/foo/pod-bar/releases/download/v0.4.0/pod-foo-bar-macos-amd64.zip"
|
||||||
|
:artifact/executable "pod-foo-bar"}]}
|
||||||
|
```
|
||||||
|
|
||||||
|
1. The library JAR file
|
||||||
|
1. This JAR file can be built however you want (but see below for an example
|
||||||
|
tools.build `build.clj` snippet for generating it), but it must contain a
|
||||||
|
`pod-manifest.edn` file in a path corresponding to your pod's top-level
|
||||||
|
namespace as described above. For example, if your pod exposes the
|
||||||
|
namespaces `pod.foo.bar.baz` & `pod.foo.bar.qux` then you should have this
|
||||||
|
directory layout inside your JAR file: `pod/foo/bar/pod-manifest.edn`.
|
||||||
|
2. You then distribute this library JAR to any Maven repo you like
|
||||||
|
(e.g. Clojars).
|
||||||
|
2. The consuming project
|
||||||
|
1. In the project that wants to use your `pod.foo/bar` pod, you add the
|
||||||
|
library's Maven coordinates to your `deps.edn` or `bb.edn` `:deps`
|
||||||
|
section. This will put the `pod/foo/bar/pod-manifest.edn` file onto your
|
||||||
|
project's classpath. `bb` will then be able to find your pod's manifest
|
||||||
|
and install and load the pod.
|
||||||
|
3. Example `build.clj` snippet for building the library JAR
|
||||||
|
|
||||||
|
```clojure
|
||||||
|
(ns build
|
||||||
|
(:require
|
||||||
|
[clojure.string :as str]
|
||||||
|
[clojure.tools.build.api :as b]))
|
||||||
|
|
||||||
|
(def lib 'pod.foo/bar)
|
||||||
|
(def version "0.4.0")
|
||||||
|
(def jar-sources "resources")
|
||||||
|
(def class-dir "target/resources")
|
||||||
|
(def basis (b/create-basis {:project "deps.edn"}))
|
||||||
|
(def pod-manifest "pod/foo/bar/pod-manifest.edn")
|
||||||
|
(def jar-file (format "target/%s-%s.jar" (-> lib namespace (str/replace "." "-")) (name lib)))
|
||||||
|
|
||||||
|
(defn clean [_]
|
||||||
|
(b/delete {:path "target"}))
|
||||||
|
|
||||||
|
(defn jar [_]
|
||||||
|
(b/write-pom {:class-dir class-dir
|
||||||
|
:lib lib
|
||||||
|
:version version
|
||||||
|
:basis basis})
|
||||||
|
(b/copy-file {:src (str jar-sources "/" pod-manifest)
|
||||||
|
:target (str class-dir "/" pod-manifest)})
|
||||||
|
(b/jar {:class-dir class-dir
|
||||||
|
:jar-file jar-file}))
|
||||||
|
|
||||||
|
;; optional - allows you to install the JAR to your local ~/.m2/repository for testing
|
||||||
|
(defn install [_]
|
||||||
|
(jar nil)
|
||||||
|
(b/install {:basis basis
|
||||||
|
:lib lib
|
||||||
|
:version version
|
||||||
|
:jar-file jar-file
|
||||||
|
:class-dir class-dir}))
|
||||||
|
```
|
||||||
|
|
||||||
|
You can then build this pod library via: `clj -T:build jar` and the JAR file will be in `target/pod-foo-bar.jar`.
|
||||||
|
|
@ -65,8 +65,6 @@ The following libraries and projects are known to work with babashka.
|
||||||
- [Malli](#malli)
|
- [Malli](#malli)
|
||||||
- [Meander](#meander)
|
- [Meander](#meander)
|
||||||
- [Schema](#schema)
|
- [Schema](#schema)
|
||||||
- [Sluj](#sluj)
|
|
||||||
- [malli-cli](#malli-cli)
|
|
||||||
- [Pods](#pods)
|
- [Pods](#pods)
|
||||||
- [Projects](#projects-1)
|
- [Projects](#projects-1)
|
||||||
- [babashka-test-action](#babashka-test-action)
|
- [babashka-test-action](#babashka-test-action)
|
||||||
|
|
@ -830,14 +828,6 @@ Tools for transparent data transformation
|
||||||
|
|
||||||
Clojure(Script) library for declarative data description and validation
|
Clojure(Script) library for declarative data description and validation
|
||||||
|
|
||||||
### [Sluj](https://github.com/rawleyfowler/sluj)
|
|
||||||
|
|
||||||
Sluj is a very small library for converting strings of UTF-16 text to slugs. A slug is a piece of text that is URL safe.
|
|
||||||
|
|
||||||
### [malli-cli](https://github.com/piotr-yuxuan/malli-cli)
|
|
||||||
|
|
||||||
Configuration and CLI powertool with `metosin/malli`.
|
|
||||||
|
|
||||||
## Pods
|
## Pods
|
||||||
|
|
||||||
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can
|
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
(ns normalize-keywords
|
(ns normalize-keywords
|
||||||
(:require [babashka.pods :as pods]
|
(:require [babashka.pods :as pods]
|
||||||
[clojure.java.io :as io]
|
|
||||||
[rewrite-clj.node :as node]
|
[rewrite-clj.node :as node]
|
||||||
[rewrite-clj.zip :as z]))
|
[rewrite-clj.zip :as z]))
|
||||||
|
|
||||||
(pods/load-pod 'clj-kondo/clj-kondo "2022.11.02")
|
(pods/load-pod 'borkdude/clj-kondo "2021.06.18")
|
||||||
|
|
||||||
(require '[pod.borkdude.clj-kondo :as clj-kondo])
|
(require '[pod.borkdude.clj-kondo :as clj-kondo])
|
||||||
|
|
||||||
(def code (first *command-line-args*))
|
(def code (first *command-line-args*))
|
||||||
|
|
||||||
(defn findings [file-path]
|
(def findings
|
||||||
(->> (clj-kondo/run! {:lint [file-path]
|
(->> (with-in-str code
|
||||||
:config {:output {:analysis {:keywords true}}}})
|
(clj-kondo/run! {:lint [code]
|
||||||
|
:config {:output {:analysis {:keywords true}}}}))
|
||||||
:analysis
|
:analysis
|
||||||
:keywords
|
:keywords
|
||||||
(filter (some-fn :alias :auto-resolved))))
|
(filter (some-fn :alias :auto-resolved))))
|
||||||
|
|
@ -33,11 +33,6 @@
|
||||||
zloc (z/replace zloc (node/coerce k))]
|
zloc (z/replace zloc (node/coerce k))]
|
||||||
(recur zloc (next findings)))
|
(recur zloc (next findings)))
|
||||||
(recur (z/next zloc) findings)))
|
(recur (z/next zloc) findings)))
|
||||||
(str (z/root zloc)))))
|
(println (str (z/root zloc))))))
|
||||||
|
|
||||||
(doseq [f (file-seq (io/file code))
|
(remove-locs (z/of-file code) findings)
|
||||||
:when (re-find #"\.clj[cdsx]?$" (str f))
|
|
||||||
:let [file-path (str f)]]
|
|
||||||
(when-let [findings' (findings file-path)]
|
|
||||||
(prn (format "Rewriting %s" file-path))
|
|
||||||
(spit f (remove-locs (z/of-file file-path) findings'))))
|
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,7 @@
|
||||||
'acl (copy-var acl cns)
|
'acl (copy-var acl cns)
|
||||||
'unlock (copy-var unlock cns)
|
'unlock (copy-var unlock cns)
|
||||||
'default-client (copy-var client/default-client cns)
|
'default-client (copy-var client/default-client cns)
|
||||||
'*default-client* default-client
|
'*default-client* default-client})
|
||||||
'query-string (copy-var client/query-string cns)
|
|
||||||
'url-encode (copy-var client/url-encode cns)})
|
|
||||||
|
|
||||||
(def sni-client-namespace
|
(def sni-client-namespace
|
||||||
{'ssl-configurer (copy-var sni-client/ssl-configurer sns)
|
{'ssl-configurer (copy-var sni-client/ssl-configurer sns)
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,4 @@
|
||||||
'send-checked-websocket-handshake! (copy-var server/send-checked-websocket-handshake! sns)
|
'send-checked-websocket-handshake! (copy-var server/send-checked-websocket-handshake! sns)
|
||||||
'send-websocket-handshake! (copy-var server/send-websocket-handshake! sns)
|
'send-websocket-handshake! (copy-var server/send-websocket-handshake! sns)
|
||||||
'as-channel (copy-var server/as-channel sns)
|
'as-channel (copy-var server/as-channel sns)
|
||||||
'send! (copy-var server/send! sns)
|
'send! (copy-var server/send! sns)})
|
||||||
'with-channel (copy-var server/with-channel sns)
|
|
||||||
'on-close (copy-var server/on-close sns)
|
|
||||||
'close (copy-var server/close sns)}
|
|
||||||
)
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
[next.jdbc :as njdbc]
|
[next.jdbc :as njdbc]
|
||||||
[next.jdbc.result-set :as rs]
|
[next.jdbc.result-set :as rs]
|
||||||
[next.jdbc.sql :as sql]
|
[next.jdbc.sql :as sql]
|
||||||
[sci.core :as sci]))
|
[sci.core :as sci]
|
||||||
|
[sci.impl.namespaces :refer [copy-var macrofy]]))
|
||||||
|
|
||||||
(def next-ns (sci/create-ns 'next.jdbc nil))
|
(def next-ns (sci/create-ns 'next.jdbc nil))
|
||||||
|
|
||||||
|
|
@ -19,30 +20,30 @@
|
||||||
* `:rollback-only` -- `true` / `false`."
|
* `:rollback-only` -- `true` / `false`."
|
||||||
[_ _ [sym transactable opts] & body]
|
[_ _ [sym transactable opts] & body]
|
||||||
(let [con (vary-meta sym assoc :tag 'java.sql.Connection)]
|
(let [con (vary-meta sym assoc :tag 'java.sql.Connection)]
|
||||||
`(njdbc/transact ~transactable (^{:once true} fn* [~con] ~@body) ~(or opts {}))))
|
`(next.jdbc/transact ~transactable (^{:once true} fn* [~con] ~@body) ~(or opts {}))))
|
||||||
|
|
||||||
(def njdbc-namespace
|
(def njdbc-namespace
|
||||||
{'get-datasource (sci/copy-var njdbc/get-datasource next-ns)
|
{'get-datasource (copy-var njdbc/get-datasource next-ns)
|
||||||
'execute! (sci/copy-var njdbc/execute! next-ns)
|
'execute! (copy-var njdbc/execute! next-ns)
|
||||||
'execute-one! (sci/copy-var njdbc/execute-one! next-ns)
|
'execute-one! (copy-var njdbc/execute-one! next-ns)
|
||||||
'get-connection (sci/copy-var njdbc/get-connection next-ns)
|
'get-connection (copy-var njdbc/get-connection next-ns)
|
||||||
'plan (sci/copy-var njdbc/plan next-ns)
|
'plan (copy-var njdbc/plan next-ns)
|
||||||
'prepare (sci/copy-var njdbc/prepare next-ns)
|
'prepare (copy-var njdbc/prepare next-ns)
|
||||||
'transact (sci/copy-var njdbc/transact next-ns)
|
'transact (copy-var njdbc/transact next-ns)
|
||||||
'with-transaction (sci/copy-var with-transaction next-ns)})
|
'with-transaction (macrofy 'with-transaction with-transaction next-ns)})
|
||||||
|
|
||||||
(def sns (sci/create-ns 'next.jdbc.sql nil))
|
(def sns (sci/create-ns 'next.jdbc.sql nil))
|
||||||
|
|
||||||
(def next-sql-namespace
|
(def next-sql-namespace
|
||||||
{'insert-multi! (sci/copy-var sql/insert-multi! sns)})
|
{'insert-multi! (copy-var sql/insert-multi! sns)})
|
||||||
|
|
||||||
(def rsns (sci/create-ns 'next.jdbc.result-set nil))
|
(def rsns (sci/create-ns 'next.jdbc.result-set nil))
|
||||||
|
|
||||||
(def result-set-namespace
|
(def result-set-namespace
|
||||||
{'as-maps (sci/copy-var rs/as-maps rsns)
|
{'as-maps (copy-var rs/as-maps rsns)
|
||||||
'as-unqualified-maps (sci/copy-var rs/as-unqualified-maps rsns)
|
'as-unqualified-maps (copy-var rs/as-unqualified-maps rsns)
|
||||||
'as-modified-maps (sci/copy-var rs/as-modified-maps rsns)
|
'as-modified-maps (copy-var rs/as-modified-maps rsns)
|
||||||
'as-unqualified-modified-maps (sci/copy-var rs/as-unqualified-modified-maps rsns)
|
'as-unqualified-modified-maps (copy-var rs/as-unqualified-modified-maps rsns)
|
||||||
'as-lower-maps (sci/copy-var rs/as-lower-maps rsns)
|
'as-lower-maps (copy-var rs/as-lower-maps rsns)
|
||||||
'as-unqualified-lower-maps (sci/copy-var rs/as-unqualified-lower-maps rsns)
|
'as-unqualified-lower-maps (copy-var rs/as-unqualified-lower-maps rsns)
|
||||||
'as-maps-adapter (sci/copy-var rs/as-maps-adapter rsns)})
|
'as-maps-adapter (copy-var rs/as-maps-adapter rsns)})
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,9 @@
|
||||||
[clojure.tools.logging.impl :as impl]
|
[clojure.tools.logging.impl :as impl]
|
||||||
[clojure.tools.logging.readable]
|
[clojure.tools.logging.readable]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[taoensso.encore :as encore :refer [have]]
|
[taoensso.encore :as enc :refer [have]]
|
||||||
[taoensso.timbre :as timbre]))
|
[taoensso.timbre :as timbre]
|
||||||
|
[taoensso.timbre.appenders.core :as appenders]))
|
||||||
|
|
||||||
;;;; timbre
|
;;;; timbre
|
||||||
|
|
||||||
|
|
@ -12,80 +13,56 @@
|
||||||
|
|
||||||
(defn- fline [and-form] (:line (meta and-form)))
|
(defn- fline [and-form] (:line (meta and-form)))
|
||||||
|
|
||||||
(defonce callsite-counter
|
|
||||||
(encore/counter))
|
|
||||||
|
|
||||||
(defmacro log! ; Public wrapper around `-log!`
|
(defmacro log! ; Public wrapper around `-log!`
|
||||||
"Core low-level log macro. Useful for tooling/library authors, etc.
|
"Core low-level log macro. Useful for tooling, etc.
|
||||||
|
* `level` - must eval to a valid logging level
|
||||||
|
* `msg-type` - must eval to e/o #{:p :f nil}
|
||||||
|
* `opts` - ks e/o #{:config :?err :?ns-str :?file :?line :?base-data :spying?}
|
||||||
|
Supports compile-time elision when compile-time const vals
|
||||||
|
provided for `level` and/or `?ns-str`."
|
||||||
|
[level msg-type args & [opts]]
|
||||||
|
(have [:or nil? sequential?] args) ; To allow -> (delay [~@args])
|
||||||
|
(let [{:keys [?ns-str] :or {?ns-str (str @sci/ns)}} opts]
|
||||||
|
;; level, ns may/not be compile-time consts:
|
||||||
|
(when-not (timbre/-elide? level ?ns-str)
|
||||||
|
(let [{:keys [config ?err ?file ?line ?base-data spying?]
|
||||||
|
:or {config 'taoensso.timbre/*config*
|
||||||
|
?err :auto ; => Extract as err-type v0
|
||||||
|
?file @sci/file
|
||||||
|
;; NB waiting on CLJ-865:
|
||||||
|
?line (fline &form)}} opts
|
||||||
|
|
||||||
* `level` - must eval to a valid logging level
|
?file (when (not= ?file "NO_SOURCE_PATH") ?file)
|
||||||
* `msg-type` - must eval to e/o #{:p :f nil}
|
|
||||||
* `args` - arguments seq (ideally vec) for logging call
|
|
||||||
* `opts` - ks e/o #{:config ?err ?base-data spying?
|
|
||||||
:?ns-str :?file :?line :?column}
|
|
||||||
|
|
||||||
Supports compile-time elision when compile-time const vals
|
;; Identifies this particular macro expansion; note that this'll
|
||||||
provided for `level` and/or `?ns-str`.
|
;; be fixed for any fns wrapping `log!` (notably `tools.logging`,
|
||||||
|
;; `slf4j-timbre`, etc.):
|
||||||
|
callsite-id
|
||||||
|
(hash [level msg-type args ; Unevaluated args (arg forms)
|
||||||
|
?ns-str ?file ?line (rand)])]
|
||||||
|
|
||||||
Logging wrapper examples:
|
`(taoensso.timbre/-log! ~config ~level ~?ns-str ~?file ~?line ~msg-type ~?err
|
||||||
|
(delay [~@args]) ~?base-data ~callsite-id ~spying?)))))
|
||||||
(defn log-wrapper-fn [& args] (timbre/log! :info :p args))
|
|
||||||
(defmacro log-wrapper-macro [& args] (timbre/keep-callsite `(timbre/log! :info :p ~args)))"
|
|
||||||
|
|
||||||
([{:as opts
|
|
||||||
:keys [loc level msg-type args vargs
|
|
||||||
config ?err ?base-data spying?]
|
|
||||||
:or
|
|
||||||
{config 'taoensso.timbre/*config*
|
|
||||||
?err :auto}}]
|
|
||||||
|
|
||||||
(have [:or nil? sequential? symbol?] args)
|
|
||||||
(let [callsite-id (callsite-counter)
|
|
||||||
{:keys [line column]} (merge (meta &form) loc)
|
|
||||||
{:keys [ns file line column]} {:ns @sci/ns :file @sci/file :line line :column column}
|
|
||||||
ns (or (get opts :?ns-str) ns)
|
|
||||||
file (or (get opts :?file) file)
|
|
||||||
line (or (get opts :?line) line)
|
|
||||||
column (or (get opts :?column) column)
|
|
||||||
|
|
||||||
elide? (and #_(enc/const-forms? level ns) (timbre/-elide? level ns))]
|
|
||||||
|
|
||||||
(when-not elide?
|
|
||||||
(let [vargs-form
|
|
||||||
(or vargs
|
|
||||||
(if (symbol? args)
|
|
||||||
`(taoensso.timbre/-ensure-vec ~args)
|
|
||||||
`[ ~@args]))]
|
|
||||||
|
|
||||||
;; Note pre-resolved expansion
|
|
||||||
`(taoensso.timbre/-log! ~config ~level ~ns ~file ~line ~column ~msg-type ~?err
|
|
||||||
(delay ~vargs-form) ~?base-data ~callsite-id ~spying?
|
|
||||||
~(get opts :instant)
|
|
||||||
~(get opts :may-log?))))))
|
|
||||||
|
|
||||||
([level msg-type args & [opts]]
|
|
||||||
(let [{:keys [line column]} (merge (meta &form))
|
|
||||||
{:keys [ns file line column]} {:ns @sci/ns :file @sci/file :line line :column column}
|
|
||||||
loc {:ns ns :file file :line line :column column}
|
|
||||||
opts (assoc (conj {:loc loc} opts)
|
|
||||||
:level level, :msg-type msg-type, :args args)]
|
|
||||||
`(taoensso.timbre/log! ~opts))))
|
|
||||||
|
|
||||||
(defn make-ns [ns sci-ns ks]
|
(defn make-ns [ns sci-ns ks]
|
||||||
(reduce (fn [ns-map [var-name var]]
|
(reduce (fn [ns-map [var-name var]]
|
||||||
(let [m (meta var)
|
(let [m (meta var)
|
||||||
|
no-doc (:no-doc m)
|
||||||
doc (:doc m)
|
doc (:doc m)
|
||||||
arglists (:arglists m)]
|
arglists (:arglists m)]
|
||||||
(assoc ns-map var-name
|
(if no-doc ns-map
|
||||||
(sci/new-var (symbol var-name) @var
|
(assoc ns-map var-name
|
||||||
(cond-> {:ns sci-ns
|
(sci/new-var (symbol var-name) @var
|
||||||
:name (:name m)}
|
(cond-> {:ns sci-ns
|
||||||
(:macro m) (assoc :macro true)
|
:name (:name m)}
|
||||||
doc (assoc :doc doc)
|
(:macro m) (assoc :macro true)
|
||||||
arglists (assoc :arglists arglists))))))
|
doc (assoc :doc doc)
|
||||||
|
arglists (assoc :arglists arglists)))))))
|
||||||
{}
|
{}
|
||||||
(select-keys (ns-publics ns) ks)))
|
(select-keys (ns-publics ns) ks)))
|
||||||
|
|
||||||
|
(def atomic-println @#'appenders/atomic-println)
|
||||||
|
|
||||||
(defn println-appender
|
(defn println-appender
|
||||||
"Returns a simple `println` appender for Clojure/Script.
|
"Returns a simple `println` appender for Clojure/Script.
|
||||||
Use with ClojureScript requires that `cljs.core/*print-fn*` be set.
|
Use with ClojureScript requires that `cljs.core/*print-fn*` be set.
|
||||||
|
|
@ -115,7 +92,7 @@
|
||||||
:*err* @sci/err
|
:*err* @sci/err
|
||||||
stream)]
|
stream)]
|
||||||
(binding [*out* stream]
|
(binding [*out* stream]
|
||||||
(encore/println-atomic (force output_)))))}))
|
(atomic-println (force output_)))))}))
|
||||||
|
|
||||||
(def default-config (assoc-in timbre/*config* [:appenders :println]
|
(def default-config (assoc-in timbre/*config* [:appenders :println]
|
||||||
(println-appender {:stream :auto})))
|
(println-appender {:stream :auto})))
|
||||||
|
|
@ -128,7 +105,7 @@
|
||||||
|
|
||||||
(defn set-level! [level] (swap-config! (fn [m] (assoc m :min-level level))))
|
(defn set-level! [level] (swap-config! (fn [m] (assoc m :min-level level))))
|
||||||
|
|
||||||
(defn merge-config! [m] (swap-config! (fn [old] (encore/nested-merge old m))))
|
(defn merge-config! [m] (swap-config! (fn [old] (enc/nested-merge old m))))
|
||||||
|
|
||||||
(defmacro -log-and-rethrow-errors [?line & body]
|
(defmacro -log-and-rethrow-errors [?line & body]
|
||||||
`(try (do ~@body)
|
`(try (do ~@body)
|
||||||
|
|
@ -143,27 +120,14 @@
|
||||||
'info 'infof 'warn 'warnf
|
'info 'infof 'warn 'warnf
|
||||||
'error 'errorf
|
'error 'errorf
|
||||||
'-log! 'with-level
|
'-log! 'with-level
|
||||||
'spit-appender '-spy 'spy
|
'spit-appender '-spy 'spy])
|
||||||
'color-str])
|
|
||||||
'log! (sci/copy-var log! tns)
|
'log! (sci/copy-var log! tns)
|
||||||
'*config* config
|
'*config* config
|
||||||
'swap-config! (sci/copy-var swap-config! tns)
|
'swap-config! (sci/copy-var swap-config! tns)
|
||||||
'merge-config! (sci/copy-var merge-config! tns)
|
'merge-config! (sci/copy-var merge-config! tns)
|
||||||
'set-level! (sci/copy-var set-level! tns)
|
'set-level! (sci/copy-var set-level! tns)
|
||||||
'println-appender (sci/copy-var println-appender tns)
|
'println-appender (sci/copy-var println-appender tns)
|
||||||
'-log-and-rethrow-errors (sci/copy-var -log-and-rethrow-errors tns)
|
'-log-and-rethrow-errors (sci/copy-var -log-and-rethrow-errors tns)))
|
||||||
'-ensure-vec (sci/copy-var encore/ensure-vec tns)))
|
|
||||||
|
|
||||||
(def enc-ns (sci/create-ns 'taoensso.encore))
|
|
||||||
|
|
||||||
(def encore-namespace
|
|
||||||
{'catching (sci/copy-var encore/catching enc-ns)
|
|
||||||
'try* (sci/copy-var encore/try* enc-ns)})
|
|
||||||
|
|
||||||
(def timbre-appenders-namespace
|
|
||||||
(let [tan (sci/create-ns 'taoensso.timbre.appenders.core nil)]
|
|
||||||
{'println-appender (sci/copy-var println-appender tan)
|
|
||||||
'spit-appender (sci/copy-var #_:clj-kondo/ignore timbre/spit-appender tan)}))
|
|
||||||
|
|
||||||
;;;; clojure.tools.logging
|
;;;; clojure.tools.logging
|
||||||
|
|
||||||
|
|
@ -196,7 +160,7 @@
|
||||||
#'clojure.tools.logging/*logger-factory*
|
#'clojure.tools.logging/*logger-factory*
|
||||||
(fn [_]
|
(fn [_]
|
||||||
(LoggerFactory.
|
(LoggerFactory.
|
||||||
(encore/memoize (fn [logger-ns] (Logger. (str logger-ns) config))))))
|
(enc/memoize (fn [logger-ns] (Logger. (str logger-ns) config))))))
|
||||||
|
|
||||||
(def lns (sci/create-ns 'clojure.tools.logging nil))
|
(def lns (sci/create-ns 'clojure.tools.logging nil))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
[babashka.impl.common :refer [ctx]]
|
[babashka.impl.common :refer [ctx]]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[selmer.filters :as filters]
|
[selmer.filters :as filters]
|
||||||
[selmer.filter-parser :as fp]
|
|
||||||
[selmer.parser]
|
[selmer.parser]
|
||||||
[selmer.tags :as tags]
|
[selmer.tags :as tags]
|
||||||
[selmer.util :as util]
|
[selmer.util :as util]
|
||||||
|
|
@ -61,7 +60,7 @@
|
||||||
(selmer.parser/render-template template context-map)))
|
(selmer.parser/render-template template context-map)))
|
||||||
|
|
||||||
(defn sci-ns-resolve [ns fqs]
|
(defn sci-ns-resolve [ns fqs]
|
||||||
(sci/eval-form (ctx) (list 'clojure.core/ns-resolve ns (list 'quote fqs))))
|
(sci/eval-form @ctx (list 'clojure.core/ns-resolve ns (list 'quote fqs))))
|
||||||
|
|
||||||
(defn force! [x]
|
(defn force! [x]
|
||||||
(if (instance? clojure.lang.IDeref x) @x x))
|
(if (instance? clojure.lang.IDeref x) @x x))
|
||||||
|
|
@ -84,31 +83,12 @@
|
||||||
(apply merge)
|
(apply merge)
|
||||||
(selmer.parser/render ~s)))
|
(selmer.parser/render ~s)))
|
||||||
|
|
||||||
(defn resolve-arg
|
|
||||||
"Resolves an arg as passed to an add-tag! handler using the provided
|
|
||||||
context-map.
|
|
||||||
|
|
||||||
A custom tag handler will receive a seq of args as its first argument.
|
|
||||||
With this function, you can selectively resolve one or more of those args
|
|
||||||
so that if they contain literals, the literal value is returned, and if they
|
|
||||||
contain templates of any sort, which can itself have variables, filters or
|
|
||||||
tags in it, they will be returned resolved, applied and rendered.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
(resolve-arg {{header-name|upper}} {:header-name \"My Page\"})
|
|
||||||
=> \"MY PAGE\""
|
|
||||||
[arg context-map]
|
|
||||||
(if (fp/literal? arg)
|
|
||||||
(fp/parse-literal arg)
|
|
||||||
(render arg context-map)))
|
|
||||||
|
|
||||||
(def selmer-parser-namespace
|
(def selmer-parser-namespace
|
||||||
(-> selmer-parser-ns
|
(-> selmer-parser-ns
|
||||||
(assoc 'render-file (sci/copy-var render-file spns)
|
(assoc 'render-file (sci/copy-var render-file spns)
|
||||||
'render (sci/copy-var render spns)
|
'render (sci/copy-var render spns)
|
||||||
'render-template (sci/copy-var render-template spns)
|
'render-template (sci/copy-var render-template spns)
|
||||||
'resolve-var-from-kw (sci/copy-var resolve-var-from-kw spns)
|
'resolve-var-from-kw (sci/copy-var resolve-var-from-kw spns)
|
||||||
'resolve-arg (sci/copy-var resolve-arg spns )
|
|
||||||
'<< (sci/copy-var << spns))))
|
'<< (sci/copy-var << spns))))
|
||||||
|
|
||||||
(def stns (sci/create-ns 'selmer.tags nil))
|
(def stns (sci/create-ns 'selmer.tags nil))
|
||||||
|
|
@ -125,9 +105,7 @@
|
||||||
|
|
||||||
(def selmer-filters-namespace
|
(def selmer-filters-namespace
|
||||||
{'add-filter! (sci/copy-var filters/add-filter! sfns)
|
{'add-filter! (sci/copy-var filters/add-filter! sfns)
|
||||||
'remove-filter! (sci/copy-var filters/remove-filter! sfns)
|
'remove-filter! (sci/copy-var filters/remove-filter! sfns)})
|
||||||
'get-filter (sci/copy-var filters/get-filter sfns)
|
|
||||||
'filters (sci/copy-var filters/filters sfns)})
|
|
||||||
|
|
||||||
(defn turn-off-escaping! []
|
(defn turn-off-escaping! []
|
||||||
(sci/alter-var-root escape-variables (constantly false)))
|
(sci/alter-var-root escape-variables (constantly false)))
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@
|
||||||
#_(assert (<= (count ans)) (pr-str ans))
|
#_(assert (<= (count ans)) (pr-str ans))
|
||||||
(let [xn (xml/uri-symbol n)
|
(let [xn (xml/uri-symbol n)
|
||||||
al (symbol (clj-ns-name a))]
|
al (symbol (clj-ns-name a))]
|
||||||
(sci/eval-form (ctx) `(create-ns (quote ~xn)))
|
(sci/eval-form @ctx `(create-ns (quote ~xn)))
|
||||||
(sci/eval-form (ctx) `(alias (quote ~al) (quote ~xn)))
|
(sci/eval-form @ctx `(alias (quote ~al) (quote ~xn)))
|
||||||
(recur rst)))))
|
(recur rst)))))
|
||||||
|
|
||||||
(def xml-namespace
|
(def xml-namespace
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,9 @@
|
||||||
(ns babashka.impl.ordered
|
(ns babashka.impl.ordered
|
||||||
{:no-doc true}
|
{:no-doc true}
|
||||||
(:require [flatland.ordered.map :as omap]
|
(:require [flatland.ordered.map :as omap]
|
||||||
[flatland.ordered.set :as oset]
|
|
||||||
[sci.core :as sci]))
|
[sci.core :as sci]))
|
||||||
|
|
||||||
(def omap-ns (sci/create-ns 'flatland.ordered.map nil))
|
(def omap-ns (sci/create-ns 'flatland.ordered.map nil))
|
||||||
(def oset-ns (sci/create-ns 'flatland.ordered.set nil))
|
|
||||||
|
|
||||||
(def ordered-map-ns
|
(def ordered-map-ns
|
||||||
{'ordered-map (sci/copy-var omap/ordered-map omap-ns)})
|
{'ordered-map (sci/copy-var omap/ordered-map omap-ns)})
|
||||||
|
|
||||||
(def ordered-set-ns
|
|
||||||
{'ordered-set (sci/copy-var oset/ordered-set oset-ns)})
|
|
||||||
|
|
|
||||||
2
fs
2
fs
|
|
@ -1 +1 @@
|
||||||
Subproject commit fdd5780bc4df4931332b56082c6c3a5c3c85066d
|
Subproject commit 75bdf5aa42a8a34e4e38279f79d761887dc46847
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
// This file is mostly a workaround for https://github.com/oracle/graal/issues/1956
|
|
||||||
|
|
||||||
package babashka.impl;
|
|
||||||
|
|
||||||
import java.util.WeakHashMap;
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.net.*;
|
|
||||||
import java.util.jar.*;
|
|
||||||
|
|
||||||
public class URLClassLoader extends java.net.URLClassLoader implements Closeable {
|
|
||||||
|
|
||||||
private WeakHashMap<Closeable,Void>
|
|
||||||
closeables = new WeakHashMap<>();
|
|
||||||
|
|
||||||
public URLClassLoader(java.net.URL[] urls) {
|
|
||||||
super(urls);
|
|
||||||
}
|
|
||||||
|
|
||||||
public URLClassLoader(java.net.URL[] urls, java.net.URLClassLoader parent) {
|
|
||||||
super(urls, parent);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void _addURL(java.net.URL url) {
|
|
||||||
super.addURL(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
// calling super.getResource() returned nil in native-image
|
|
||||||
public java.net.URL getResource(String name) {
|
|
||||||
return findResource(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// calling super.getResourceAsStream() returned nil in native-image
|
|
||||||
public InputStream getResourceAsStream(String name) {
|
|
||||||
Objects.requireNonNull(name);
|
|
||||||
URL url = getResource(name);
|
|
||||||
try {
|
|
||||||
if (url == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
URLConnection urlc = url.openConnection();
|
|
||||||
InputStream is = urlc.getInputStream();
|
|
||||||
if (urlc instanceof JarURLConnection) {
|
|
||||||
JarFile jar = ((JarURLConnection)urlc).getJarFile();
|
|
||||||
synchronized (closeables) {
|
|
||||||
if (!closeables.containsKey(jar)) {
|
|
||||||
closeables.put(jar, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
synchronized (closeables) {
|
|
||||||
closeables.put(is, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return is;
|
|
||||||
} catch (IOException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public java.util.Enumeration<java.net.URL> getResources(String name) throws java.io.IOException {
|
|
||||||
return findResources(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void close() throws IOException {
|
|
||||||
super.close();
|
|
||||||
|
|
||||||
java.util.List<IOException> errors = new java.util.ArrayList<IOException>();
|
|
||||||
|
|
||||||
synchronized (closeables) {
|
|
||||||
java.util.Set<Closeable> keys = closeables.keySet();
|
|
||||||
for (Closeable c : keys) {
|
|
||||||
try {
|
|
||||||
c.close();
|
|
||||||
} catch (IOException ex) {
|
|
||||||
errors.add(ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
closeables.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (errors.isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IOException firstEx = errors.remove(0);
|
|
||||||
|
|
||||||
for (IOException error: errors) {
|
|
||||||
firstEx.addSuppressed(error);
|
|
||||||
}
|
|
||||||
throw firstEx;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
58
install
58
install
|
|
@ -8,7 +8,6 @@ static_binary="false"
|
||||||
default_install_dir="/usr/local/bin"
|
default_install_dir="/usr/local/bin"
|
||||||
install_dir="$default_install_dir"
|
install_dir="$default_install_dir"
|
||||||
download_dir=""
|
download_dir=""
|
||||||
dev_build=""
|
|
||||||
|
|
||||||
print_help() {
|
print_help() {
|
||||||
echo "Installs latest (or specific) version of babashka. Installation directory defaults to /usr/local/bin."
|
echo "Installs latest (or specific) version of babashka. Installation directory defaults to /usr/local/bin."
|
||||||
|
|
@ -29,32 +28,6 @@ print_help() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
has() {
|
|
||||||
command -v "$1" >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch() {
|
|
||||||
local url=$1
|
|
||||||
local outfile=${2:-}
|
|
||||||
|
|
||||||
if has wget; then
|
|
||||||
if [[ -n $outfile ]]; then
|
|
||||||
wget -qO "$outfile" "$url"
|
|
||||||
else
|
|
||||||
wget -qO - "$url"
|
|
||||||
fi
|
|
||||||
elif has curl; then
|
|
||||||
if [[ -n $outfile ]]; then
|
|
||||||
curl -fsSL "$url" -o "$outfile"
|
|
||||||
else
|
|
||||||
curl -fsSL "$url"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
>&2 echo "Either 'wget' or 'curl' needs to be on PATH!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]
|
while [[ $# -gt 0 ]]
|
||||||
do
|
do
|
||||||
key="$1"
|
key="$1"
|
||||||
|
|
@ -83,10 +56,6 @@ do
|
||||||
static_binary="true"
|
static_binary="true"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--dev-build)
|
|
||||||
dev_build="true"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*) # unknown option
|
*) # unknown option
|
||||||
print_help
|
print_help
|
||||||
shift
|
shift
|
||||||
|
|
@ -105,11 +74,7 @@ if [[ "$checksum" != "" ]] && [[ "$version" == "" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$version" == "" ]]; then
|
if [[ "$version" == "" ]]; then
|
||||||
if [[ "$dev_build" == "true" ]]; then
|
version="$(curl -sL https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_RELEASED_VERSION)"
|
||||||
version="$(fetch https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_VERSION)"
|
|
||||||
else
|
|
||||||
version="$(fetch https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_RELEASED_VERSION)"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$(uname -s)" in
|
case "$(uname -s)" in
|
||||||
|
|
@ -122,23 +87,14 @@ IFS='.' read -ra VER <<< "${version//-SNAPSHOT/}"
|
||||||
vernum=$(printf "%03d%03d%03d" "${VER[0]}" "${VER[1]}" "${VER[2]}")
|
vernum=$(printf "%03d%03d%03d" "${VER[0]}" "${VER[1]}" "${VER[2]}")
|
||||||
|
|
||||||
case "$(uname -m)" in
|
case "$(uname -m)" in
|
||||||
aarch64) arch=aarch64
|
aarch64) arch=aarch64;;
|
||||||
if [[ "$platform" == "linux" ]]; then
|
|
||||||
static_binary="true"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
arm64) if [[ 10#$vernum -le 10#000008002 ]]; then
|
arm64) if [[ 10#$vernum -le 10#000008002 ]]; then
|
||||||
arch="amd64"
|
arch="amd64"
|
||||||
else
|
else
|
||||||
arch="aarch64"
|
arch="aarch64"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*) arch=amd64
|
*) arch=amd64;;
|
||||||
# always use static image on linux
|
|
||||||
if [[ "$platform" == "linux" ]]; then
|
|
||||||
static_binary="true"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ 10#$vernum -le 10#000002013 ]]; then
|
if [[ 10#$vernum -le 10#000002013 ]]; then
|
||||||
|
|
@ -169,10 +125,10 @@ fi
|
||||||
download_url="https://github.com/babashka/$repo/releases/download/v$version/$filename"
|
download_url="https://github.com/babashka/$repo/releases/download/v$version/$filename"
|
||||||
|
|
||||||
# macOS only have shasum available by default
|
# macOS only have shasum available by default
|
||||||
# Some Linux distros (RHEL-like) only have sha256sum available by default (others have both)
|
# Some Linux distros (RHEL-like) only have sha256sum avaiable by default (others have both)
|
||||||
if has sha256sum; then
|
if command -v sha256sum >/dev/null; then
|
||||||
sha256sum_cmd="sha256sum"
|
sha256sum_cmd="sha256sum"
|
||||||
elif has shasum; then
|
elif command -v shasum >/dev/null; then
|
||||||
sha256sum_cmd="shasum -a 256"
|
sha256sum_cmd="shasum -a 256"
|
||||||
else
|
else
|
||||||
>&2 echo "Either 'sha256sum' or 'shasum' needs to be on PATH for '--checksum' flag!"
|
>&2 echo "Either 'sha256sum' or 'shasum' needs to be on PATH for '--checksum' flag!"
|
||||||
|
|
@ -185,7 +141,7 @@ mkdir -p "$download_dir" && (
|
||||||
cd "$download_dir"
|
cd "$download_dir"
|
||||||
echo -e "Downloading $download_url to $download_dir"
|
echo -e "Downloading $download_url to $download_dir"
|
||||||
|
|
||||||
fetch "$download_url" "$filename"
|
curl -o "$filename" -sL "$download_url"
|
||||||
if [[ -n "$checksum" ]]; then
|
if [[ -n "$checksum" ]]; then
|
||||||
if ! echo "$checksum *$filename" | $sha256sum_cmd --check --status; then
|
if ! echo "$checksum *$filename" | $sha256sum_cmd --check --status; then
|
||||||
>&2 echo "Failed checksum on $filename"
|
>&2 echo "Failed checksum on $filename"
|
||||||
|
|
|
||||||
2
pods
2
pods
|
|
@ -1 +1 @@
|
||||||
Subproject commit 717cef7af5cb1c1b091bd10e012b2e71b7b8b9bc
|
Subproject commit 951a6297d18da7d0ee60def06812141e0ce7fbb2
|
||||||
2
process
2
process
|
|
@ -1 +1 @@
|
||||||
Subproject commit 2058c79fb63f80ca71917432eddea73e0c58717c
|
Subproject commit f6a31466fdd76d5f74f701c0aa88af52e56f7fd4
|
||||||
54
project.clj
54
project.clj
|
|
@ -11,41 +11,35 @@
|
||||||
"babashka.core/src"
|
"babashka.core/src"
|
||||||
"babashka.nrepl/src" "depstar/src" "process/src"
|
"babashka.nrepl/src" "depstar/src" "process/src"
|
||||||
"deps.clj/src" "deps.clj/resources"
|
"deps.clj/src" "deps.clj/resources"
|
||||||
"impl-java/src"]
|
"reify/src"]
|
||||||
;; for debugging Reflector.java code:
|
;; for debugging Reflector.java code:
|
||||||
;; :java-source-paths ["sci/reflector/src-java"]
|
;; :java-source-paths ["sci/reflector/src-java"]
|
||||||
:java-source-paths ["src-java"]
|
:java-source-paths ["src-java"]
|
||||||
:resource-paths ["resources" "sci/resources"]
|
:resource-paths ["resources" "sci/resources"]
|
||||||
:test-selectors {:default (complement (some-fn :windows-only :flaky))
|
:test-selectors {:default (complement :windows-only)
|
||||||
:windows (complement (some-fn :skip-windows :flaky))
|
:windows (complement :skip-windows)}
|
||||||
:non-flaky (complement :flaky)
|
:dependencies [[org.clojure/clojure "1.11.1"]
|
||||||
:flaky :flaky}
|
[borkdude/edamame "1.0.0"]
|
||||||
:jvm-opts ["--enable-preview"]
|
[borkdude/graal.locking "0.0.2"]
|
||||||
:dependencies [[org.clojure/clojure "1.12.0"]
|
|
||||||
[borkdude/edamame "1.4.30"]
|
|
||||||
[org.clojure/tools.cli "1.0.214"]
|
[org.clojure/tools.cli "1.0.214"]
|
||||||
[cheshire "6.0.0"]
|
[cheshire "5.11.0"]
|
||||||
[nrepl/bencode "1.2.0"]
|
[nrepl/bencode "1.1.0"]
|
||||||
[borkdude/sci.impl.reflector "0.0.4"]
|
[borkdude/sci.impl.reflector "0.0.1"]
|
||||||
[org.babashka/sci.impl.types "0.0.2"]
|
[org.babashka/sci.impl.types "0.0.2"]
|
||||||
[org.babashka/babashka.impl.java "0.1.10"]
|
[org.babashka/babashka.impl.reify "0.1.3"]
|
||||||
[org.clojure/core.async "1.8.741"]
|
[org.clojure/core.async "1.5.648"]
|
||||||
[org.clojure/test.check "1.1.1"]
|
[org.clojure/test.check "1.1.1"]
|
||||||
[com.github.clj-easy/graal-build-time "0.1.0"]
|
[com.github.clj-easy/graal-build-time "0.1.0"]
|
||||||
[rewrite-clj/rewrite-clj "1.1.49"]
|
[rewrite-clj/rewrite-clj "1.1.45"]
|
||||||
[insn/insn "0.5.2"]
|
[insn/insn "0.5.2"]
|
||||||
[org.babashka/cli "0.8.65"]
|
[org.babashka/cli "0.5.40"]]
|
||||||
[org.babashka/http-client "0.4.22"]
|
|
||||||
[org.jsoup/jsoup "1.20.1"]
|
|
||||||
[borkdude/graal.locking "0.0.2"]]
|
|
||||||
:plugins [[org.kipz/lein-meta-bom "0.1.1"]]
|
:plugins [[org.kipz/lein-meta-bom "0.1.1"]]
|
||||||
:metabom {:jar-name "metabom.jar"}
|
:metabom {:jar-name "metabom.jar"}
|
||||||
:profiles {:feature/xml {:source-paths ["feature-xml"]
|
:profiles {:feature/xml {:source-paths ["feature-xml"]
|
||||||
:dependencies [[org.clojure/data.xml "0.2.0-alpha8"]]}
|
:dependencies [[org.clojure/data.xml "0.2.0-alpha8"]]}
|
||||||
:feature/yaml {:source-paths ["feature-yaml"]
|
:feature/yaml {:source-paths ["feature-yaml"]
|
||||||
:dependencies [[clj-commons/clj-yaml "1.0.29"
|
:dependencies [[clj-commons/clj-yaml "0.7.169"
|
||||||
:exclusions [org.flatland/ordered]#_#_clj-commons/clj-yaml "0.7.110"]
|
#_#_clj-commons/clj-yaml "0.7.110"]]}
|
||||||
[org.flatland/ordered "1.15.12"]]}
|
|
||||||
:feature/jdbc {:source-paths ["feature-jdbc"]
|
:feature/jdbc {:source-paths ["feature-jdbc"]
|
||||||
:dependencies [[seancorfield/next.jdbc "1.1.610"]]}
|
:dependencies [[seancorfield/next.jdbc "1.1.610"]]}
|
||||||
:feature/sqlite [:feature/jdbc {:dependencies [[org.xerial/sqlite-jdbc "3.36.0.3"]]}]
|
:feature/sqlite [:feature/jdbc {:dependencies [[org.xerial/sqlite-jdbc "3.36.0.3"]]}]
|
||||||
|
|
@ -56,25 +50,25 @@
|
||||||
:feature/csv {:source-paths ["feature-csv"]
|
:feature/csv {:source-paths ["feature-csv"]
|
||||||
:dependencies [[org.clojure/data.csv "1.0.0"]]}
|
:dependencies [[org.clojure/data.csv "1.0.0"]]}
|
||||||
:feature/transit {:source-paths ["feature-transit"]
|
:feature/transit {:source-paths ["feature-transit"]
|
||||||
:dependencies [[com.cognitect/transit-clj "1.0.333"]]}
|
:dependencies [[com.cognitect/transit-clj "1.0.329"]]}
|
||||||
:feature/datascript {:source-paths ["feature-datascript"]
|
:feature/datascript {:source-paths ["feature-datascript"]
|
||||||
:dependencies [[datascript "1.3.10"]]}
|
:dependencies [[datascript "1.3.10"]]}
|
||||||
:feature/httpkit-client {:source-paths ["feature-httpkit-client"]
|
:feature/httpkit-client {:source-paths ["feature-httpkit-client"]
|
||||||
:dependencies [[http-kit "2.8.0-RC1"]]}
|
:dependencies [[http-kit "2.6.0-RC1"]]}
|
||||||
:feature/httpkit-server {:source-paths ["feature-httpkit-server"]
|
:feature/httpkit-server {:source-paths ["feature-httpkit-server"]
|
||||||
:dependencies [[http-kit "2.8.0-RC1"]]}
|
:dependencies [[http-kit "2.6.0-RC1"]]}
|
||||||
:feature/lanterna {:source-paths ["feature-lanterna"]
|
:feature/lanterna {:source-paths ["feature-lanterna"]
|
||||||
:dependencies [[babashka/clojure-lanterna "0.9.8-SNAPSHOT"]]}
|
:dependencies [[babashka/clojure-lanterna "0.9.8-SNAPSHOT"]]}
|
||||||
:feature/core-match {:source-paths ["feature-core-match"]
|
:feature/core-match {:source-paths ["feature-core-match"]
|
||||||
:dependencies [[org.clojure/core.match "1.0.0"]]}
|
:dependencies [[org.clojure/core.match "1.0.0"]]}
|
||||||
:feature/hiccup {:source-paths ["feature-hiccup"]
|
:feature/hiccup {:source-paths ["feature-hiccup"]
|
||||||
:dependencies [[hiccup/hiccup "2.0.0-RC1"]]}
|
:dependencies [[hiccup/hiccup "2.0.0-alpha2"]]}
|
||||||
:feature/test-check {:source-paths ["feature-test-check"]}
|
:feature/test-check {:source-paths ["feature-test-check"]}
|
||||||
:feature/spec-alpha {:source-paths ["feature-spec-alpha"]}
|
:feature/spec-alpha {:source-paths ["feature-spec-alpha"]}
|
||||||
:feature/selmer {:source-paths ["feature-selmer"]
|
:feature/selmer {:source-paths ["feature-selmer"]
|
||||||
:dependencies [[selmer/selmer "1.12.59"]]}
|
:dependencies [[selmer/selmer "1.12.50"]]}
|
||||||
:feature/logging {:source-paths ["feature-logging"]
|
:feature/logging {:source-paths ["feature-logging"]
|
||||||
:dependencies [[com.taoensso/timbre "6.6.0"]
|
:dependencies [[com.taoensso/timbre "5.2.1"]
|
||||||
[org.clojure/tools.logging "1.1.0"]]}
|
[org.clojure/tools.logging "1.1.0"]]}
|
||||||
:feature/priority-map {:source-paths ["feature-priority-map"]
|
:feature/priority-map {:source-paths ["feature-priority-map"]
|
||||||
:dependencies [[org.clojure/data.priority-map "1.1.0"]]}
|
:dependencies [[org.clojure/data.priority-map "1.1.0"]]}
|
||||||
|
|
@ -98,10 +92,8 @@
|
||||||
:feature/logging
|
:feature/logging
|
||||||
:feature/priority-map
|
:feature/priority-map
|
||||||
:feature/rrb-vector
|
:feature/rrb-vector
|
||||||
{:dependencies [[borkdude/rewrite-edn "0.4.6"]
|
{:dependencies [[com.clojure-goes-fast/clj-async-profiler "0.5.0"]
|
||||||
[com.clojure-goes-fast/clj-async-profiler "0.5.0"]
|
[com.opentable.components/otj-pg-embedded "0.13.3"]]}]
|
||||||
[com.opentable.components/otj-pg-embedded "0.13.3"]
|
|
||||||
[nubank/matcher-combinators "3.6.0"]]}]
|
|
||||||
:uberjar {:global-vars {*assert* false}
|
:uberjar {:global-vars {*assert* false}
|
||||||
:jvm-opts ["-Dclojure.compiler.direct-linking=true"
|
:jvm-opts ["-Dclojure.compiler.direct-linking=true"
|
||||||
"-Dclojure.spec.skip-macros=true"
|
"-Dclojure.spec.skip-macros=true"
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
(:require [build.reify2 :as reify2]
|
(:require [build.reify2 :as reify2]
|
||||||
[clojure.tools.build.api :as b]))
|
[clojure.tools.build.api :as b]))
|
||||||
|
|
||||||
(def lib 'org.babashka/babashka.impl.java)
|
(def lib 'org.babashka/babashka.impl.reify)
|
||||||
(def version "0.1.10")
|
(def version "0.1.3")
|
||||||
(def class-dir "target/classes")
|
(def class-dir "target/classes")
|
||||||
(def basis (b/create-basis {:project "deps.edn"}))
|
(def basis (b/create-basis {:project "deps.edn"}))
|
||||||
(def jar-file (format "target/%s-%s.jar" (name lib) version))
|
(def jar-file (format "target/%s-%s.jar" (name lib) version))
|
||||||
|
|
@ -14,25 +14,13 @@
|
||||||
(defn gen-classes [_]
|
(defn gen-classes [_]
|
||||||
(reify2/gen-classes nil))
|
(reify2/gen-classes nil))
|
||||||
|
|
||||||
(defn compile-java [_]
|
|
||||||
(b/javac {:src-dirs ["src-java"]
|
|
||||||
:class-dir class-dir
|
|
||||||
:basis basis
|
|
||||||
:javac-opts ["--release" "8"]}))
|
|
||||||
|
|
||||||
(defn jar [_]
|
(defn jar [_]
|
||||||
(compile-java nil)
|
|
||||||
(gen-classes nil)
|
(gen-classes nil)
|
||||||
(b/write-pom {:class-dir class-dir
|
(b/write-pom {:class-dir class-dir
|
||||||
:lib lib
|
:lib lib
|
||||||
:version version
|
:version version
|
||||||
:basis basis
|
:basis basis
|
||||||
:src-dirs ["src"]
|
:src-dirs ["src"]})
|
||||||
:pom-data
|
|
||||||
[[:licenses
|
|
||||||
[:license
|
|
||||||
[:name "MIT License"]
|
|
||||||
[:url "https://opensource.org/license/mit/"]]]]})
|
|
||||||
(b/copy-dir {:src-dirs ["src"]
|
(b/copy-dir {:src-dirs ["src"]
|
||||||
:target-dir class-dir})
|
:target-dir class-dir})
|
||||||
(b/jar {:class-dir class-dir
|
(b/jar {:class-dir class-dir
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
:aliases
|
:aliases
|
||||||
{:build ;; added by neil
|
{:build ;; added by neil
|
||||||
{:paths ["." "build" "src"]
|
{:paths ["." "build" "src"]
|
||||||
:deps {io.github.clojure/tools.build {:git/tag "v0.9.6" :git/sha "8e78bcc"}
|
:deps {io.github.clojure/tools.build {:git/tag "v0.8.1" :git/sha "7d40500"}
|
||||||
slipset/deps-deploy {:mvn/version "0.2.0"}
|
slipset/deps-deploy {:mvn/version "0.2.0"}
|
||||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||||
;; insn/insn {:mvn/version "0.5.3"}
|
;; insn/insn {:mvn/version "0.5.3"}
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
(ns babashka.impl.reify2.interfaces)
|
(ns babashka.impl.reify2.interfaces)
|
||||||
|
|
||||||
(def interfaces [java.nio.file.FileVisitor
|
(def interfaces [java.nio.file.FileVisitor
|
||||||
java.nio.file.DirectoryStream$Filter
|
|
||||||
java.io.FileFilter
|
java.io.FileFilter
|
||||||
java.io.FilenameFilter
|
java.io.FilenameFilter
|
||||||
clojure.lang.Associative
|
clojure.lang.Associative
|
||||||
|
|
@ -32,7 +31,4 @@
|
||||||
java.lang.Comparable
|
java.lang.Comparable
|
||||||
javax.net.ssl.X509TrustManager
|
javax.net.ssl.X509TrustManager
|
||||||
clojure.lang.LispReader$Resolver
|
clojure.lang.LispReader$Resolver
|
||||||
sun.misc.SignalHandler
|
sun.misc.SignalHandler])
|
||||||
java.util.concurrent.ThreadFactory
|
|
||||||
java.lang.Thread$UncaughtExceptionHandler
|
|
||||||
java.util.concurrent.Callable])
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
1.12.200
|
0.10.163
|
||||||
|
|
@ -1 +1 @@
|
||||||
1.12.201-SNAPSHOT
|
0.10.164-SNAPSHOT
|
||||||
|
|
@ -17,42 +17,40 @@
|
||||||
"depstar/src" "process/src"
|
"depstar/src" "process/src"
|
||||||
"deps.clj/src" "deps.clj/resources"
|
"deps.clj/src" "deps.clj/resources"
|
||||||
"resources" "sci/resources"
|
"resources" "sci/resources"
|
||||||
"impl-java/src"],
|
"reify/src"],
|
||||||
:deps {org.clojure/clojure {:mvn/version "1.12.0"},
|
:deps {org.clojure/clojure {:mvn/version "1.11.1"},
|
||||||
org.babashka/sci {:local/root "sci"}
|
org.babashka/sci {:local/root "sci"}
|
||||||
org.babashka/babashka.impl.java {:mvn/version "0.1.10"}
|
org.babashka/babashka.impl.reify {:mvn/version "0.1.3"}
|
||||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||||
babashka/babashka.curl {:local/root "babashka.curl"}
|
babashka/babashka.curl {:local/root "babashka.curl"}
|
||||||
babashka/fs {:local/root "fs"}
|
babashka/fs {:local/root "fs"}
|
||||||
babashka/babashka.core {:local/root "babashka.core"}
|
babashka/babashka.core {:local/root "babashka.core"}
|
||||||
org.clojure/core.async {:mvn/version "1.8.741"},
|
borkdude/graal.locking {:mvn/version "0.0.2"},
|
||||||
org.clojure/tools.cli {:mvn/version "1.0.214"},
|
org.clojure/core.async {:mvn/version "1.5.648"},
|
||||||
|
org.clojure/tools.cli {:mvn/version "1.0.206"},
|
||||||
org.clojure/data.csv {:mvn/version "1.0.0"},
|
org.clojure/data.csv {:mvn/version "1.0.0"},
|
||||||
cheshire/cheshire {:mvn/version "6.0.0"}
|
cheshire/cheshire {:mvn/version "5.11.0"}
|
||||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha8"}
|
org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}
|
||||||
clj-commons/clj-yaml {:mvn/version "1.0.29"}
|
clj-commons/clj-yaml {:mvn/version "0.7.109"}
|
||||||
com.cognitect/transit-clj {:mvn/version "1.0.333"}
|
com.cognitect/transit-clj {:mvn/version "1.0.329"}
|
||||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||||
nrepl/bencode {:mvn/version "1.2.0"}
|
nrepl/bencode {:mvn/version "1.1.0"}
|
||||||
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
||||||
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
||||||
org.hsqldb/hsqldb {:mvn/version "2.5.1"}
|
org.hsqldb/hsqldb {:mvn/version "2.5.1"}
|
||||||
datascript/datascript {:mvn/version "1.0.1"}
|
datascript/datascript {:mvn/version "1.0.1"}
|
||||||
http-kit/http-kit {:mvn/version "2.8.0-RC1"}
|
http-kit/http-kit {:mvn/version "2.6.0-RC1"}
|
||||||
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-RC1"}
|
hiccup/hiccup {:mvn/version "2.0.0-alpha2"}
|
||||||
rewrite-clj/rewrite-clj {:mvn/version "1.1.49"}
|
rewrite-clj/rewrite-clj {:mvn/version "1.1.45"}
|
||||||
selmer/selmer {:mvn/version "1.12.59"}
|
selmer/selmer {:mvn/version "1.12.50"}
|
||||||
com.taoensso/timbre {:mvn/version "6.6.0"}
|
com.taoensso/timbre {:mvn/version "5.2.1"}
|
||||||
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
||||||
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
||||||
insn/insn {:mvn/version "0.5.2"}
|
insn/insn {:mvn/version "0.5.2"}
|
||||||
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
||||||
org.babashka/cli {:mvn/version "0.8.65"}
|
org.babashka/cli {:mvn/version "0.3.35"}}
|
||||||
org.babashka/http-client {:mvn/version "0.4.22"}
|
|
||||||
org.flatland/ordered {:mvn/version "1.15.12"}
|
|
||||||
org.jsoup/jsoup {:mvn/version "1.20.1"}}
|
|
||||||
:aliases {:babashka/dev
|
:aliases {:babashka/dev
|
||||||
{:main-opts ["-m" "babashka.main"]}
|
{:main-opts ["-m" "babashka.main"]}
|
||||||
:profile
|
:profile
|
||||||
|
|
@ -65,8 +63,8 @@
|
||||||
:lib-tests
|
:lib-tests
|
||||||
{:extra-paths ["process/src" "process/test" "test-resources/lib_tests"]
|
{:extra-paths ["process/src" "process/test" "test-resources/lib_tests"]
|
||||||
:extra-deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}
|
:extra-deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}
|
||||||
#_#_org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
||||||
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
||||||
lambdaisland/regal {:mvn/version "0.0.143"}
|
lambdaisland/regal {:mvn/version "0.0.143"}
|
||||||
cprop/cprop {:mvn/version "0.1.16"}
|
cprop/cprop {:mvn/version "0.1.16"}
|
||||||
comb/comb {:mvn/version "0.1.1"}
|
comb/comb {:mvn/version "0.1.1"}
|
||||||
|
|
@ -108,18 +106,16 @@
|
||||||
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
||||||
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
||||||
expound/expound {:mvn/version "0.8.10"}
|
expound/expound {:mvn/version "0.8.10"}
|
||||||
integrant/integrant {:git/url "https://github.com/weavejester/integrant", :git/sha "a9fd7c02bd7201f36344b47142badc3c3ef22f88"}
|
integrant/integrant {:mvn/version "0.8.0"}
|
||||||
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
||||||
listora/again {:mvn/version "1.0.0"}
|
listora/again {:mvn/version "1.0.0"}
|
||||||
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
||||||
environ/environ {:mvn/version "1.2.0"}
|
environ/environ {:mvn/version "1.2.0"}
|
||||||
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
||||||
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
||||||
org.clojure/tools.namespace {:git/sha "daf82a10e70182aea4c0716a48f3922163441b32",
|
org.clojure/tools.namespace {:git/url "https://github.com/babashka/tools.namespace", :sha "a13b037215e21a2e71aa34b27e1dd52c801a2a7b"}
|
||||||
:git/url "https://github.com/clojure/tools.namespace"}
|
|
||||||
medley/medley {:mvn/version "1.3.0"}
|
medley/medley {:mvn/version "1.3.0"}
|
||||||
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner",
|
io.github.cognitect-labs/test-runner {:git/tag "v0.5.0", :git/sha "b3fd0d2"}
|
||||||
:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}
|
|
||||||
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
||||||
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
||||||
testdoc/testdoc {:mvn/version "1.4.1"}
|
testdoc/testdoc {:mvn/version "1.4.1"}
|
||||||
|
|
@ -158,27 +154,7 @@
|
||||||
:deps/manifest :deps}
|
:deps/manifest :deps}
|
||||||
exoscale/interceptor {:git/url "https://github.com/exoscale/interceptor"
|
exoscale/interceptor {:git/url "https://github.com/exoscale/interceptor"
|
||||||
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
||||||
:deps/manifest :deps}
|
:deps/manifest :deps}}
|
||||||
lambdaisland/uri {:git/url "https://github.com/lambdaisland/uri"
|
|
||||||
:git/sha "ac4f1f9c8e4f45a088db1c6383ce2191c973987c"
|
|
||||||
:deps/manifest :deps}
|
|
||||||
clj-commons/fs {:mvn/version "1.6.310"}
|
|
||||||
postmortem/postmortem {:git/url "https://github.com/athos/Postmortem"
|
|
||||||
:git/sha "1a29775a3d286f9f6fe3f979c78b6e2bf298d5ba"}
|
|
||||||
com.github.rawleyfowler/sluj {:git/url "https://github.com/rawleyfowler/sluj"
|
|
||||||
:git/sha "4a92e772b4e07bf127423448d4140748b5782198"
|
|
||||||
:deps/manifest :deps}
|
|
||||||
net.cgrand/xforms {:git/url "https://github.com/cgrand/xforms"
|
|
||||||
:git/sha "550dbc150a79c6ecc148d8a7e260e10bc36321c6"
|
|
||||||
:deps/manifest :deps}
|
|
||||||
prismatic/plumbing {:git/url "https://github.com/plumatic/plumbing",
|
|
||||||
:git/sha "424bc704f2db422de34269c139a5494314b3a43b"}
|
|
||||||
org.clj-commons/hickory {:git/url "https://github.com/clj-commons/hickory"
|
|
||||||
:git/sha "9385b6708ef35f161732d8464b3a3aa57dd79f30"}
|
|
||||||
com.potetm/fusebox {:git/url "https://github.com/potetm/fusebox"
|
|
||||||
:git/sha "ac6d6a0a69510b009b3c1bb2247cd110fd9f7246"}
|
|
||||||
net.sekao/odoyle-rules {:git/url "https://github.com/oakes/odoyle-rules"
|
|
||||||
:git/sha "0b1d825ec45a998c4d3481dfb292e08ce6a47f0b"}}
|
|
||||||
:classpath-overrides {org.clojure/clojure nil
|
:classpath-overrides {org.clojure/clojure nil
|
||||||
org.clojure/spec.alpha nil}}
|
org.clojure/spec.alpha nil}}
|
||||||
:clj-nvd
|
:clj-nvd
|
||||||
|
|
@ -188,8 +164,7 @@
|
||||||
:test
|
:test
|
||||||
{:extra-paths ["test"]
|
{:extra-paths ["test"]
|
||||||
:extra-deps {io.github.cognitect-labs/test-runner
|
:extra-deps {io.github.cognitect-labs/test-runner
|
||||||
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
|
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}}
|
||||||
nubank/matcher-combinators {:mvn/version "3.6.0"}}
|
|
||||||
:main-opts ["-m" "cognitect.test-runner"]
|
:main-opts ["-m" "cognitect.test-runner"]
|
||||||
:exec-fn cognitect.test-runner.api/test}
|
:exec-fn cognitect.test-runner.api/test}
|
||||||
:test-pod
|
:test-pod
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,9 @@ Args=-H:+ReportExceptionStackTraces \
|
||||||
-J-Dborkdude.dynaload.aot=true \
|
-J-Dborkdude.dynaload.aot=true \
|
||||||
-H:IncludeResources=BABASHKA_VERSION \
|
-H:IncludeResources=BABASHKA_VERSION \
|
||||||
-H:IncludeResources=META-INF/babashka/.* \
|
-H:IncludeResources=META-INF/babashka/.* \
|
||||||
-H:IncludeResources=src/babashka/.* \
|
|
||||||
-H:IncludeResources=SCI_VERSION \
|
-H:IncludeResources=SCI_VERSION \
|
||||||
-H:Log=registerResource:3 \
|
-H:Log=registerResource: \
|
||||||
--enable-url-protocols=http,https,jar,unix \
|
-H:EnableURLProtocols=http,https,jar \
|
||||||
--enable-all-security-services \
|
--enable-all-security-services \
|
||||||
-H:+JNI \
|
-H:+JNI \
|
||||||
--no-server \
|
--no-server \
|
||||||
|
|
@ -26,32 +25,4 @@ Args=-H:+ReportExceptionStackTraces \
|
||||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.SoundbankReader \
|
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.SoundbankReader \
|
||||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileWriter \
|
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileWriter \
|
||||||
-H:ServiceLoaderFeatureExcludeServices=java.net.ContentHandlerFactory \
|
-H:ServiceLoaderFeatureExcludeServices=java.net.ContentHandlerFactory \
|
||||||
-H:ServiceLoaderFeatureExcludeServices=java.nio.charset.spi.CharsetProvider \
|
-H:ServiceLoaderFeatureExcludeServices=java.nio.charset.spi.CharsetProvider
|
||||||
-EBABASHKA_STATIC \
|
|
||||||
-EBABASHKA_MUSL \
|
|
||||||
-EBABASHKA_FEATURE_YAML \
|
|
||||||
-EBABASHKA_FEATURE_XML \
|
|
||||||
-EBABASHKA_FEATURE_CSV \
|
|
||||||
-EBABASHKA_FEATURE_TRANSIT \
|
|
||||||
-EBABASHKA_FEATURE_JAVA_TIME \
|
|
||||||
-EBABASHKA_FEATURE_JAVA_NET_HTTP \
|
|
||||||
-EBABASHKA_FEATURE_JAVA_NIO \
|
|
||||||
-EBABASHKA_FEATURE_HTTPKIT_CLIENT \
|
|
||||||
-EBABASHKA_FEATURE_HTTPKIT_SERVER \
|
|
||||||
-EBABASHKA_FEATURE_CORE_MATCH \
|
|
||||||
-EBABASHKA_FEATURE_HICCUP \
|
|
||||||
-EBABASHKA_FEATURE_TEST_CHECK \
|
|
||||||
-EBABASHKA_FEATURE_SELMER \
|
|
||||||
-EBABASHKA_FEATURE_LOGGING \
|
|
||||||
-EBABASHKA_FEATURE_PRIORITY_MAP \
|
|
||||||
-EBABASHKA_FEATURE_JDBC \
|
|
||||||
-EBABASHKA_FEATURE_SQLITE \
|
|
||||||
-EBABASHKA_FEATURE_POSTGRESQL \
|
|
||||||
-EBABASHKA_FEATURE_ORACLEDB \
|
|
||||||
-EBABASHKA_FEATURE_HSQLDB \
|
|
||||||
-EBABASHKA_FEATURE_DATASCRIPT \
|
|
||||||
-EBABASHKA_FEATURE_LANTERNA \
|
|
||||||
-EBABASHKA_FEATURE_SPEC_ALPHA \
|
|
||||||
-EBABASHKA_FEATURE_RRB_VECTOR \
|
|
||||||
-EBABASHKA_REQUIRE_SCAN \
|
|
||||||
-EBABASHKA_SHA
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
[{
|
|
||||||
"interfaces": [
|
|
||||||
"java.util.function.Predicate"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"interfaces": [
|
|
||||||
"java.util.function.Function"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"interfaces": [
|
|
||||||
"java.io.FileFilter"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"interfaces": [
|
|
||||||
"java.nio.file.DirectoryStream$Filter"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"interfaces": [
|
|
||||||
"java.util.function.Supplier"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"interfaces": [
|
|
||||||
"java.util.function.UnaryOperator"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import java.io.Closeable;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.net.URL;
|
|
||||||
import java.net.URLClassLoader;
|
|
||||||
import java.security.AccessControlContext;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Enumeration;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.WeakHashMap;
|
|
||||||
|
|
||||||
import com.oracle.svm.core.annotate.Alias;
|
|
||||||
import com.oracle.svm.core.annotate.RecomputeFieldValue;
|
|
||||||
import com.oracle.svm.core.annotate.Substitute;
|
|
||||||
import com.oracle.svm.core.annotate.TargetClass;
|
|
||||||
|
|
||||||
@TargetClass(URLClassLoader.class)
|
|
||||||
@SuppressWarnings({"unused", "static-method"})
|
|
||||||
final class Target_java_net_URLClassLoader {
|
|
||||||
@Alias//
|
|
||||||
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.NewInstance, declClass = WeakHashMap.class)//
|
|
||||||
private WeakHashMap<Closeable, Void> closeables;
|
|
||||||
|
|
||||||
@Substitute
|
|
||||||
public InputStream getResourceAsStream(String name) throws IOException {
|
|
||||||
System.out.println("getResource");
|
|
||||||
return null;
|
|
||||||
// return Resources.createInputStream(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
(ns clojure.repl.deps
|
|
||||||
(:require [babashka.deps :as deps]))
|
|
||||||
|
|
||||||
(defn add-libs
|
|
||||||
"Given lib-coords, a map of lib to coord, will resolve all transitive deps for the libs
|
|
||||||
together and add them to the repl classpath, unlike separate calls to add-lib."
|
|
||||||
{:added "1.12"}
|
|
||||||
[lib-coords]
|
|
||||||
(deps/add-deps {:deps lib-coords})
|
|
||||||
nil)
|
|
||||||
|
|
||||||
(defn add-lib
|
|
||||||
"Given a lib that is not yet on the repl classpath, make it available by
|
|
||||||
downloading the library if necessary and adding it to the classloader.
|
|
||||||
Libs already on the classpath are not updated. Requires a valid parent
|
|
||||||
DynamicClassLoader.
|
|
||||||
|
|
||||||
lib - symbol identifying a library, for Maven: groupId/artifactId
|
|
||||||
coord - optional map of location information specific to the procurer,
|
|
||||||
or latest if not supplied
|
|
||||||
|
|
||||||
Returns coll of libs loaded, including transitive (or nil if none).
|
|
||||||
|
|
||||||
For info on libs, coords, and versions, see:
|
|
||||||
https://clojure.org/reference/deps_and_cli"
|
|
||||||
{:added "1.12"}
|
|
||||||
([lib coord]
|
|
||||||
(add-libs {lib coord}))
|
|
||||||
([lib]
|
|
||||||
(throw (ex-info "add-lib without explicit version isn't supported in babashka (yet)" {:lib lib}))))
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,227 +0,0 @@
|
||||||
; Copyright (c) Rich Hickey. All rights reserved.
|
|
||||||
; The use and distribution terms for this software are covered by the
|
|
||||||
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
|
|
||||||
; which can be found in the file epl-v10.html at the root of this distribution.
|
|
||||||
; By using this software in any fashion, you are agreeing to be bound by
|
|
||||||
; the terms of this license.
|
|
||||||
; You must not remove this notice, or any other, from this software.
|
|
||||||
|
|
||||||
(ns clojure.spec.gen.alpha
|
|
||||||
(:refer-clojure :exclude [boolean bytes cat hash-map list map not-empty set vector
|
|
||||||
char double int keyword symbol string uuid delay shuffle]))
|
|
||||||
|
|
||||||
(alias 'c 'clojure.core)
|
|
||||||
|
|
||||||
(defonce ^:private dynalock (Object.))
|
|
||||||
|
|
||||||
(defn- dynaload
|
|
||||||
[s]
|
|
||||||
(let [ns (namespace s)]
|
|
||||||
(assert ns)
|
|
||||||
(locking dynalock
|
|
||||||
(require (c/symbol ns)))
|
|
||||||
(let [v (resolve s)]
|
|
||||||
(if v
|
|
||||||
@v
|
|
||||||
(throw (RuntimeException. (str "Var " s " is not on the classpath")))))))
|
|
||||||
|
|
||||||
(def ^:private quick-check-ref
|
|
||||||
(c/delay (dynaload 'clojure.test.check/quick-check)))
|
|
||||||
(defn quick-check
|
|
||||||
[& args]
|
|
||||||
(apply @quick-check-ref args))
|
|
||||||
|
|
||||||
(def ^:private for-all*-ref
|
|
||||||
(c/delay (dynaload 'clojure.test.check.properties/for-all*)))
|
|
||||||
(defn for-all*
|
|
||||||
"Dynamically loaded clojure.test.check.properties/for-all*."
|
|
||||||
[& args]
|
|
||||||
(apply @for-all*-ref args))
|
|
||||||
|
|
||||||
(let [g? (c/delay (dynaload 'clojure.test.check.generators/generator?))
|
|
||||||
g (c/delay (dynaload 'clojure.test.check.generators/generate))
|
|
||||||
mkg (c/delay (dynaload 'clojure.test.check.generators/->Generator))]
|
|
||||||
(defn- generator?
|
|
||||||
[x]
|
|
||||||
(@g? x))
|
|
||||||
(defn- generator
|
|
||||||
[gfn]
|
|
||||||
(@mkg gfn))
|
|
||||||
(defn generate
|
|
||||||
"Generate a single value using generator."
|
|
||||||
[generator]
|
|
||||||
(@g generator)))
|
|
||||||
|
|
||||||
(defn ^:skip-wiki delay-impl
|
|
||||||
[gfnd]
|
|
||||||
;;N.B. depends on test.check impl details
|
|
||||||
(generator (fn [rnd size]
|
|
||||||
((:gen @gfnd) rnd size))))
|
|
||||||
|
|
||||||
(defmacro delay
|
|
||||||
"given body that returns a generator, returns a
|
|
||||||
generator that delegates to that, but delays
|
|
||||||
creation until used."
|
|
||||||
[& body]
|
|
||||||
`(delay-impl (c/delay ~@body)))
|
|
||||||
|
|
||||||
(defn gen-for-name
|
|
||||||
"Dynamically loads test.check generator named s."
|
|
||||||
[s]
|
|
||||||
(let [g (dynaload s)]
|
|
||||||
(if (generator? g)
|
|
||||||
g
|
|
||||||
(throw (RuntimeException. (str "Var " s " is not a generator"))))))
|
|
||||||
|
|
||||||
(defmacro ^:skip-wiki lazy-combinator
|
|
||||||
"Implementation macro, do not call directly."
|
|
||||||
[s]
|
|
||||||
(let [fqn (c/symbol "clojure.test.check.generators" (name s))
|
|
||||||
doc (str "Lazy loaded version of " fqn)]
|
|
||||||
`(let [g# (c/delay (dynaload '~fqn))]
|
|
||||||
(defn ~s
|
|
||||||
~doc
|
|
||||||
[& ~'args]
|
|
||||||
(apply @g# ~'args)))))
|
|
||||||
|
|
||||||
(defmacro ^:skip-wiki lazy-combinators
|
|
||||||
"Implementation macro, do not call directly."
|
|
||||||
[& syms]
|
|
||||||
`(do
|
|
||||||
~@(c/map
|
|
||||||
(fn [s] (c/list 'lazy-combinator s))
|
|
||||||
syms)))
|
|
||||||
|
|
||||||
(lazy-combinators hash-map list map not-empty set vector vector-distinct fmap elements
|
|
||||||
bind choose fmap one-of such-that tuple sample return
|
|
||||||
large-integer* double* frequency shuffle)
|
|
||||||
|
|
||||||
(defmacro ^:skip-wiki lazy-prim
|
|
||||||
"Implementation macro, do not call directly."
|
|
||||||
[s]
|
|
||||||
(let [fqn (c/symbol "clojure.test.check.generators" (name s))
|
|
||||||
doc (str "Fn returning " fqn)]
|
|
||||||
`(let [g# (c/delay (dynaload '~fqn))]
|
|
||||||
(defn ~s
|
|
||||||
~doc
|
|
||||||
[& ~'args]
|
|
||||||
@g#))))
|
|
||||||
|
|
||||||
(defmacro ^:skip-wiki lazy-prims
|
|
||||||
"Implementation macro, do not call directly."
|
|
||||||
[& syms]
|
|
||||||
`(do
|
|
||||||
~@(c/map
|
|
||||||
(fn [s] (c/list 'lazy-prim s))
|
|
||||||
syms)))
|
|
||||||
|
|
||||||
(lazy-prims any any-printable boolean bytes char char-alpha char-alphanumeric char-ascii double
|
|
||||||
int keyword keyword-ns large-integer ratio simple-type simple-type-printable
|
|
||||||
string string-ascii string-alphanumeric symbol symbol-ns uuid)
|
|
||||||
|
|
||||||
(defn cat
|
|
||||||
"Returns a generator of a sequence catenated from results of
|
|
||||||
gens, each of which should generate something sequential."
|
|
||||||
[& gens]
|
|
||||||
(fmap #(apply concat %)
|
|
||||||
(apply tuple gens)))
|
|
||||||
|
|
||||||
(defn- qualified? [ident] (not (nil? (namespace ident))))
|
|
||||||
|
|
||||||
(def ^:private
|
|
||||||
gen-builtins
|
|
||||||
(c/delay
|
|
||||||
(let [simple (simple-type-printable)]
|
|
||||||
{any? (one-of [(return nil) (any-printable)])
|
|
||||||
some? (such-that some? (any-printable))
|
|
||||||
number? (one-of [(large-integer) (double)])
|
|
||||||
integer? (large-integer)
|
|
||||||
int? (large-integer)
|
|
||||||
pos-int? (large-integer* {:min 1})
|
|
||||||
neg-int? (large-integer* {:max -1})
|
|
||||||
nat-int? (large-integer* {:min 0})
|
|
||||||
float? (double)
|
|
||||||
double? (double)
|
|
||||||
boolean? (boolean)
|
|
||||||
string? (string-alphanumeric)
|
|
||||||
ident? (one-of [(keyword-ns) (symbol-ns)])
|
|
||||||
simple-ident? (one-of [(keyword) (symbol)])
|
|
||||||
qualified-ident? (such-that qualified? (one-of [(keyword-ns) (symbol-ns)]))
|
|
||||||
keyword? (keyword-ns)
|
|
||||||
simple-keyword? (keyword)
|
|
||||||
qualified-keyword? (such-that qualified? (keyword-ns))
|
|
||||||
symbol? (symbol-ns)
|
|
||||||
simple-symbol? (symbol)
|
|
||||||
qualified-symbol? (such-that qualified? (symbol-ns))
|
|
||||||
uuid? (uuid)
|
|
||||||
uri? (fmap #(java.net.URI/create (str "http://" % ".com")) (uuid))
|
|
||||||
decimal? (fmap #(BigDecimal/valueOf %)
|
|
||||||
(double* {:infinite? false :NaN? false}))
|
|
||||||
inst? (fmap #(java.util.Date. %)
|
|
||||||
(large-integer))
|
|
||||||
seqable? (one-of [(return nil)
|
|
||||||
(list simple)
|
|
||||||
(vector simple)
|
|
||||||
(map simple simple)
|
|
||||||
(set simple)
|
|
||||||
(string-alphanumeric)])
|
|
||||||
indexed? (vector simple)
|
|
||||||
map? (map simple simple)
|
|
||||||
vector? (vector simple)
|
|
||||||
list? (list simple)
|
|
||||||
seq? (list simple)
|
|
||||||
char? (char)
|
|
||||||
set? (set simple)
|
|
||||||
nil? (return nil)
|
|
||||||
false? (return false)
|
|
||||||
true? (return true)
|
|
||||||
zero? (return 0)
|
|
||||||
rational? (one-of [(large-integer) (ratio)])
|
|
||||||
coll? (one-of [(map simple simple)
|
|
||||||
(list simple)
|
|
||||||
(vector simple)
|
|
||||||
(set simple)])
|
|
||||||
empty? (elements [nil '() [] {} #{}])
|
|
||||||
associative? (one-of [(map simple simple) (vector simple)])
|
|
||||||
sequential? (one-of [(list simple) (vector simple)])
|
|
||||||
ratio? (such-that ratio? (ratio))
|
|
||||||
bytes? (bytes)})))
|
|
||||||
|
|
||||||
(defn gen-for-pred
|
|
||||||
"Given a predicate, returns a built-in generator if one exists."
|
|
||||||
[pred]
|
|
||||||
(if (set? pred)
|
|
||||||
(elements pred)
|
|
||||||
(get @gen-builtins pred)))
|
|
||||||
|
|
||||||
(comment
|
|
||||||
(require :reload 'clojure.spec.gen.alpha)
|
|
||||||
(in-ns 'clojure.spec.gen.alpha)
|
|
||||||
|
|
||||||
;; combinators, see call to lazy-combinators above for complete list
|
|
||||||
(generate (one-of [(gen-for-pred integer?) (gen-for-pred string?)]))
|
|
||||||
(generate (such-that #(< 10000 %) (gen-for-pred integer?)))
|
|
||||||
(let [reqs {:a (gen-for-pred number?)
|
|
||||||
:b (gen-for-pred ratio?)}
|
|
||||||
opts {:c (gen-for-pred string?)}]
|
|
||||||
(generate (bind (choose 0 (count opts))
|
|
||||||
#(let [args (concat (seq reqs) (c/shuffle (seq opts)))]
|
|
||||||
(->> args
|
|
||||||
(take (+ % (count reqs)))
|
|
||||||
(mapcat identity)
|
|
||||||
(apply hash-map))))))
|
|
||||||
(generate (cat (list (gen-for-pred string?))
|
|
||||||
(list (gen-for-pred ratio?))))
|
|
||||||
|
|
||||||
;; load your own generator
|
|
||||||
(gen-for-name 'clojure.test.check.generators/int)
|
|
||||||
|
|
||||||
;; failure modes
|
|
||||||
(gen-for-name 'unqualified)
|
|
||||||
(gen-for-name 'clojure.core/+)
|
|
||||||
(gen-for-name 'clojure.core/name-does-not-exist)
|
|
||||||
(gen-for-name 'ns.does.not.exist/f)
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,579 +0,0 @@
|
||||||
; Copyright (c) Rich Hickey. All rights reserved.
|
|
||||||
; The use and distribution terms for this software are covered by the
|
|
||||||
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
|
|
||||||
; which can be found in the file epl-v10.html at the root of this distribution.
|
|
||||||
; By using this software in any fashion, you are agreeing to be bound by
|
|
||||||
; the terms of this license.
|
|
||||||
; You must not remove this notice, or any other, from this software.
|
|
||||||
|
|
||||||
(ns clojure.spec.test.alpha
|
|
||||||
(:refer-clojure :exclude [test])
|
|
||||||
(:require
|
|
||||||
[clojure.pprint :as pp]
|
|
||||||
[clojure.spec.alpha :as s]
|
|
||||||
[clojure.spec.gen.alpha :as gen]
|
|
||||||
[clojure.string :as str]))
|
|
||||||
|
|
||||||
(in-ns 'clojure.spec.test.check)
|
|
||||||
(in-ns 'clojure.spec.test.alpha)
|
|
||||||
(alias 'stc 'clojure.spec.test.check)
|
|
||||||
|
|
||||||
(defn- throwable?
|
|
||||||
[x]
|
|
||||||
(instance? Throwable x))
|
|
||||||
|
|
||||||
(defn ->sym
|
|
||||||
[x]
|
|
||||||
(@#'s/->sym x))
|
|
||||||
|
|
||||||
(defn- ->var
|
|
||||||
[s-or-v]
|
|
||||||
(if (var? s-or-v)
|
|
||||||
s-or-v
|
|
||||||
(let [v (and (symbol? s-or-v) (resolve s-or-v))]
|
|
||||||
(if (var? v)
|
|
||||||
v
|
|
||||||
(throw (IllegalArgumentException. (str (pr-str s-or-v) " does not name a var")))))))
|
|
||||||
|
|
||||||
(defn- collectionize
|
|
||||||
[x]
|
|
||||||
(if (symbol? x)
|
|
||||||
(list x)
|
|
||||||
x))
|
|
||||||
|
|
||||||
(defn enumerate-namespace
|
|
||||||
"Given a symbol naming an ns, or a collection of such symbols,
|
|
||||||
returns the set of all symbols naming vars in those nses."
|
|
||||||
[ns-sym-or-syms]
|
|
||||||
(into
|
|
||||||
#{}
|
|
||||||
(mapcat (fn [ns-sym]
|
|
||||||
(map
|
|
||||||
(fn [name-sym]
|
|
||||||
(symbol (name ns-sym) (name name-sym)))
|
|
||||||
(keys (ns-interns ns-sym)))))
|
|
||||||
(collectionize ns-sym-or-syms)))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; instrument ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(def ^:private ^:dynamic *instrument-enabled*
|
|
||||||
"if false, instrumented fns call straight through"
|
|
||||||
true)
|
|
||||||
|
|
||||||
(defn- fn-spec?
|
|
||||||
"Fn-spec must include at least :args or :ret specs."
|
|
||||||
[m]
|
|
||||||
(or (:args m) (:ret m)))
|
|
||||||
|
|
||||||
(defmacro with-instrument-disabled
|
|
||||||
"Disables instrument's checking of calls, within a scope."
|
|
||||||
[& body]
|
|
||||||
`(binding [*instrument-enabled* nil]
|
|
||||||
~@body))
|
|
||||||
|
|
||||||
(defn- thunk-frame? [s]
|
|
||||||
(str/includes? s "--KVS--EMULATION--THUNK--"))
|
|
||||||
|
|
||||||
(defn- interpret-stack-trace-element
|
|
||||||
"Given the vector-of-syms form of a stacktrace element produced
|
|
||||||
by e.g. Throwable->map, returns a map form that adds some keys
|
|
||||||
guessing the original Clojure names. Returns a map with
|
|
||||||
|
|
||||||
:class class name symbol from stack trace
|
|
||||||
:method method symbol from stack trace
|
|
||||||
:file filename from stack trace
|
|
||||||
:line line number from stack trace
|
|
||||||
:var-scope optional Clojure var symbol scoping fn def
|
|
||||||
:local-fn optional local Clojure symbol scoping fn def
|
|
||||||
|
|
||||||
For non-Clojure fns, :scope and :local-fn will be absent."
|
|
||||||
[[cls method file line]]
|
|
||||||
(let [clojure? (contains? '#{invoke invokeStatic} method)
|
|
||||||
demunge #(s/demunge %)
|
|
||||||
degensym #(str/replace % #"--.*" "")
|
|
||||||
[ns-sym name-sym local] (when clojure?
|
|
||||||
(->> (str/split (str cls) #"\$" 3)
|
|
||||||
(map demunge)))]
|
|
||||||
(merge {:file file
|
|
||||||
:line line
|
|
||||||
:method method
|
|
||||||
:class cls}
|
|
||||||
(when (and ns-sym name-sym)
|
|
||||||
{:var-scope (symbol ns-sym name-sym)})
|
|
||||||
(when local
|
|
||||||
{:local-fn (symbol (degensym local))
|
|
||||||
:thunk? (thunk-frame? local)}))))
|
|
||||||
|
|
||||||
(defn- stacktrace-relevant-to-instrument
|
|
||||||
"Takes a coll of stack trace elements (as returned by
|
|
||||||
StackTraceElement->vec) and returns a coll of maps as per
|
|
||||||
interpret-stack-trace-element that are relevant to a
|
|
||||||
failure in instrument."
|
|
||||||
[elems]
|
|
||||||
(let [plumbing? (fn [{:keys [var-scope thunk?]}]
|
|
||||||
(or thunk?
|
|
||||||
(contains? '#{clojure.spec.test.alpha/spec-checking-fn
|
|
||||||
clojure.core/apply}
|
|
||||||
var-scope)))]
|
|
||||||
(sequence (comp (map StackTraceElement->vec)
|
|
||||||
(map interpret-stack-trace-element)
|
|
||||||
(filter :var-scope)
|
|
||||||
(drop-while plumbing?))
|
|
||||||
elems)))
|
|
||||||
|
|
||||||
(defn- spec-checking-fn
|
|
||||||
"Takes a function name, a function f, and an fspec and returns a thunk that
|
|
||||||
first conforms the arguments given then calls f with those arguments if
|
|
||||||
the conform succeeds. Otherwise, an exception is thrown containing information
|
|
||||||
about the conform failure."
|
|
||||||
[fn-name f fn-spec]
|
|
||||||
(let [fn-spec (@#'s/maybe-spec fn-spec)
|
|
||||||
conform! (fn [fn-name role spec data args]
|
|
||||||
(let [conformed (s/conform spec data)]
|
|
||||||
(if (= ::s/invalid conformed)
|
|
||||||
(let [caller (->> (.getStackTrace (Thread/currentThread))
|
|
||||||
stacktrace-relevant-to-instrument
|
|
||||||
first)
|
|
||||||
ed (merge (assoc (s/explain-data* spec [] [] [] data)
|
|
||||||
::s/fn fn-name
|
|
||||||
::s/args args
|
|
||||||
::s/failure :instrument)
|
|
||||||
(when caller
|
|
||||||
{::caller (dissoc caller :class :method)}))]
|
|
||||||
(throw (ex-info
|
|
||||||
(str "Call to " fn-name " did not conform to spec.")
|
|
||||||
ed)))
|
|
||||||
conformed)))]
|
|
||||||
(fn
|
|
||||||
[& args]
|
|
||||||
(if *instrument-enabled*
|
|
||||||
(with-instrument-disabled
|
|
||||||
(when (:args fn-spec) (conform! fn-name :args (:args fn-spec) args args))
|
|
||||||
(binding [*instrument-enabled* true]
|
|
||||||
(.applyTo ^clojure.lang.IFn f args)))
|
|
||||||
(.applyTo ^clojure.lang.IFn f args)))))
|
|
||||||
|
|
||||||
(defn- no-fspec
|
|
||||||
[v spec]
|
|
||||||
(ex-info (str "Fn at " v " is not spec'ed.")
|
|
||||||
{:var v :spec spec ::s/failure :no-fspec}))
|
|
||||||
|
|
||||||
(defonce ^:private instrumented-vars (atom {}))
|
|
||||||
|
|
||||||
(defn- find-varargs-decl
|
|
||||||
"Takes an arglist and returns the restargs binding form if found, else nil."
|
|
||||||
[arglist]
|
|
||||||
(let [[_ decl :as restargs] (->> arglist
|
|
||||||
(split-with (complement #{'&}))
|
|
||||||
second)]
|
|
||||||
(and (= 2 (count restargs))
|
|
||||||
decl)))
|
|
||||||
|
|
||||||
(defn- has-kwargs? [arglists]
|
|
||||||
(->> arglists (some find-varargs-decl) map?))
|
|
||||||
|
|
||||||
(defn- kwargs->kvs
|
|
||||||
"Takes the restargs of a kwargs function call and checks for a trailing element.
|
|
||||||
If found, that element is flattened into a sequence of key->value pairs and
|
|
||||||
concatenated onto the preceding arguments."
|
|
||||||
[args]
|
|
||||||
(if (even? (count args))
|
|
||||||
args
|
|
||||||
(concat (butlast args)
|
|
||||||
(reduce-kv (fn [acc k v] (->> acc (cons v) (cons k)))
|
|
||||||
()
|
|
||||||
(last args)))))
|
|
||||||
|
|
||||||
(defn- gen-fixed-args-syms
|
|
||||||
"Takes an arglist and generates a vector of names corresponding to the fixed
|
|
||||||
args found."
|
|
||||||
[arglist]
|
|
||||||
(->> arglist (take-while (complement #{'&})) (map (fn [_] (gensym))) vec))
|
|
||||||
|
|
||||||
(defn- build-kwargs-body
|
|
||||||
"Takes a function name fn-name and arglist and returns code for a function body that
|
|
||||||
handles kwargs by calling fn-name with any fixed followed by its restargs transformed
|
|
||||||
from kwargs to kvs."
|
|
||||||
[fn-name arglist]
|
|
||||||
(let [alias (gensym "kwargs")
|
|
||||||
head-args (gen-fixed-args-syms arglist)]
|
|
||||||
(list (conj head-args '& alias)
|
|
||||||
`(apply ~fn-name ~@head-args (@#'kwargs->kvs ~alias)))))
|
|
||||||
|
|
||||||
(defn- build-varargs-body
|
|
||||||
"Takes a function name fn-name and arglist and returns code for a function body that
|
|
||||||
handles varargs by calling fn-name with any fixed args followed by its rest args."
|
|
||||||
[fn-name arglist]
|
|
||||||
(let [head-args (gen-fixed-args-syms arglist)
|
|
||||||
alias (gensym "restargs")]
|
|
||||||
(list (conj head-args '& alias)
|
|
||||||
`(apply ~fn-name ~@head-args ~alias))))
|
|
||||||
|
|
||||||
(defn- build-fixed-args-body
|
|
||||||
"Takes a function name fn-name and arglist and returns code for a function body that
|
|
||||||
handles fixed args by calling fn-name with its fixed args."
|
|
||||||
[fn-name arglist]
|
|
||||||
(let [arglist (gen-fixed-args-syms arglist)]
|
|
||||||
(list arglist
|
|
||||||
`(~fn-name ~@arglist))))
|
|
||||||
|
|
||||||
(defn- build-flattener-code
|
|
||||||
"Takes argslists and generates code for a HOF that given a function, returns a forwarding thunk
|
|
||||||
of analogous arglists that ensures that kwargs are passed as kvs to the original function."
|
|
||||||
[arglists]
|
|
||||||
(let [closed-over-name (gensym "inner")]
|
|
||||||
`(fn [~closed-over-name]
|
|
||||||
(fn ~'--KVS--EMULATION--THUNK--
|
|
||||||
~@(map (fn [arglist]
|
|
||||||
(let [varargs-decl (find-varargs-decl arglist)]
|
|
||||||
(cond (map? varargs-decl) (build-kwargs-body closed-over-name arglist)
|
|
||||||
varargs-decl (build-varargs-body closed-over-name arglist)
|
|
||||||
:default (build-fixed-args-body closed-over-name arglist))))
|
|
||||||
(or arglists
|
|
||||||
'([& args])))))))
|
|
||||||
|
|
||||||
(comment
|
|
||||||
;; Given a function with the arglists (([a]) ([a b]) ([a b & kvs]))
|
|
||||||
;; the flattener generated is below (with some gensym name cleanup for readability)
|
|
||||||
(fn [inner]
|
|
||||||
(fn
|
|
||||||
([G__a] (inner G__a))
|
|
||||||
([G__a G__b] (inner G__a G__b))
|
|
||||||
([G__a G__b & G__kvs]
|
|
||||||
(apply inner G__a G__b (if (even? (count G__kvs))
|
|
||||||
G__kvs
|
|
||||||
(reduce-kv (fn [acc k v]
|
|
||||||
(->> acc (cons v) (cons k)))
|
|
||||||
(butlast G__kvs)
|
|
||||||
(last G__kvs)))))))
|
|
||||||
)
|
|
||||||
|
|
||||||
(defn- maybe-wrap-kvs-emulation
|
|
||||||
"Takes an argslist and function f and returns f except when arglists
|
|
||||||
contains a kwargs binding, else wraps f with a forwarding thunk that
|
|
||||||
flattens a trailing map into kvs if present in the kwargs call."
|
|
||||||
[f arglists]
|
|
||||||
(if (has-kwargs? arglists)
|
|
||||||
(let [flattener-code (build-flattener-code arglists)
|
|
||||||
kvs-emu (eval flattener-code)]
|
|
||||||
(kvs-emu f))
|
|
||||||
f))
|
|
||||||
|
|
||||||
(defn- instrument-choose-fn
|
|
||||||
"Helper for instrument."
|
|
||||||
[f spec sym {over :gen :keys [stub replace]}]
|
|
||||||
(if (some #{sym} stub)
|
|
||||||
(-> spec (s/gen over) gen/generate)
|
|
||||||
(get replace sym f)))
|
|
||||||
|
|
||||||
(defn- instrument-choose-spec
|
|
||||||
"Helper for instrument"
|
|
||||||
[spec sym {overrides :spec}]
|
|
||||||
(get overrides sym spec))
|
|
||||||
|
|
||||||
(defn- instrument-1
|
|
||||||
[s opts]
|
|
||||||
(when-let [v (resolve s)]
|
|
||||||
(when-not (-> v meta :macro)
|
|
||||||
(let [spec (s/get-spec v)
|
|
||||||
{:keys [raw wrapped]} (get @instrumented-vars v)
|
|
||||||
current @v
|
|
||||||
to-wrap (if (= wrapped current) raw current)
|
|
||||||
ospec (or (instrument-choose-spec spec s opts)
|
|
||||||
(throw (no-fspec v spec)))
|
|
||||||
ofn (instrument-choose-fn to-wrap ospec s opts)
|
|
||||||
checked (spec-checking-fn (->sym v) ofn ospec)
|
|
||||||
arglists (->> v meta :arglists (sort-by count) seq)
|
|
||||||
wrapped (maybe-wrap-kvs-emulation checked arglists)]
|
|
||||||
(alter-var-root v (constantly wrapped))
|
|
||||||
(swap! instrumented-vars assoc v {:raw to-wrap :wrapped wrapped})
|
|
||||||
(->sym v)))))
|
|
||||||
|
|
||||||
(defn- unstrument-1
|
|
||||||
[s]
|
|
||||||
(when-let [v (resolve s)]
|
|
||||||
(when-let [{:keys [raw wrapped]} (get @instrumented-vars v)]
|
|
||||||
(swap! instrumented-vars dissoc v)
|
|
||||||
(let [current @v]
|
|
||||||
(when (= wrapped current)
|
|
||||||
(alter-var-root v (constantly raw))
|
|
||||||
(->sym v))))))
|
|
||||||
|
|
||||||
(defn- opt-syms
|
|
||||||
"Returns set of symbols referenced by 'instrument' opts map"
|
|
||||||
[opts]
|
|
||||||
(reduce into #{} [(:stub opts) (keys (:replace opts)) (keys (:spec opts))]))
|
|
||||||
|
|
||||||
(defn- fn-spec-name?
|
|
||||||
[s]
|
|
||||||
(and (symbol? s)
|
|
||||||
(not (some-> (resolve s) meta :macro))))
|
|
||||||
|
|
||||||
(defn instrumentable-syms
|
|
||||||
"Given an opts map as per instrument, returns the set of syms
|
|
||||||
that can be instrumented."
|
|
||||||
([] (instrumentable-syms nil))
|
|
||||||
([opts]
|
|
||||||
(assert (every? ident? (keys (:gen opts))) "instrument :gen expects ident keys")
|
|
||||||
(reduce into #{} [(filter fn-spec-name? (keys (s/registry)))
|
|
||||||
(keys (:spec opts))
|
|
||||||
(:stub opts)
|
|
||||||
(keys (:replace opts))])))
|
|
||||||
|
|
||||||
(defn instrument
|
|
||||||
"Instruments the vars named by sym-or-syms, a symbol or collection
|
|
||||||
of symbols, or all instrumentable vars if sym-or-syms is not
|
|
||||||
specified.
|
|
||||||
|
|
||||||
If a var has an :args fn-spec, sets the var's root binding to a
|
|
||||||
fn that checks arg conformance (throwing an exception on failure)
|
|
||||||
before delegating to the original fn.
|
|
||||||
|
|
||||||
The opts map can be used to override registered specs, and/or to
|
|
||||||
replace fn implementations entirely. Opts for symbols not included
|
|
||||||
in sym-or-syms are ignored. This facilitates sharing a common
|
|
||||||
options map across many different calls to instrument.
|
|
||||||
|
|
||||||
The opts map may have the following keys:
|
|
||||||
|
|
||||||
:spec a map from var-name symbols to override specs
|
|
||||||
:stub a set of var-name symbols to be replaced by stubs
|
|
||||||
:gen a map from spec names to generator overrides
|
|
||||||
:replace a map from var-name symbols to replacement fns
|
|
||||||
|
|
||||||
:spec overrides registered fn-specs with specs your provide. Use
|
|
||||||
:spec overrides to provide specs for libraries that do not have
|
|
||||||
them, or to constrain your own use of a fn to a subset of its
|
|
||||||
spec'ed contract.
|
|
||||||
|
|
||||||
:stub replaces a fn with a stub that checks :args, then uses the
|
|
||||||
:ret spec to generate a return value.
|
|
||||||
|
|
||||||
:gen overrides are used only for :stub generation.
|
|
||||||
|
|
||||||
:replace replaces a fn with a fn that checks args conformance, then
|
|
||||||
invokes the fn you provide, enabling arbitrary stubbing and mocking.
|
|
||||||
|
|
||||||
:spec can be used in combination with :stub or :replace.
|
|
||||||
|
|
||||||
Returns a collection of syms naming the vars instrumented."
|
|
||||||
([] (instrument (instrumentable-syms)))
|
|
||||||
([sym-or-syms] (instrument sym-or-syms nil))
|
|
||||||
([sym-or-syms opts]
|
|
||||||
(locking instrumented-vars
|
|
||||||
(into
|
|
||||||
[]
|
|
||||||
(comp (filter (instrumentable-syms opts))
|
|
||||||
(distinct)
|
|
||||||
(map #(instrument-1 % opts))
|
|
||||||
(remove nil?))
|
|
||||||
(collectionize sym-or-syms)))))
|
|
||||||
|
|
||||||
(defn unstrument
|
|
||||||
"Undoes instrument on the vars named by sym-or-syms, specified
|
|
||||||
as in instrument. With no args, unstruments all instrumented vars.
|
|
||||||
Returns a collection of syms naming the vars unstrumented."
|
|
||||||
([] (unstrument (map ->sym (keys @instrumented-vars))))
|
|
||||||
([sym-or-syms]
|
|
||||||
(locking instrumented-vars
|
|
||||||
(into
|
|
||||||
[]
|
|
||||||
(comp (filter symbol?)
|
|
||||||
(map unstrument-1)
|
|
||||||
(remove nil?))
|
|
||||||
(collectionize sym-or-syms)))))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; testing ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(defn- explain-check
|
|
||||||
[args spec v role]
|
|
||||||
(ex-info
|
|
||||||
"Specification-based check failed"
|
|
||||||
(when-not (s/valid? spec v nil)
|
|
||||||
(assoc (s/explain-data* spec [role] [] [] v)
|
|
||||||
::args args
|
|
||||||
::val v
|
|
||||||
::s/failure :check-failed))))
|
|
||||||
|
|
||||||
(defn- check-call
|
|
||||||
"Returns true if call passes specs, otherwise *returns* an exception
|
|
||||||
with explain-data + ::s/failure."
|
|
||||||
[f specs args]
|
|
||||||
(let [cargs (when (:args specs) (s/conform (:args specs) args))]
|
|
||||||
(if (= cargs ::s/invalid)
|
|
||||||
(explain-check args (:args specs) args :args)
|
|
||||||
(let [ret (apply f args)
|
|
||||||
cret (when (:ret specs) (s/conform (:ret specs) ret))]
|
|
||||||
(if (= cret ::s/invalid)
|
|
||||||
(explain-check args (:ret specs) ret :ret)
|
|
||||||
(if (and (:args specs) (:ret specs) (:fn specs))
|
|
||||||
(if (s/valid? (:fn specs) {:args cargs :ret cret})
|
|
||||||
true
|
|
||||||
(explain-check args (:fn specs) {:args cargs :ret cret} :fn))
|
|
||||||
true))))))
|
|
||||||
|
|
||||||
(defn- quick-check
|
|
||||||
[f specs {gen :gen opts ::stc/opts}]
|
|
||||||
(let [{:keys [num-tests] :or {num-tests 1000}} opts
|
|
||||||
g (try (s/gen (:args specs) gen) (catch Throwable t t))]
|
|
||||||
(if (throwable? g)
|
|
||||||
{:result g}
|
|
||||||
(let [prop (gen/for-all* [g] #(check-call f specs %))]
|
|
||||||
(apply gen/quick-check num-tests prop (mapcat identity opts))))))
|
|
||||||
|
|
||||||
(defn- make-check-result
|
|
||||||
"Builds spec result map."
|
|
||||||
[check-sym spec test-check-ret]
|
|
||||||
(merge {:spec spec
|
|
||||||
::stc/ret test-check-ret}
|
|
||||||
(when check-sym
|
|
||||||
{:sym check-sym})
|
|
||||||
(when-let [result (-> test-check-ret :result)]
|
|
||||||
(when-not (true? result) {:failure result}))
|
|
||||||
(when-let [shrunk (-> test-check-ret :shrunk)]
|
|
||||||
{:failure (:result shrunk)})))
|
|
||||||
|
|
||||||
(defn- check-1
|
|
||||||
[{:keys [s f v spec]} opts]
|
|
||||||
(let [re-inst? (and v (seq (unstrument s)) true)
|
|
||||||
f (or f (when v @v))
|
|
||||||
specd (s/spec spec)]
|
|
||||||
(try
|
|
||||||
(cond
|
|
||||||
(or (nil? f) (some-> v meta :macro))
|
|
||||||
{:failure (ex-info "No fn to spec" {::s/failure :no-fn})
|
|
||||||
:sym s :spec spec}
|
|
||||||
|
|
||||||
(:args specd)
|
|
||||||
(let [tcret (quick-check f specd opts)]
|
|
||||||
(make-check-result s spec tcret))
|
|
||||||
|
|
||||||
:default
|
|
||||||
{:failure (ex-info "No :args spec" {::s/failure :no-args-spec})
|
|
||||||
:sym s :spec spec})
|
|
||||||
(finally
|
|
||||||
(when re-inst? (instrument s))))))
|
|
||||||
|
|
||||||
(defn- sym->check-map
|
|
||||||
[s]
|
|
||||||
(let [v (resolve s)]
|
|
||||||
{:s s
|
|
||||||
:v v
|
|
||||||
:spec (when v (s/get-spec v))}))
|
|
||||||
|
|
||||||
(defn- validate-check-opts
|
|
||||||
[opts]
|
|
||||||
(assert (every? ident? (keys (:gen opts))) "check :gen expects ident keys"))
|
|
||||||
|
|
||||||
(defn check-fn
|
|
||||||
"Runs generative tests for fn f using spec and opts. See
|
|
||||||
'check' for options and return."
|
|
||||||
([f spec] (check-fn f spec nil))
|
|
||||||
([f spec opts]
|
|
||||||
(validate-check-opts opts)
|
|
||||||
(check-1 {:f f :spec spec} opts)))
|
|
||||||
|
|
||||||
(defn checkable-syms
|
|
||||||
"Given an opts map as per check, returns the set of syms that
|
|
||||||
can be checked."
|
|
||||||
([] (checkable-syms nil))
|
|
||||||
([opts]
|
|
||||||
(validate-check-opts opts)
|
|
||||||
(reduce into #{} [(filter fn-spec-name? (keys (s/registry)))
|
|
||||||
(keys (:spec opts))])))
|
|
||||||
|
|
||||||
(defn check
|
|
||||||
"Run generative tests for spec conformance on vars named by
|
|
||||||
sym-or-syms, a symbol or collection of symbols. If sym-or-syms
|
|
||||||
is not specified, check all checkable vars.
|
|
||||||
|
|
||||||
The opts map includes the following optional keys, where stc
|
|
||||||
aliases clojure.spec.test.check:
|
|
||||||
|
|
||||||
::stc/opts opts to flow through test.check/quick-check
|
|
||||||
:gen map from spec names to generator overrides
|
|
||||||
|
|
||||||
The ::stc/opts include :num-tests in addition to the keys
|
|
||||||
documented by test.check. Generator overrides are passed to
|
|
||||||
spec/gen when generating function args.
|
|
||||||
|
|
||||||
Returns a lazy sequence of check result maps with the following
|
|
||||||
keys
|
|
||||||
|
|
||||||
:spec the spec tested
|
|
||||||
:sym optional symbol naming the var tested
|
|
||||||
:failure optional test failure
|
|
||||||
::stc/ret optional value returned by test.check/quick-check
|
|
||||||
|
|
||||||
The value for :failure can be any exception. Exceptions thrown by
|
|
||||||
spec itself will have an ::s/failure value in ex-data:
|
|
||||||
|
|
||||||
:check-failed at least one checked return did not conform
|
|
||||||
:no-args-spec no :args spec provided
|
|
||||||
:no-fn no fn provided
|
|
||||||
:no-fspec no fspec provided
|
|
||||||
:no-gen unable to generate :args
|
|
||||||
:instrument invalid args detected by instrument
|
|
||||||
"
|
|
||||||
([] (check (checkable-syms)))
|
|
||||||
([sym-or-syms] (check sym-or-syms nil))
|
|
||||||
([sym-or-syms opts]
|
|
||||||
(->> (collectionize sym-or-syms)
|
|
||||||
(filter (checkable-syms opts))
|
|
||||||
(pmap
|
|
||||||
#(check-1 (sym->check-map %) opts)))))
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; check reporting ;;;;;;;;;;;;;;;;;;;;;;;;
|
|
||||||
|
|
||||||
(defn- failure-type
|
|
||||||
[x]
|
|
||||||
(::s/failure (ex-data x)))
|
|
||||||
|
|
||||||
(defn- unwrap-failure
|
|
||||||
[x]
|
|
||||||
(if (failure-type x)
|
|
||||||
(ex-data x)
|
|
||||||
x))
|
|
||||||
|
|
||||||
(defn- result-type
|
|
||||||
"Returns the type of the check result. This can be any of the
|
|
||||||
::s/failure keywords documented in 'check', or:
|
|
||||||
|
|
||||||
:check-passed all checked fn returns conformed
|
|
||||||
:check-threw checked fn threw an exception"
|
|
||||||
[ret]
|
|
||||||
(let [failure (:failure ret)]
|
|
||||||
(cond
|
|
||||||
(nil? failure) :check-passed
|
|
||||||
(failure-type failure) (failure-type failure)
|
|
||||||
:default :check-threw)))
|
|
||||||
|
|
||||||
(defn abbrev-result
|
|
||||||
"Given a check result, returns an abbreviated version
|
|
||||||
suitable for summary use."
|
|
||||||
[x]
|
|
||||||
(if (:failure x)
|
|
||||||
(-> (dissoc x ::stc/ret)
|
|
||||||
(update :spec s/describe)
|
|
||||||
(update :failure unwrap-failure))
|
|
||||||
(dissoc x :spec ::stc/ret)))
|
|
||||||
|
|
||||||
(defn summarize-results
|
|
||||||
"Given a collection of check-results, e.g. from 'check', pretty
|
|
||||||
prints the summary-result (default abbrev-result) of each.
|
|
||||||
|
|
||||||
Returns a map with :total, the total number of results, plus a
|
|
||||||
key with a count for each different :type of result."
|
|
||||||
([check-results] (summarize-results check-results abbrev-result))
|
|
||||||
([check-results summary-result]
|
|
||||||
(reduce
|
|
||||||
(fn [summary result]
|
|
||||||
(pp/pprint (summary-result result))
|
|
||||||
(-> summary
|
|
||||||
(update :total inc)
|
|
||||||
(update (result-type result) (fnil inc 0))))
|
|
||||||
{:total 0}
|
|
||||||
check-results)))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2
sci
2
sci
|
|
@ -1 +1 @@
|
||||||
Subproject commit e85433a0214114fdceb4ca896e1b9c27b1bdf713
|
Subproject commit 2b987b90df613daedf321c0987d8e4d5fe2465c6
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
#!/usr/bin/env bb
|
|
||||||
|
|
||||||
(ns built-in
|
|
||||||
(:require [babashka.fs :as fs]
|
|
||||||
[babashka.process :refer [shell]]))
|
|
||||||
|
|
||||||
;; copy clojure spec as built-in
|
|
||||||
(fs/with-temp-dir [tmp-dir {}]
|
|
||||||
(let [tmp-dir (fs/file tmp-dir)]
|
|
||||||
(shell {:dir tmp-dir} "git clone https://github.com/babashka/spec.alpha")
|
|
||||||
(let [spec-dir (fs/file tmp-dir "spec.alpha")]
|
|
||||||
(shell {:dir spec-dir} "git reset 951b49b8c173244e66443b8188e3ff928a0a71e7 --hard")
|
|
||||||
(fs/copy-tree (fs/file spec-dir "src" "main" "clojure") (fs/file "resources" "src" "babashka")
|
|
||||||
{:replace-existing true}))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
;; GraalVM Community Edition 19.3.2 based on OpenJDK 8u252
|
;; GraalVM Community Edition 19.3.2 based on OpenJDK 8u252
|
||||||
;; GraalVM Community Edition 19.3.2 based on OpenJDK 11.0.7
|
;; GraalVM Community Edition 19.3.2 based on OpenJDK 11.0.7
|
||||||
;;
|
;;
|
||||||
;; Currently we use GraalVM java19-20.1.0
|
;; Currently we use GraalVM java11-20.1.0
|
||||||
|
|
||||||
(ns bump-graal-version
|
(ns bump-graal-version
|
||||||
(:require [clojure.string :as str]
|
(:require [clojure.string :as str]
|
||||||
|
|
@ -31,8 +31,8 @@
|
||||||
""
|
""
|
||||||
"./bump_graal_version.clj -g 19.3.2 (the new version)"
|
"./bump_graal_version.clj -g 19.3.2 (the new version)"
|
||||||
"or"
|
"or"
|
||||||
"./bump_graal_version.clj -g 19.3.2 --java java19"
|
"./bump_graal_version.clj -g 19.3.2 --java java11"
|
||||||
"(for GraalVM java19-19.3.2)"
|
"(for GraalVM java11-19.3.2)"
|
||||||
""]
|
""]
|
||||||
(str/join \newline))))
|
(str/join \newline))))
|
||||||
|
|
||||||
|
|
@ -45,8 +45,8 @@
|
||||||
"appveyor.yml"
|
"appveyor.yml"
|
||||||
"project.clj"
|
"project.clj"
|
||||||
"script/bump_graal_version.clj"
|
"script/bump_graal_version.clj"
|
||||||
".cirrus.yml"
|
".circleci/script/short_ci.clj"
|
||||||
"script/install-graalvm"])
|
".cirrus.yml"])
|
||||||
|
|
||||||
;; We might have to keep changing these from
|
;; We might have to keep changing these from
|
||||||
;; time to time whenever the version is bumped
|
;; time to time whenever the version is bumped
|
||||||
|
|
@ -54,7 +54,8 @@
|
||||||
;; OR
|
;; OR
|
||||||
;;
|
;;
|
||||||
;; We could have them as environment variables
|
;; We could have them as environment variables
|
||||||
(def current-graal-version "24")
|
(def current-graal-version "22.2.0")
|
||||||
|
(def current-java-version "java11")
|
||||||
|
|
||||||
(def cl-options
|
(def cl-options
|
||||||
[["-g" "--graal VERSION" "graal version"]
|
[["-g" "--graal VERSION" "graal version"]
|
||||||
|
|
@ -90,12 +91,19 @@
|
||||||
[args]
|
[args]
|
||||||
(when (empty? args)
|
(when (empty? args)
|
||||||
(display-help))
|
(display-help))
|
||||||
(let [new-graal-version (:graal args)]
|
(let [new-graal-version (:graal args)
|
||||||
|
new-java-version (:java args)]
|
||||||
(when (not (nil? new-graal-version))
|
(when (not (nil? new-graal-version))
|
||||||
(if (is-valid-bump? new-graal-version nil)
|
(if (is-valid-bump? new-graal-version nil)
|
||||||
(do
|
(do
|
||||||
(println "Performing Graal bump...")
|
(println "Performing Graal bump...")
|
||||||
(bump-current current-graal-version new-graal-version))
|
(bump-current current-graal-version new-graal-version))
|
||||||
(show-error new-graal-version)))))
|
(show-error new-graal-version)))
|
||||||
|
(when (not (nil? new-java-version))
|
||||||
|
(if (is-valid-bump? new-java-version nil)
|
||||||
|
(do
|
||||||
|
(println "Performing Java bump...")
|
||||||
|
(bump-current current-java-version new-java-version))
|
||||||
|
(show-error new-java-version)))))
|
||||||
|
|
||||||
(exec-script cl-args)
|
(exec-script cl-args)
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
function ver_lte() {
|
|
||||||
printf '%s\n%s' "$1" "$2" | sort -C -V
|
|
||||||
}
|
|
||||||
|
|
||||||
max_glibc_version="2.31"
|
|
||||||
current_glibc_version=$(ldd --version | head -1 | awk '{print $4}' | cut -d "-" -f 1)
|
|
||||||
|
|
||||||
function bail() {
|
|
||||||
echo "glibc greater than max version ${max_glibc_version}: ${current_glibc_version}"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
ver_lte "${current_glibc_version}" "${max_glibc_version}" || bail
|
|
||||||
|
|
@ -26,6 +26,17 @@ fi
|
||||||
export JAVA_HOME=$GRAALVM_HOME
|
export JAVA_HOME=$GRAALVM_HOME
|
||||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||||
|
|
||||||
|
rm -rf resources/*.class
|
||||||
|
# SVM_JAR=$(find -L "$GRAALVM_HOME" | grep svm.jar)
|
||||||
|
# "$GRAALVM_HOME/bin/javac" -cp "$SVM_JAR" resources/CutOffCoreServicesDependencies.java
|
||||||
|
# "$GRAALVM_HOME/bin/javac" -cp "$SVM_JAR" resources/CutOffSunAwtWwwContentAudioAiff.java
|
||||||
|
# "$GRAALVM_HOME/bin/javac" -cp "$SVM_JAR" resources/CutOffMisc.java
|
||||||
|
if [ -z "$BABASHKA_JAR" ]; then
|
||||||
|
lein with-profiles +reflection,+native-image "do" run
|
||||||
|
lein "do" clean, uberjar, metabom
|
||||||
|
BABASHKA_JAR=${BABASHKA_JAR:-"target/babashka-$BABASHKA_VERSION-standalone.jar"}
|
||||||
|
fi
|
||||||
|
|
||||||
# because script/test cleans target during ci before the jar can we saved
|
# because script/test cleans target during ci before the jar can we saved
|
||||||
cp target/metabom.jar .
|
cp target/metabom.jar .
|
||||||
|
|
||||||
|
|
@ -39,29 +50,24 @@ args=("-jar" "$BABASHKA_JAR"
|
||||||
# "-H:DashboardDump=reports/dump"
|
# "-H:DashboardDump=reports/dump"
|
||||||
# "-H:+DashboardPretty"
|
# "-H:+DashboardPretty"
|
||||||
# "-H:+DashboardJson"
|
# "-H:+DashboardJson"
|
||||||
# "-H:ReportAnalysisForbiddenType=java.awt.Toolkit:Instantiated"
|
"-H:ReportAnalysisForbiddenType=java.awt.Toolkit:InHeap,Allocated"
|
||||||
"--verbose"
|
"--verbose"
|
||||||
"--no-fallback"
|
"--no-fallback"
|
||||||
"--native-image-info"
|
"--native-image-info"
|
||||||
"--install-exit-handlers"
|
|
||||||
# --trace-class-initialization=jdk.internal.net.http.common.DebugLogger,jdk.internal.net.http.websocket.WebSocketImpl,jdk.internal.net.http.common.Utils
|
# --trace-class-initialization=jdk.internal.net.http.common.DebugLogger,jdk.internal.net.http.websocket.WebSocketImpl,jdk.internal.net.http.common.Utils
|
||||||
"$BABASHKA_XMX"
|
"$BABASHKA_XMX")
|
||||||
"--enable-preview"
|
|
||||||
"-march=compatibility" # necessary for compatibility with older machines, e.g. see https://github.com/borkdude/deps.clj/actions/runs/6337277754/job/17212028399
|
|
||||||
"-O1")
|
|
||||||
|
|
||||||
BABASHKA_STATIC=${BABASHKA_STATIC:-}
|
BABASHKA_STATIC=${BABASHKA_STATIC:-}
|
||||||
BABASHKA_MUSL=${BABASHKA_MUSL:-}
|
BABASHKA_MUSL=${BABASHKA_MUSL:-}
|
||||||
|
|
||||||
if [ "$BABASHKA_STATIC" = "true" ]; then
|
if [ "$BABASHKA_STATIC" = "true" ]; then
|
||||||
|
args+=("--static")
|
||||||
if [ "$BABASHKA_MUSL" = "true" ]; then
|
if [ "$BABASHKA_MUSL" = "true" ]; then
|
||||||
args+=("--static")
|
|
||||||
args+=("--libc=musl"
|
args+=("--libc=musl"
|
||||||
# see https://github.com/oracle/graal/issues/3398
|
# see https://github.com/oracle/graal/issues/3398
|
||||||
"-H:CCompilerOption=-Wl,-z,stack-size=2097152")
|
"-H:CCompilerOption=-Wl,-z,stack-size=2097152")
|
||||||
else
|
else
|
||||||
# see https://github.com/oracle/graal/issues/3737
|
# see https://github.com/oracle/graal/issues/3737
|
||||||
args+=("-H:+UnlockExperimentalVMOptions")
|
|
||||||
args+=("-H:+StaticExecutableWithDynamicLibC")
|
args+=("-H:+StaticExecutableWithDynamicLibC")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -107,14 +113,4 @@ then
|
||||||
export BABASHKA_FEATURE_PRIORITY_MAP="${BABASHKA_FEATURE_PRIORITY_MAP:-false}"
|
export BABASHKA_FEATURE_PRIORITY_MAP="${BABASHKA_FEATURE_PRIORITY_MAP:-false}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${BABASHKA_SHA:-}" ]]
|
"$GRAALVM_HOME/bin/native-image" "${args[@]}"
|
||||||
then
|
|
||||||
sha=$(git rev-parse HEAD)
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
export BABASHKA_SHA=$sha
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$GRAALVM_HOME/bin/native-image" "${args[@]}" "$@"
|
|
||||||
|
|
||||||
./"$BABASHKA_BINARY" describe
|
|
||||||
|
|
|
||||||
|
|
@ -23,27 +23,14 @@ Rem -H:EnableURLProtocols=jar,http,https is also not supported.
|
||||||
|
|
||||||
call %GRAALVM_HOME%\bin\gu.cmd install native-image
|
call %GRAALVM_HOME%\bin\gu.cmd install native-image
|
||||||
|
|
||||||
if "%BABASHKA_SHA%"=="" (
|
|
||||||
for /f %%i in ('git rev-parse HEAD') do set sha=%%i
|
|
||||||
if not errorlevel 1 (
|
|
||||||
set BABASHKA_SHA=%sha%
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
call %GRAALVM_HOME%\bin\native-image.cmd ^
|
call %GRAALVM_HOME%\bin\native-image.cmd ^
|
||||||
"-jar" "target/babashka-%BABASHKA_VERSION%-standalone.jar" ^
|
"-jar" "target/babashka-%BABASHKA_VERSION%-standalone.jar" ^
|
||||||
"-H:Name=bb" ^
|
"-H:Name=bb" ^
|
||||||
"-H:+ReportExceptionStackTraces" ^
|
"-H:+ReportExceptionStackTraces" ^
|
||||||
"--verbose" ^
|
"--verbose" ^
|
||||||
"--no-fallback" ^
|
"--no-fallback" ^
|
||||||
"--enable-preview" ^
|
"%BABASHKA_XMX%"
|
||||||
"--install-exit-handlers" ^
|
|
||||||
"-march=compatibility" ^
|
|
||||||
"-O1" ^
|
|
||||||
"%BABASHKA_XMX%" ^
|
|
||||||
%*
|
|
||||||
|
|
||||||
if %errorlevel% neq 0 exit /b %errorlevel%
|
if %errorlevel% neq 0 exit /b %errorlevel%
|
||||||
|
|
||||||
call bb "(+ 1 2 3)"
|
call bb "(+ 1 2 3)"
|
||||||
call bb describe
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
CLOJURE_TOOLS_VERSION="1.11.1.1200"
|
CLOJURE_TOOLS_VERSION="1.10.3.1040"
|
||||||
|
|
||||||
install_dir="${1:-/usr/local}"
|
install_dir="${1:-/usr/local}"
|
||||||
mkdir -p "$install_dir"
|
mkdir -p "$install_dir"
|
||||||
|
|
|
||||||
|
|
@ -4,33 +4,34 @@ set -euo pipefail
|
||||||
|
|
||||||
INSTALL_DIR="${1:-$HOME}"
|
INSTALL_DIR="${1:-$HOME}"
|
||||||
|
|
||||||
GRAALVM_VERSION="${GRAALVM_VERSION:-24}"
|
GRAALVM_VERSION="${GRAALVM_VERSION:-21.2.0}"
|
||||||
|
|
||||||
GRAALVM_PLATFORM=$BABASHKA_PLATFORM
|
case "$BABASHKA_PLATFORM" in
|
||||||
|
macos)
|
||||||
case "${BABASHKA_ARCH:-}" in
|
GRAALVM_PLATFORM="darwin"
|
||||||
aarch64)
|
;;
|
||||||
GRAALVM_ARCH="aarch64"
|
linux)
|
||||||
;;
|
GRAALVM_PLATFORM="linux"
|
||||||
*)
|
;;
|
||||||
GRAALVM_ARCH="x64"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
GRAALVM_DIR_NAME="graalvm-$GRAALVM_VERSION"
|
case "${BABASHKA_ARCH:-}" in
|
||||||
GRAALVM_FILENAME="graalvm-jdk-${GRAALVM_VERSION}_${GRAALVM_PLATFORM}-${GRAALVM_ARCH}_bin.tar.gz"
|
aarch64)
|
||||||
DOWNLOAD_URL="https://download.oracle.com/graalvm/${GRAALVM_VERSION}/archive/${GRAALVM_FILENAME}"
|
GRAALVM_ARCH="aarch64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
GRAALVM_ARCH="amd64"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
GRAALVM_FILENAME="graalvm-ce-java11-$GRAALVM_PLATFORM-$GRAALVM_ARCH-$GRAALVM_VERSION.tar.gz"
|
||||||
|
|
||||||
pushd "$INSTALL_DIR" >/dev/null
|
pushd "$INSTALL_DIR" >/dev/null
|
||||||
|
|
||||||
if ! [ -d "$GRAALVM_DIR_NAME" ]; then
|
if ! [ -d "graalvm-ce-java11-$GRAALVM_VERSION" ]; then
|
||||||
echo "Downloading GraalVM $GRAALVM_PLATFORM-$GRAALVM_ARCH-$GRAALVM_VERSION on '$PWD'..."
|
echo "Downloading GraalVM $GRAALVM_PLATFORM-$GRAALVM_ARCH-$GRAALVM_VERSION on '$PWD'..."
|
||||||
echo "$DOWNLOAD_URL"
|
curl -O -sL "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-$GRAALVM_VERSION/$GRAALVM_FILENAME"
|
||||||
curl --fail -LO "$DOWNLOAD_URL"
|
tar xzf "$GRAALVM_FILENAME"
|
||||||
ls -la
|
|
||||||
mkdir "$GRAALVM_DIR_NAME"
|
|
||||||
tar xzvf "$GRAALVM_FILENAME" -C "$GRAALVM_DIR_NAME" --strip-components 1
|
|
||||||
ls -la "$GRAALVM_DIR_NAME"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,14 @@
|
||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
: "${BABASHKA_TEST_ENV:=jvm}"
|
|
||||||
export BABASHKA_TEST_ENV
|
|
||||||
|
|
||||||
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
|
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
|
||||||
BB_CMD="./bb"
|
BB_CMD="./bb"
|
||||||
else
|
else
|
||||||
BB_CMD="lein bb"
|
BB_CMD="lein bb"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PATH
|
|
||||||
PATH=$(pwd)/process/target/test/on-path:$PATH
|
|
||||||
|
|
||||||
export BABASHKA_CLASSPATH
|
export BABASHKA_CLASSPATH
|
||||||
BABASHKA_CLASSPATH=$(clojure -Spath -A:lib-tests)
|
BABASHKA_CLASSPATH=$(clojure -A:lib-tests -Spath)
|
||||||
|
|
||||||
$BB_CMD -cp "$BABASHKA_CLASSPATH" \
|
$BB_CMD -cp "$BABASHKA_CLASSPATH" \
|
||||||
-f "test-resources/lib_tests/babashka/run_all_libtests.clj" "$@"
|
-f "test-resources/lib_tests/babashka/run_all_libtests.clj" "$@"
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
if not defined BABASHKA_TEST_ENV set BABASHKA_TEST_ENV=jvm
|
|
||||||
|
|
||||||
if "%BABASHKA_TEST_ENV%" EQU "native" (set BB_CMD=.\bb) else (set BB_CMD=lein bb)
|
if "%BABASHKA_TEST_ENV%" EQU "native" (set BB_CMD=.\bb) else (set BB_CMD=lein bb)
|
||||||
|
|
||||||
set EDN=lib_tests.edn
|
set EDN=lib_tests.edn
|
||||||
|
|
||||||
set PATH=%CD%\process\target\test\on-path;%PATH%
|
|
||||||
|
|
||||||
.\bb -f script/lib_tests/bb_edn_from_deps.clj %EDN%
|
.\bb -f script/lib_tests/bb_edn_from_deps.clj %EDN%
|
||||||
|
|
||||||
%BB_CMD% --config %EDN% --deps-root . -f test-resources/lib_tests/babashka/run_all_libtests.clj %*
|
%BB_CMD% --config %EDN% --deps-root . -f test-resources/lib_tests/babashka/run_all_libtests.clj %*
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ fi
|
||||||
|
|
||||||
apt-get update -y && apt-get install musl-tools -y
|
apt-get update -y && apt-get install musl-tools -y
|
||||||
|
|
||||||
ZLIB_VERSION="1.2.13"
|
ZLIB_VERSION="1.2.11"
|
||||||
ZLIB_SHA256="b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30"
|
ZLIB_SHA256="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1"
|
||||||
|
|
||||||
# stable archive path
|
# stable archive path
|
||||||
curl -O -sL --fail --show-error "https://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz"
|
curl -O -sL --fail --show-error "https://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz"
|
||||||
|
|
|
||||||
16
script/test
16
script/test
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eo pipefail
|
|
||||||
|
|
||||||
if [ "$GRAALVM_HOME" != "" ]
|
if [ "$GRAALVM_HOME" != "" ]
|
||||||
then
|
then
|
||||||
export JAVA_HOME=$GRAALVM_HOME
|
export JAVA_HOME=$GRAALVM_HOME
|
||||||
|
|
@ -10,6 +8,7 @@ fi
|
||||||
|
|
||||||
java -version
|
java -version
|
||||||
|
|
||||||
|
set -eo pipefail
|
||||||
unset BABASHKA_PRELOADS
|
unset BABASHKA_PRELOADS
|
||||||
unset BABASHKA_CLASSPATH
|
unset BABASHKA_CLASSPATH
|
||||||
unset BABASHKA_PRELOADS_TEST
|
unset BABASHKA_PRELOADS_TEST
|
||||||
|
|
@ -17,9 +16,6 @@ unset BABASHKA_PRELOADS_TEST
|
||||||
echo "running tests part 1"
|
echo "running tests part 1"
|
||||||
lein "do" clean, test "$@"
|
lein "do" clean, test "$@"
|
||||||
|
|
||||||
echo "running flaky tests"
|
|
||||||
lein "do" clean, test :flaky || true
|
|
||||||
|
|
||||||
export BABASHKA_PRELOADS='(defn __bb__foo [] "foo") (defn __bb__bar [] "bar")'
|
export BABASHKA_PRELOADS='(defn __bb__foo [] "foo") (defn __bb__bar [] "bar")'
|
||||||
export BABASHKA_PRELOADS_TEST=true
|
export BABASHKA_PRELOADS_TEST=true
|
||||||
echo "running tests part 2"
|
echo "running tests part 2"
|
||||||
|
|
@ -41,13 +37,3 @@ lein test :only babashka.pod-test
|
||||||
|
|
||||||
export BABASHKA_SOCKET_REPL_TEST=true
|
export BABASHKA_SOCKET_REPL_TEST=true
|
||||||
lein test :only babashka.impl.socket-repl-test
|
lein test :only babashka.impl.socket-repl-test
|
||||||
|
|
||||||
# test invoking script in subdir with bb.edn in parent dir
|
|
||||||
unset BABASHKA_PRELOADS
|
|
||||||
unset BABASHKA_CLASSPATH
|
|
||||||
pushd test-resources/bb_in_root_script_in_other_dir
|
|
||||||
if [[ $BABASHKA_TEST_ENV = "native" ]]
|
|
||||||
then
|
|
||||||
../../bb dir/script.clj
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,7 @@ set BABASHKA_POD_TEST=
|
||||||
set BABASHKA_SOCKET_REPL_TEST=
|
set BABASHKA_SOCKET_REPL_TEST=
|
||||||
|
|
||||||
echo "running tests part 1"
|
echo "running tests part 1"
|
||||||
call lein do clean, test %* || exit /B 1
|
call lein do clean, test :windows || exit /B 1
|
||||||
|
|
||||||
echo "running flaky tests"
|
|
||||||
REM there's no "or exit" here because we don't want flaky tests to fail the script
|
|
||||||
call lein do clean, test :flaky
|
|
||||||
|
|
||||||
set BABASHKA_PRELOADS=(defn __bb__foo [] "foo") (defn __bb__bar [] "bar")
|
set BABASHKA_PRELOADS=(defn __bb__foo [] "foo") (defn __bb__bar [] "bar")
|
||||||
set BABASHKA_PRELOADS_TEST=true
|
set BABASHKA_PRELOADS_TEST=true
|
||||||
|
|
|
||||||
|
|
@ -175,18 +175,8 @@ else
|
||||||
BABASHKA_LEIN_PROFILES+=",-feature/rrb-vector"
|
BABASHKA_LEIN_PROFILES+=",-feature/rrb-vector"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#lein with-profiles "$BABASHKA_LEIN_PROFILES,+reflection,-uberjar" deps :tree
|
|
||||||
#exit 0
|
|
||||||
|
|
||||||
mkdir -p resources/META-INF/babashka
|
|
||||||
cp deps.edn resources/META-INF/babashka/deps.edn
|
cp deps.edn resources/META-INF/babashka/deps.edn
|
||||||
|
|
||||||
rm -rf resources/*.class
|
|
||||||
# SVM_JAR=$(find -L "$GRAALVM_HOME" | grep svm.jar)
|
|
||||||
# "$GRAALVM_HOME/bin/javac" -cp "$SVM_JAR" resources/UrlClassLoaderSubstitutions.java
|
|
||||||
# "$GRAALVM_HOME/bin/javac" -cp "$SVM_JAR" resources/CutOffSunAwtWwwContentAudioAiff.java
|
|
||||||
# "$GRAALVM_HOME/bin/javac" -cp "$SVM_JAR" resources/CutOffMisc.java
|
|
||||||
|
|
||||||
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, metabom
|
lein with-profiles "$BABASHKA_LEIN_PROFILES" do clean, uberjar, metabom
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,4 @@
|
||||||
(ns aaaa-this-has-to-be-first.because-patches
|
(ns aaaa-this-has-to-be-first.because-patches
|
||||||
;; we need pprint loaded first, it patches pprint to not bloat the GraalVM binary
|
;; we need pprint loaded first, it patches pprint to not bloat the GraalVM binary
|
||||||
(:require [babashka.impl.patches.datafy]
|
(:require [babashka.impl.patches.datafy]
|
||||||
[babashka.impl.pprint]
|
[babashka.impl.pprint]))
|
||||||
))
|
|
||||||
|
|
||||||
;; Enable this for scanning requiring usage:
|
|
||||||
(def enable-require-scan
|
|
||||||
"(do
|
|
||||||
(def old-require require)
|
|
||||||
(def old-resolve resolve)
|
|
||||||
|
|
||||||
(def our-requiring-resolve (fn [sym]
|
|
||||||
(let [ns (symbol (namespace sym))]
|
|
||||||
(old-require ns)
|
|
||||||
(old-resolve sym))))
|
|
||||||
|
|
||||||
(defn static-requiring-resolve [form _ _]
|
|
||||||
(prn :req-resolve form :args (rest form))
|
|
||||||
`(let [res# (our-requiring-resolve ~@(rest form))]
|
|
||||||
res#))
|
|
||||||
|
|
||||||
(alter-var-root #'requiring-resolve (constantly @#'static-requiring-resolve))
|
|
||||||
(doto #'requiring-resolve (.setMacro))
|
|
||||||
|
|
||||||
(defn static-require [& [&form _bindings & syms]]
|
|
||||||
(when (meta &form)
|
|
||||||
(prn :require &form (meta &form) *file*))
|
|
||||||
`(old-require ~@syms))
|
|
||||||
(alter-var-root #'require (constantly @#'static-require))
|
|
||||||
(doto #'require (.setMacro))
|
|
||||||
|
|
||||||
(alter-var-root #'clojure.core/serialized-require (constantly (fn [& args]
|
|
||||||
(prn :serialized-req args)))))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(defn static-resolve [& [&form _bindings & syms]]
|
|
||||||
(when (meta &form)
|
|
||||||
(prn :require &form (meta &form) *file*))
|
|
||||||
`(old-resolve ~@syms))
|
|
||||||
(alter-var-root #'resolve (constantly @#'static-resolve))
|
|
||||||
(doto #'resolve (.setMacro))
|
|
||||||
")
|
|
||||||
|
|
||||||
|
|
||||||
(when (System/getenv "BABASHKA_REQUIRE_SCAN")
|
|
||||||
(load-string enable-require-scan))
|
|
||||||
;; ---
|
|
||||||
|
|
|
||||||
|
|
@ -22,29 +22,30 @@
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
(-> (clojure {:out :string} '-M '-e '(+ 1 2 3)]) deref :out) returns
|
(-> (clojure '[-M -e (+ 1 2 3)] {:out :string}) deref :out) returns
|
||||||
\"6\n\".
|
\"6\n\".
|
||||||
|
|
||||||
(-> @(clojure) :exit) starts a clojure REPL, waits for it
|
(-> @(clojure) :exit) starts a clojure REPL, waits for it
|
||||||
to finish and returns the exit code from the process."
|
to finish and returns the exit code from the process."
|
||||||
[& args]
|
([] (clojure []))
|
||||||
(let [{:keys [cmd opts prev]} (p/parse-args args)
|
([args] (clojure args nil))
|
||||||
opts (merge {:in :inherit
|
([args opts]
|
||||||
:out :inherit
|
(let [opts (merge {:in :inherit
|
||||||
:err :inherit
|
:out :inherit
|
||||||
:shutdown p/destroy-tree}
|
:err :inherit
|
||||||
opts)]
|
:shutdown p/destroy-tree}
|
||||||
(binding [*in* @sci/in
|
opts)]
|
||||||
*out* @sci/out
|
(binding [*in* @sci/in
|
||||||
*err* @sci/err
|
*out* @sci/out
|
||||||
deps/*dir* (:dir opts)
|
*err* @sci/err
|
||||||
deps/*aux-process-fn* (fn [{:keys [cmd out]}]
|
deps/*dir* (:dir opts)
|
||||||
(pp/shell (assoc opts :out out :cmd cmd)))
|
deps/*env* (:env opts)
|
||||||
deps/*clojure-process-fn* (fn [{:keys [cmd]}]
|
deps/*extra-env* (:extra-env opts)
|
||||||
(pp/process* {:cmd cmd
|
deps/*process-fn* (fn
|
||||||
:prev prev
|
([cmd] (pp/process cmd opts))
|
||||||
:opts opts}))
|
([cmd _] (pp/process cmd opts)))
|
||||||
deps/*exit-fn* (fn [{:keys [message]}]
|
deps/*exit-fn* (fn
|
||||||
(when message
|
([_])
|
||||||
(throw (Exception. message))))]
|
([_exit-code msg]
|
||||||
(apply deps/-main cmd))))
|
(throw (Exception. msg))))]
|
||||||
|
(apply deps/-main (map str args))))))
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
(ns babashka.dude
|
|
||||||
(:require [clojure-csv.core :as csv]
|
|
||||||
[clojure.java.io :as io]
|
|
||||||
[clojure.string :as string]))
|
|
||||||
|
|
||||||
csv/x
|
|
||||||
io/x
|
|
||||||
string/x
|
|
||||||
|
|
@ -1,120 +1,25 @@
|
||||||
(ns babashka.impl.cheshire
|
(ns babashka.impl.cheshire
|
||||||
{:no-doc true}
|
{:no-doc true}
|
||||||
(:require [cheshire.core :as json]
|
(:require [cheshire.core :as json]
|
||||||
[cheshire.factory :as fact]
|
|
||||||
[sci.core :as sci :refer [copy-var]]))
|
[sci.core :as sci :refer [copy-var]]))
|
||||||
|
|
||||||
(def tns (sci/create-ns 'cheshire.core nil))
|
(def tns (sci/create-ns 'cheshire.core nil))
|
||||||
(def fns (sci/create-ns 'cheshire.factory nil))
|
|
||||||
|
|
||||||
(def json-factory (sci/new-dynamic-var '*json-factory* nil {:ns fns}))
|
|
||||||
|
|
||||||
;; wrap cheshire fns to support `*json-factory*` dynamic var
|
|
||||||
|
|
||||||
(defn generate-string
|
|
||||||
([obj]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/generate-string obj)))
|
|
||||||
([obj opt-map]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/generate-string obj opt-map))))
|
|
||||||
|
|
||||||
(defn generate-stream
|
|
||||||
([obj writer]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/generate-stream obj writer)))
|
|
||||||
([obj writer opt-map]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/generate-stream obj writer opt-map))))
|
|
||||||
|
|
||||||
(defn parse-string
|
|
||||||
([string]
|
|
||||||
(when string
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-string string))))
|
|
||||||
([string key-fn]
|
|
||||||
(when string
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-string string key-fn))))
|
|
||||||
([^String string key-fn array-coerce-fn]
|
|
||||||
(when string
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-string string key-fn array-coerce-fn)))))
|
|
||||||
|
|
||||||
(defn parse-string-strict
|
|
||||||
([string]
|
|
||||||
(when string
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-string-strict string))))
|
|
||||||
([string key-fn]
|
|
||||||
(when string
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-string-strict string key-fn))))
|
|
||||||
([^String string key-fn array-coerce-fn]
|
|
||||||
(when string
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-string-strict string key-fn array-coerce-fn)))))
|
|
||||||
|
|
||||||
(defn parse-stream
|
|
||||||
([rdr]
|
|
||||||
(when rdr
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-stream rdr))))
|
|
||||||
([rdr key-fn]
|
|
||||||
(when rdr
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-stream rdr key-fn))))
|
|
||||||
([rdr key-fn array-coerce-fn]
|
|
||||||
(when rdr
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-stream rdr key-fn array-coerce-fn)))))
|
|
||||||
|
|
||||||
(defn parse-stream-strict
|
|
||||||
([rdr]
|
|
||||||
(when rdr
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-stream-strict rdr))))
|
|
||||||
([rdr key-fn]
|
|
||||||
(when rdr
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-stream-strict rdr key-fn))))
|
|
||||||
([rdr key-fn array-coerce-fn]
|
|
||||||
(when rdr
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parse-stream-strict rdr key-fn array-coerce-fn)))))
|
|
||||||
|
|
||||||
(defn parsed-seq
|
|
||||||
([reader]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parsed-seq reader)))
|
|
||||||
([reader key-fn]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parsed-seq reader key-fn)))
|
|
||||||
([reader key-fn array-coerce-fn]
|
|
||||||
(binding [fact/*json-factory* @json-factory]
|
|
||||||
(json/parsed-seq reader key-fn array-coerce-fn))))
|
|
||||||
|
|
||||||
(def cheshire-core-namespace
|
(def cheshire-core-namespace
|
||||||
{'encode (copy-var generate-string tns)
|
{'encode (copy-var json/encode tns)
|
||||||
'generate-string (copy-var generate-string tns)
|
'generate-string (copy-var json/generate-string tns)
|
||||||
'encode-stream (copy-var generate-stream tns)
|
'encode-stream (copy-var json/encode-stream tns)
|
||||||
'generate-stream (copy-var generate-stream tns)
|
'generate-stream (copy-var json/generate-stream tns)
|
||||||
;;'encode-smile (copy-var json/encode-smile tns)
|
;;'encode-smile (copy-var json/encode-smile tns)
|
||||||
;;'generate-smile (copy-var json/generate-smile tns)
|
;;'generate-smile (copy-var json/generate-smile tns)
|
||||||
'decode (copy-var parse-string tns)
|
'decode (copy-var json/decode tns)
|
||||||
'parse-string (copy-var parse-string tns)
|
'parse-string (copy-var json/parse-string tns)
|
||||||
'parse-string-strict (copy-var parse-string-strict tns)
|
'parse-string-strict (copy-var json/parse-string-strict tns)
|
||||||
;;'parse-smile (copy-var json/parse-smile tns)
|
;;'parse-smile (copy-var json/parse-smile tns)
|
||||||
'parse-stream (copy-var parse-stream tns)
|
'parse-stream (copy-var json/parse-stream tns)
|
||||||
'parse-stream-strict (copy-var parse-stream-strict tns)
|
'parse-stream-strict (copy-var json/parse-stream-strict tns)
|
||||||
'parsed-seq (copy-var parsed-seq tns)
|
'parsed-seq (copy-var json/parsed-seq tns)
|
||||||
;;'parsed-smile-seq (copy-var json/parsed-smile-seq tns)
|
;;'parsed-smile-seq (copy-var json/parsed-smile-seq tns)
|
||||||
;;'decode-smile (copy-var json/decode-smile tns)
|
;;'decode-smile (copy-var json/decode-smile tns)
|
||||||
'default-pretty-print-options (copy-var json/default-pretty-print-options tns)
|
'default-pretty-print-options (copy-var json/default-pretty-print-options tns)
|
||||||
'create-pretty-printer (copy-var json/create-pretty-printer tns)})
|
'create-pretty-printer (copy-var json/create-pretty-printer tns)})
|
||||||
|
|
||||||
(def cheshire-factory-namespace
|
|
||||||
{'*json-factory* json-factory
|
|
||||||
'default-factory-options (copy-var fact/default-factory-options fns)
|
|
||||||
'json-factory (copy-var fact/json-factory fns)
|
|
||||||
'make-json-factory (copy-var fact/make-json-factory fns)})
|
|
||||||
|
|
|
||||||
|
|
@ -8,18 +8,6 @@
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[sci.impl.types :as t]))
|
[sci.impl.types :as t]))
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
|
||||||
|
|
||||||
(def has-of-virtual?
|
|
||||||
(some #(= "ofVirtual" (.getName ^java.lang.reflect.Method %))
|
|
||||||
(.getMethods Thread)))
|
|
||||||
|
|
||||||
(def has-domain-sockets?
|
|
||||||
(resolve 'java.net.UnixDomainSocketAddress))
|
|
||||||
|
|
||||||
(def has-graal-process-properties?
|
|
||||||
(resolve 'org.graalvm.nativeimage.ProcessProperties))
|
|
||||||
|
|
||||||
(def base-custom-map
|
(def base-custom-map
|
||||||
`{clojure.lang.LineNumberingPushbackReader {:allPublicConstructors true
|
`{clojure.lang.LineNumberingPushbackReader {:allPublicConstructors true
|
||||||
:allPublicMethods true}
|
:allPublicMethods true}
|
||||||
|
|
@ -59,10 +47,7 @@
|
||||||
{:name "sleep"}
|
{:name "sleep"}
|
||||||
{:name "start"}
|
{:name "start"}
|
||||||
{:name "toString"}
|
{:name "toString"}
|
||||||
{:name "yield"}
|
{:name "yield"}]}
|
||||||
~@(when has-of-virtual? [{:name "ofVirtual"}
|
|
||||||
{:name "startVirtualThread"}
|
|
||||||
{:name "isVirtual"}])]}
|
|
||||||
java.net.URL
|
java.net.URL
|
||||||
{:allPublicConstructors true
|
{:allPublicConstructors true
|
||||||
:allPublicFields true
|
:allPublicFields true
|
||||||
|
|
@ -91,8 +76,7 @@
|
||||||
java.util.Arrays
|
java.util.Arrays
|
||||||
{:methods [{:name "copyOf"}
|
{:methods [{:name "copyOf"}
|
||||||
{:name "copyOfRange"}
|
{:name "copyOfRange"}
|
||||||
{:name "equals"}
|
{:name "equals"}]}
|
||||||
{:name "fill"}]}
|
|
||||||
;; this fixes clojure.lang.Reflector for Java 11
|
;; this fixes clojure.lang.Reflector for Java 11
|
||||||
java.lang.reflect.AccessibleObject
|
java.lang.reflect.AccessibleObject
|
||||||
{:methods [{:name "canAccess"}]}
|
{:methods [{:name "canAccess"}]}
|
||||||
|
|
@ -127,22 +111,14 @@
|
||||||
clojure.lang.RT
|
clojure.lang.RT
|
||||||
{:methods [{:name "aget"}
|
{:methods [{:name "aget"}
|
||||||
{:name "aset"}
|
{:name "aset"}
|
||||||
{:name "aclone"}
|
{:name "aclone"}]}
|
||||||
{:name "iter"}
|
|
||||||
;; we expose this via the Compiler/LOADER dynamic var
|
|
||||||
{:name "baseLoader"}]}
|
|
||||||
clojure.lang.Compiler
|
clojure.lang.Compiler
|
||||||
{:fields [{:name "specials"}
|
{:fields [{:name "specials"}
|
||||||
{:name "CHAR_MAP"}]}
|
{:name "CHAR_MAP"}]}
|
||||||
clojure.lang.PersistentHashMap
|
clojure.lang.PersistentHashMap
|
||||||
{:fields [{:name "EMPTY"}]}
|
{:fields [{:name "EMPTY"}]}
|
||||||
clojure.lang.APersistentVector
|
clojure.lang.APersistentVector
|
||||||
{:methods [{:name "indexOf"}
|
{:methods [{:name "indexOf"}]}
|
||||||
{:name "contains"}]}
|
|
||||||
clojure.lang.LazySeq
|
|
||||||
{:allPublicConstructors true,
|
|
||||||
:methods [{:name "indexOf"}
|
|
||||||
{:name "contains"}]}
|
|
||||||
clojure.lang.ILookup
|
clojure.lang.ILookup
|
||||||
{:methods [{:name "valAt"}]}
|
{:methods [{:name "valAt"}]}
|
||||||
clojure.lang.IPersistentMap
|
clojure.lang.IPersistentMap
|
||||||
|
|
@ -161,39 +137,19 @@
|
||||||
{:methods [{:name "hasNext"}
|
{:methods [{:name "hasNext"}
|
||||||
{:name "next"}]}
|
{:name "next"}]}
|
||||||
java.util.TimeZone
|
java.util.TimeZone
|
||||||
{:methods [{:name "getTimeZone"}]}
|
{:methods [{:name "getTimeZone"}]}})
|
||||||
java.net.URLClassLoader
|
|
||||||
{:methods [{:name "close"}
|
|
||||||
{:name "findResource"}
|
|
||||||
{:name "findResources"}
|
|
||||||
{:name "getResourceAsStream"}
|
|
||||||
{:name "getURLs"}]}
|
|
||||||
java.lang.ClassLoader
|
|
||||||
{:methods [{:name "getResource"}
|
|
||||||
{:name "getResources"}
|
|
||||||
{:name "getResourceAsStream"}
|
|
||||||
{:name "getParent"}]}
|
|
||||||
clojure.lang.ARef
|
|
||||||
{:methods [{:name "getWatches"}]}
|
|
||||||
clojure.lang.MapEntry
|
|
||||||
{:allPublicConstructors true
|
|
||||||
:methods [{:name "create"}]}})
|
|
||||||
|
|
||||||
(def custom-map
|
(def custom-map
|
||||||
(cond->
|
(cond->
|
||||||
(merge base-custom-map
|
(merge base-custom-map
|
||||||
proxy/custom-reflect-map)
|
proxy/custom-reflect-map)
|
||||||
features/hsqldb? (assoc `org.hsqldb.dbinfo.DatabaseInformationFull
|
features/hsqldb? (assoc `org.hsqldb.dbinfo.DatabaseInformationFull
|
||||||
{:methods [{:name "<init>"
|
{:methods [{:name "<init>"
|
||||||
:parameterTypes ["org.hsqldb.Database"]}]}
|
:parameterTypes ["org.hsqldb.Database"]}]}
|
||||||
`java.util.ResourceBundle
|
`java.util.ResourceBundle
|
||||||
{:methods [{:name "getBundle"
|
{:methods [{:name "getBundle"
|
||||||
:parameterTypes ["java.lang.String","java.util.Locale",
|
:parameterTypes ["java.lang.String","java.util.Locale",
|
||||||
"java.lang.ClassLoader"]}]})
|
"java.lang.ClassLoader"]}]})))
|
||||||
|
|
||||||
has-graal-process-properties?
|
|
||||||
(assoc `org.graalvm.nativeimage.ProcessProperties
|
|
||||||
{:methods [{:name "exec"}]})))
|
|
||||||
|
|
||||||
(def java-net-http-classes
|
(def java-net-http-classes
|
||||||
"These classes must be initialized at run time since GraalVM 22.1"
|
"These classes must be initialized at run time since GraalVM 22.1"
|
||||||
|
|
@ -223,16 +179,7 @@
|
||||||
java.net.http.WebSocket$Builder
|
java.net.http.WebSocket$Builder
|
||||||
java.net.http.WebSocket$Listener
|
java.net.http.WebSocket$Listener
|
||||||
java.security.cert.X509Certificate
|
java.security.cert.X509Certificate
|
||||||
java.security.cert.CertificateFactory
|
|
||||||
java.security.Signature
|
|
||||||
javax.crypto.Cipher
|
|
||||||
javax.crypto.KeyAgreement
|
|
||||||
javax.crypto.Mac
|
javax.crypto.Mac
|
||||||
javax.crypto.SecretKey
|
|
||||||
javax.crypto.SecretKeyFactory
|
|
||||||
javax.crypto.spec.GCMParameterSpec
|
|
||||||
javax.crypto.spec.IvParameterSpec
|
|
||||||
javax.crypto.spec.PBEKeySpec
|
|
||||||
javax.crypto.spec.SecretKeySpec
|
javax.crypto.spec.SecretKeySpec
|
||||||
javax.net.ssl.HostnameVerifier ;; clj-http-lite
|
javax.net.ssl.HostnameVerifier ;; clj-http-lite
|
||||||
javax.net.ssl.HttpsURLConnection ;; clj-http-lite
|
javax.net.ssl.HttpsURLConnection ;; clj-http-lite
|
||||||
|
|
@ -244,9 +191,6 @@
|
||||||
javax.net.ssl.TrustManager
|
javax.net.ssl.TrustManager
|
||||||
javax.net.ssl.TrustManagerFactory
|
javax.net.ssl.TrustManagerFactory
|
||||||
javax.net.ssl.X509TrustManager
|
javax.net.ssl.X509TrustManager
|
||||||
javax.net.ssl.X509ExtendedTrustManager
|
|
||||||
javax.net.ssl.SSLSocket
|
|
||||||
javax.net.ssl.SSLSocketFactory
|
|
||||||
jdk.internal.net.http.HttpClientBuilderImpl
|
jdk.internal.net.http.HttpClientBuilderImpl
|
||||||
jdk.internal.net.http.HttpClientFacade
|
jdk.internal.net.http.HttpClientFacade
|
||||||
jdk.internal.net.http.HttpRequestBuilderImpl
|
jdk.internal.net.http.HttpRequestBuilderImpl
|
||||||
|
|
@ -255,10 +199,6 @@
|
||||||
jdk.internal.net.http.websocket.BuilderImpl
|
jdk.internal.net.http.websocket.BuilderImpl
|
||||||
jdk.internal.net.http.websocket.WebSocketImpl])
|
jdk.internal.net.http.websocket.WebSocketImpl])
|
||||||
|
|
||||||
(def thread-builder
|
|
||||||
(try (Class/forName "java.lang.Thread$Builder")
|
|
||||||
(catch Exception _ nil)))
|
|
||||||
|
|
||||||
(def classes
|
(def classes
|
||||||
`{:all [clojure.lang.ArityException
|
`{:all [clojure.lang.ArityException
|
||||||
clojure.lang.BigInt
|
clojure.lang.BigInt
|
||||||
|
|
@ -283,7 +223,6 @@
|
||||||
java.io.FileOutputStream
|
java.io.FileOutputStream
|
||||||
java.io.FileReader
|
java.io.FileReader
|
||||||
java.io.FileWriter
|
java.io.FileWriter
|
||||||
java.io.LineNumberReader
|
|
||||||
java.io.RandomAccessFile
|
java.io.RandomAccessFile
|
||||||
java.io.InputStream
|
java.io.InputStream
|
||||||
java.io.IOException
|
java.io.IOException
|
||||||
|
|
@ -313,7 +252,6 @@
|
||||||
java.lang.ClassNotFoundException
|
java.lang.ClassNotFoundException
|
||||||
java.lang.Comparable
|
java.lang.Comparable
|
||||||
java.lang.Double
|
java.lang.Double
|
||||||
java.lang.Error
|
|
||||||
java.lang.Exception
|
java.lang.Exception
|
||||||
java.lang.Float
|
java.lang.Float
|
||||||
java.lang.IllegalArgumentException
|
java.lang.IllegalArgumentException
|
||||||
|
|
@ -335,18 +273,13 @@
|
||||||
java.lang.ProcessBuilder$Redirect
|
java.lang.ProcessBuilder$Redirect
|
||||||
java.lang.Runtime
|
java.lang.Runtime
|
||||||
java.lang.RuntimeException
|
java.lang.RuntimeException
|
||||||
java.lang.SecurityException
|
|
||||||
java.lang.Short
|
java.lang.Short
|
||||||
java.lang.StackTraceElement
|
java.lang.StackTraceElement
|
||||||
java.lang.String
|
java.lang.String
|
||||||
java.lang.StringBuilder
|
java.lang.StringBuilder
|
||||||
java.lang.System
|
java.lang.System
|
||||||
java.lang.Throwable
|
java.lang.Throwable
|
||||||
java.lang.ThreadLocal
|
;; java.lang.UnsupportedOperationException
|
||||||
java.lang.Thread$UncaughtExceptionHandler
|
|
||||||
~@(when thread-builder
|
|
||||||
'[java.lang.Thread$Builder])
|
|
||||||
java.lang.UnsupportedOperationException
|
|
||||||
java.lang.ref.WeakReference
|
java.lang.ref.WeakReference
|
||||||
java.lang.ref.ReferenceQueue
|
java.lang.ref.ReferenceQueue
|
||||||
java.lang.ref.Cleaner
|
java.lang.ref.Cleaner
|
||||||
|
|
@ -361,17 +294,12 @@
|
||||||
java.net.HttpURLConnection
|
java.net.HttpURLConnection
|
||||||
java.net.InetAddress
|
java.net.InetAddress
|
||||||
java.net.InetSocketAddress
|
java.net.InetSocketAddress
|
||||||
java.net.StandardProtocolFamily
|
|
||||||
java.net.ServerSocket
|
java.net.ServerSocket
|
||||||
java.net.Socket
|
java.net.Socket
|
||||||
java.net.SocketException
|
java.net.SocketException
|
||||||
~@(when has-domain-sockets?
|
|
||||||
'[java.net.UnixDomainSocketAddress])
|
|
||||||
java.net.UnknownHostException
|
java.net.UnknownHostException
|
||||||
java.net.URI
|
java.net.URI
|
||||||
java.net.URISyntaxException
|
;; java.net.URL, see below
|
||||||
;; java.net.URL, see custom map
|
|
||||||
java.net.URLConnection
|
|
||||||
java.net.URLEncoder
|
java.net.URLEncoder
|
||||||
java.net.URLDecoder
|
java.net.URLDecoder
|
||||||
~@(when features/java-nio?
|
~@(when features/java-nio?
|
||||||
|
|
@ -383,14 +311,8 @@
|
||||||
java.nio.MappedByteBuffer
|
java.nio.MappedByteBuffer
|
||||||
java.nio.file.OpenOption
|
java.nio.file.OpenOption
|
||||||
java.nio.file.StandardOpenOption
|
java.nio.file.StandardOpenOption
|
||||||
java.nio.channels.ByteChannel
|
|
||||||
java.nio.channels.Channels
|
|
||||||
java.nio.channels.FileChannel
|
java.nio.channels.FileChannel
|
||||||
java.nio.channels.FileChannel$MapMode
|
java.nio.channels.FileChannel$MapMode
|
||||||
java.nio.channels.ReadableByteChannel
|
|
||||||
java.nio.channels.WritableByteChannel
|
|
||||||
java.nio.channels.ServerSocketChannel
|
|
||||||
java.nio.channels.SocketChannel
|
|
||||||
java.nio.charset.Charset
|
java.nio.charset.Charset
|
||||||
java.nio.charset.CoderResult
|
java.nio.charset.CoderResult
|
||||||
java.nio.charset.CharsetEncoder
|
java.nio.charset.CharsetEncoder
|
||||||
|
|
@ -404,7 +326,6 @@
|
||||||
java.nio.file.FileVisitOption
|
java.nio.file.FileVisitOption
|
||||||
java.nio.file.FileVisitResult
|
java.nio.file.FileVisitResult
|
||||||
java.nio.file.Files
|
java.nio.file.Files
|
||||||
java.nio.file.DirectoryStream$Filter
|
|
||||||
java.nio.file.LinkOption
|
java.nio.file.LinkOption
|
||||||
java.nio.file.NoSuchFileException
|
java.nio.file.NoSuchFileException
|
||||||
java.nio.file.Path
|
java.nio.file.Path
|
||||||
|
|
@ -414,28 +335,18 @@
|
||||||
java.nio.file.attribute.BasicFileAttributes
|
java.nio.file.attribute.BasicFileAttributes
|
||||||
java.nio.file.attribute.FileAttribute
|
java.nio.file.attribute.FileAttribute
|
||||||
java.nio.file.attribute.FileTime
|
java.nio.file.attribute.FileTime
|
||||||
java.nio.file.attribute.PosixFileAttributes
|
|
||||||
java.nio.file.attribute.PosixFilePermission
|
java.nio.file.attribute.PosixFilePermission
|
||||||
java.nio.file.attribute.PosixFilePermissions
|
java.nio.file.attribute.PosixFilePermissions])
|
||||||
java.nio.file.attribute.UserDefinedFileAttributeView])
|
|
||||||
java.security.DigestInputStream
|
|
||||||
java.security.KeyFactory
|
|
||||||
java.security.KeyPairGenerator
|
|
||||||
java.security.KeyPair
|
|
||||||
java.security.KeyStore
|
|
||||||
java.security.MessageDigest
|
java.security.MessageDigest
|
||||||
|
java.security.DigestInputStream
|
||||||
java.security.Provider
|
java.security.Provider
|
||||||
|
java.security.KeyStore
|
||||||
java.security.SecureRandom
|
java.security.SecureRandom
|
||||||
java.security.Security
|
java.security.Security
|
||||||
java.security.spec.ECGenParameterSpec
|
|
||||||
java.security.spec.PKCS8EncodedKeySpec
|
|
||||||
java.security.spec.X509EncodedKeySpec
|
|
||||||
java.sql.Date
|
java.sql.Date
|
||||||
java.text.ParseException
|
java.text.ParseException
|
||||||
java.text.ParsePosition
|
|
||||||
;; adds about 200kb, same functionality provided by java.time:
|
;; adds about 200kb, same functionality provided by java.time:
|
||||||
java.text.SimpleDateFormat
|
java.text.SimpleDateFormat
|
||||||
java.text.BreakIterator
|
|
||||||
~@(when features/java-time?
|
~@(when features/java-time?
|
||||||
`[java.time.format.DateTimeFormatter
|
`[java.time.format.DateTimeFormatter
|
||||||
java.time.Clock
|
java.time.Clock
|
||||||
|
|
@ -454,14 +365,12 @@
|
||||||
java.time.Year
|
java.time.Year
|
||||||
java.time.YearMonth
|
java.time.YearMonth
|
||||||
java.time.ZoneRegion
|
java.time.ZoneRegion
|
||||||
java.time.zone.ZoneRules
|
|
||||||
java.time.ZonedDateTime
|
java.time.ZonedDateTime
|
||||||
java.time.ZoneId
|
java.time.ZoneId
|
||||||
java.time.ZoneOffset
|
java.time.ZoneOffset
|
||||||
java.time.format.DateTimeFormatterBuilder
|
java.time.format.DateTimeFormatterBuilder
|
||||||
java.time.format.DateTimeParseException
|
java.time.format.DateTimeParseException
|
||||||
java.time.format.DecimalStyle
|
java.time.format.DecimalStyle
|
||||||
java.time.format.FormatStyle
|
|
||||||
java.time.format.ResolverStyle
|
java.time.format.ResolverStyle
|
||||||
java.time.format.SignStyle
|
java.time.format.SignStyle
|
||||||
java.time.temporal.ChronoField
|
java.time.temporal.ChronoField
|
||||||
|
|
@ -470,53 +379,31 @@
|
||||||
java.time.temporal.TemporalAdjusters
|
java.time.temporal.TemporalAdjusters
|
||||||
java.time.temporal.TemporalAmount
|
java.time.temporal.TemporalAmount
|
||||||
java.time.temporal.TemporalField
|
java.time.temporal.TemporalField
|
||||||
java.time.temporal.WeekFields
|
|
||||||
~(symbol "[Ljava.time.temporal.TemporalField;")
|
~(symbol "[Ljava.time.temporal.TemporalField;")
|
||||||
java.time.format.TextStyle
|
java.time.format.TextStyle
|
||||||
java.time.temporal.Temporal
|
java.time.temporal.Temporal
|
||||||
java.time.temporal.TemporalAccessor
|
java.time.temporal.TemporalAccessor
|
||||||
java.time.temporal.TemporalAdjuster
|
java.time.temporal.TemporalAdjuster])
|
||||||
java.time.temporal.TemporalQuery
|
|
||||||
~(symbol "[Ljava.time.temporal.TemporalQuery;")
|
|
||||||
java.time.chrono.ChronoLocalDate
|
|
||||||
java.time.temporal.TemporalUnit
|
|
||||||
java.time.chrono.ChronoLocalDateTime
|
|
||||||
java.time.chrono.ChronoZonedDateTime
|
|
||||||
java.time.chrono.Chronology])
|
|
||||||
java.util.concurrent.atomic.AtomicInteger
|
java.util.concurrent.atomic.AtomicInteger
|
||||||
java.util.concurrent.atomic.AtomicLong
|
java.util.concurrent.atomic.AtomicLong
|
||||||
java.util.concurrent.atomic.AtomicReference
|
java.util.concurrent.atomic.AtomicReference
|
||||||
java.util.concurrent.Callable
|
|
||||||
java.util.concurrent.CancellationException
|
java.util.concurrent.CancellationException
|
||||||
java.util.concurrent.CompletionException
|
java.util.concurrent.CompletionException
|
||||||
java.util.concurrent.CountDownLatch
|
|
||||||
java.util.concurrent.ExecutionException
|
java.util.concurrent.ExecutionException
|
||||||
java.util.concurrent.Executor
|
java.util.concurrent.Executor
|
||||||
java.util.concurrent.ExecutorService
|
|
||||||
java.util.concurrent.BlockingQueue
|
|
||||||
java.util.concurrent.ArrayBlockingQueue
|
|
||||||
java.util.concurrent.LinkedBlockingQueue
|
java.util.concurrent.LinkedBlockingQueue
|
||||||
java.util.concurrent.ScheduledFuture
|
|
||||||
java.util.concurrent.ScheduledThreadPoolExecutor
|
java.util.concurrent.ScheduledThreadPoolExecutor
|
||||||
java.util.concurrent.Semaphore
|
|
||||||
java.util.concurrent.ThreadFactory
|
|
||||||
java.util.concurrent.ThreadPoolExecutor
|
java.util.concurrent.ThreadPoolExecutor
|
||||||
java.util.concurrent.ThreadPoolExecutor$AbortPolicy
|
java.util.concurrent.ThreadPoolExecutor$AbortPolicy
|
||||||
java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy
|
java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy
|
||||||
java.util.concurrent.ThreadPoolExecutor$DiscardOldestPolicy
|
java.util.concurrent.ThreadPoolExecutor$DiscardOldestPolicy
|
||||||
java.util.concurrent.ThreadPoolExecutor$DiscardPolicy
|
java.util.concurrent.ThreadPoolExecutor$DiscardPolicy
|
||||||
java.util.concurrent.ExecutorService
|
|
||||||
java.util.concurrent.ScheduledExecutorService
|
java.util.concurrent.ScheduledExecutorService
|
||||||
java.util.concurrent.Future
|
java.util.concurrent.Future
|
||||||
java.util.concurrent.FutureTask
|
java.util.concurrent.FutureTask
|
||||||
java.util.concurrent.CompletableFuture
|
java.util.concurrent.CompletableFuture
|
||||||
java.util.concurrent.Executors
|
java.util.concurrent.Executors
|
||||||
java.util.concurrent.TimeUnit
|
java.util.concurrent.TimeUnit
|
||||||
java.util.concurrent.CompletionStage
|
|
||||||
java.util.concurrent.locks.ReentrantLock
|
|
||||||
java.util.concurrent.ThreadLocalRandom
|
|
||||||
java.util.concurrent.ConcurrentHashMap
|
|
||||||
java.util.jar.Attributes
|
|
||||||
java.util.jar.Attributes$Name
|
java.util.jar.Attributes$Name
|
||||||
java.util.jar.JarFile
|
java.util.jar.JarFile
|
||||||
java.util.jar.JarEntry
|
java.util.jar.JarEntry
|
||||||
|
|
@ -526,11 +413,9 @@
|
||||||
java.util.jar.Manifest
|
java.util.jar.Manifest
|
||||||
java.util.stream.BaseStream
|
java.util.stream.BaseStream
|
||||||
java.util.stream.Stream
|
java.util.stream.Stream
|
||||||
java.util.stream.IntStream
|
|
||||||
java.util.Random
|
java.util.Random
|
||||||
java.util.regex.Matcher
|
java.util.regex.Matcher
|
||||||
java.util.regex.Pattern
|
java.util.regex.Pattern
|
||||||
java.util.regex.PatternSyntaxException
|
|
||||||
java.util.ArrayDeque
|
java.util.ArrayDeque
|
||||||
java.util.ArrayList
|
java.util.ArrayList
|
||||||
java.util.Collections
|
java.util.Collections
|
||||||
|
|
@ -540,9 +425,7 @@
|
||||||
java.util.Base64$Encoder
|
java.util.Base64$Encoder
|
||||||
java.util.Date
|
java.util.Date
|
||||||
java.util.HashMap
|
java.util.HashMap
|
||||||
java.util.HashSet
|
|
||||||
java.util.IdentityHashMap
|
java.util.IdentityHashMap
|
||||||
java.util.InputMismatchException
|
|
||||||
java.util.List
|
java.util.List
|
||||||
java.util.Locale
|
java.util.Locale
|
||||||
java.util.Map
|
java.util.Map
|
||||||
|
|
@ -561,8 +444,6 @@
|
||||||
java.util.function.BiFunction
|
java.util.function.BiFunction
|
||||||
java.util.function.Predicate
|
java.util.function.Predicate
|
||||||
java.util.function.Supplier
|
java.util.function.Supplier
|
||||||
java.util.zip.CheckedInputStream
|
|
||||||
java.util.zip.CRC32
|
|
||||||
java.util.zip.Inflater
|
java.util.zip.Inflater
|
||||||
java.util.zip.InflaterInputStream
|
java.util.zip.InflaterInputStream
|
||||||
java.util.zip.Deflater
|
java.util.zip.Deflater
|
||||||
|
|
@ -592,22 +473,9 @@
|
||||||
~(symbol "[Ljava.util.regex.Pattern;")
|
~(symbol "[Ljava.util.regex.Pattern;")
|
||||||
~(symbol "[Lclojure.core$range;")])
|
~(symbol "[Lclojure.core$range;")])
|
||||||
~@(when features/yaml? '[org.yaml.snakeyaml.error.YAMLException])
|
~@(when features/yaml? '[org.yaml.snakeyaml.error.YAMLException])
|
||||||
~@(when features/hsqldb? '[org.hsqldb.jdbcDriver])
|
~@(when features/hsqldb? '[org.hsqldb.jdbcDriver])]
|
||||||
org.jsoup.Jsoup
|
|
||||||
org.jsoup.nodes.Attribute
|
|
||||||
org.jsoup.nodes.Attributes
|
|
||||||
org.jsoup.nodes.Comment
|
|
||||||
org.jsoup.nodes.DataNode
|
|
||||||
org.jsoup.nodes.Document
|
|
||||||
org.jsoup.nodes.DocumentType
|
|
||||||
org.jsoup.nodes.Element
|
|
||||||
org.jsoup.nodes.Node
|
|
||||||
org.jsoup.nodes.TextNode
|
|
||||||
org.jsoup.nodes.XmlDeclaration
|
|
||||||
org.jsoup.parser.Tag
|
|
||||||
org.jsoup.parser.Parser]
|
|
||||||
:constructors [clojure.lang.Delay
|
:constructors [clojure.lang.Delay
|
||||||
clojure.lang.DynamicClassLoader
|
clojure.lang.MapEntry
|
||||||
clojure.lang.LineNumberingPushbackReader
|
clojure.lang.LineNumberingPushbackReader
|
||||||
java.io.EOFException]
|
java.io.EOFException]
|
||||||
:methods [borkdude.graal.LockFix] ;; support for locking
|
:methods [borkdude.graal.LockFix] ;; support for locking
|
||||||
|
|
@ -647,27 +515,20 @@
|
||||||
clojure.lang.IRef
|
clojure.lang.IRef
|
||||||
clojure.lang.ISeq
|
clojure.lang.ISeq
|
||||||
clojure.lang.IPersistentVector
|
clojure.lang.IPersistentVector
|
||||||
clojure.lang.ITransientSet
|
|
||||||
clojure.lang.ITransientVector
|
clojure.lang.ITransientVector
|
||||||
clojure.lang.Iterate
|
clojure.lang.Iterate
|
||||||
|
clojure.lang.LazySeq
|
||||||
clojure.lang.LispReader$Resolver
|
clojure.lang.LispReader$Resolver
|
||||||
clojure.lang.LongRange
|
|
||||||
clojure.lang.Named
|
clojure.lang.Named
|
||||||
clojure.lang.Keyword
|
clojure.lang.Keyword
|
||||||
clojure.lang.PersistentArrayMap
|
clojure.lang.PersistentArrayMap
|
||||||
clojure.lang.PersistentArrayMap$TransientArrayMap
|
|
||||||
clojure.lang.PersistentHashMap$TransientHashMap
|
|
||||||
clojure.lang.PersistentHashSet
|
clojure.lang.PersistentHashSet
|
||||||
clojure.lang.PersistentHashSet$TransientHashSet
|
|
||||||
clojure.lang.PersistentList
|
clojure.lang.PersistentList
|
||||||
clojure.lang.PersistentList$EmptyList
|
|
||||||
clojure.lang.PersistentQueue
|
clojure.lang.PersistentQueue
|
||||||
clojure.lang.PersistentStructMap
|
clojure.lang.PersistentStructMap
|
||||||
clojure.lang.PersistentTreeMap
|
clojure.lang.PersistentTreeMap
|
||||||
clojure.lang.PersistentTreeSet
|
clojure.lang.PersistentTreeSet
|
||||||
clojure.lang.PersistentVector
|
clojure.lang.PersistentVector
|
||||||
clojure.lang.PersistentVector$TransientVector
|
|
||||||
clojure.lang.Range
|
|
||||||
clojure.lang.Ratio
|
clojure.lang.Ratio
|
||||||
clojure.lang.ReaderConditional
|
clojure.lang.ReaderConditional
|
||||||
clojure.lang.Repeat
|
clojure.lang.Repeat
|
||||||
|
|
@ -685,14 +546,10 @@
|
||||||
java.lang.LinkageError
|
java.lang.LinkageError
|
||||||
java.lang.ThreadDeath
|
java.lang.ThreadDeath
|
||||||
java.lang.VirtualMachineError
|
java.lang.VirtualMachineError
|
||||||
java.lang.NoSuchFieldException
|
|
||||||
java.sql.Timestamp
|
java.sql.Timestamp
|
||||||
java.util.concurrent.TimeoutException
|
java.util.concurrent.TimeoutException
|
||||||
java.util.Collection
|
java.util.Collection
|
||||||
java.util.Map$Entry
|
java.util.Map$Entry
|
||||||
java.util.AbstractMap
|
|
||||||
java.util.AbstractSet
|
|
||||||
java.util.AbstractList
|
|
||||||
~@(when features/xml? ['clojure.data.xml.node.Element])]
|
~@(when features/xml? ['clojure.data.xml.node.Element])]
|
||||||
:custom ~custom-map})
|
:custom ~custom-map})
|
||||||
|
|
||||||
|
|
@ -705,134 +562,71 @@
|
||||||
(:instance-checks classes))
|
(:instance-checks classes))
|
||||||
m (apply hash-map
|
m (apply hash-map
|
||||||
(for [c classes
|
(for [c classes
|
||||||
c [(list 'quote c) (cond-> `{:class ~c}
|
c [(list 'quote c) c]]
|
||||||
(= 'java.lang.Class c)
|
|
||||||
(assoc :static-methods
|
|
||||||
{(list 'quote 'forName)
|
|
||||||
`(fn
|
|
||||||
([_# ^String class-name#]
|
|
||||||
(Class/forName class-name#))
|
|
||||||
([_# ^String class-name# initialize# ^java.lang.ClassLoader clazz-loader#]
|
|
||||||
(Class/forName class-name#)))}))]]
|
|
||||||
c))
|
c))
|
||||||
m (assoc m :public-class
|
m (assoc m :public-class
|
||||||
(fn [v]
|
(fn [v]
|
||||||
;; (prn :v v)
|
|
||||||
;; NOTE: a series of instance check, so far, is still cheaper
|
;; NOTE: a series of instance check, so far, is still cheaper
|
||||||
;; than piggybacking on defmulti or defprotocol
|
;; than piggybacking on defmulti or defprotocol
|
||||||
(let [res (cond (instance? java.lang.Process v)
|
(cond (instance? java.lang.Process v)
|
||||||
java.lang.Process
|
java.lang.Process
|
||||||
(instance? java.lang.ProcessHandle v)
|
(instance? java.lang.ProcessHandle v)
|
||||||
java.lang.ProcessHandle
|
java.lang.ProcessHandle
|
||||||
(instance? java.lang.ProcessHandle$Info v)
|
(instance? java.lang.ProcessHandle$Info v)
|
||||||
java.lang.ProcessHandle$Info
|
java.lang.ProcessHandle$Info
|
||||||
;; added for calling .put on .environment from ProcessBuilder
|
;; added for calling .put on .environment from ProcessBuilder
|
||||||
(instance? java.util.Map v)
|
(instance? java.util.Map v)
|
||||||
java.util.Map
|
java.util.Map
|
||||||
;; added for issue #239 regarding clj-http-lite
|
;; added for issue #239 regarding clj-http-lite
|
||||||
;; can potentially be removed due to fix for #1061
|
;; can potentially be removed due to fix for #1061
|
||||||
(instance? java.io.ByteArrayOutputStream v)
|
(instance? java.io.ByteArrayOutputStream v)
|
||||||
java.io.ByteArrayOutputStream
|
java.io.ByteArrayOutputStream
|
||||||
(instance? java.security.MessageDigest v)
|
(instance? java.security.MessageDigest v)
|
||||||
java.security.MessageDigest
|
java.security.MessageDigest
|
||||||
;; streams
|
;; streams
|
||||||
(instance? java.io.InputStream v)
|
(instance? java.io.InputStream v)
|
||||||
java.io.InputStream
|
java.io.InputStream
|
||||||
(instance? java.io.OutputStream v)
|
(instance? java.io.OutputStream v)
|
||||||
java.io.OutputStream
|
java.io.OutputStream
|
||||||
;; java nio
|
;; java nio
|
||||||
(instance? java.nio.file.Path v)
|
(instance? java.nio.file.Path v)
|
||||||
java.nio.file.Path
|
java.nio.file.Path
|
||||||
(instance? java.nio.file.FileSystem v)
|
(instance? java.nio.file.FileSystem v)
|
||||||
java.nio.file.FileSystem
|
java.nio.file.FileSystem
|
||||||
(instance? java.nio.file.PathMatcher v)
|
(instance? java.nio.file.PathMatcher v)
|
||||||
java.nio.file.PathMatcher
|
java.nio.file.PathMatcher
|
||||||
(instance? java.util.stream.Stream v)
|
(instance? java.util.stream.BaseStream v)
|
||||||
java.util.stream.Stream
|
java.util.stream.BaseStream
|
||||||
(instance? java.util.stream.IntStream v)
|
(instance? java.nio.ByteBuffer v)
|
||||||
java.util.stream.IntStream
|
java.nio.ByteBuffer
|
||||||
(instance? java.util.stream.BaseStream v)
|
(instance? java.nio.charset.Charset v)
|
||||||
java.util.stream.BaseStream
|
java.nio.charset.Charset
|
||||||
(instance? java.nio.ByteBuffer v)
|
(instance? java.nio.charset.CharsetEncoder v)
|
||||||
java.nio.ByteBuffer
|
java.nio.charset.CharsetEncoder
|
||||||
(instance? java.nio.charset.Charset v)
|
(instance? java.nio.CharBuffer v)
|
||||||
java.nio.charset.Charset
|
java.nio.CharBuffer
|
||||||
(instance? java.nio.charset.CharsetEncoder v)
|
(instance? java.nio.channels.FileChannel v)
|
||||||
java.nio.charset.CharsetEncoder
|
java.nio.channels.FileChannel
|
||||||
(instance? java.nio.CharBuffer v)
|
(instance? java.net.CookieStore v)
|
||||||
java.nio.CharBuffer
|
java.net.CookieStore
|
||||||
(instance? java.nio.channels.FileChannel v)
|
;; this makes interop on reified classes work
|
||||||
java.nio.channels.FileChannel
|
;; see java_net_http_test/interop-test
|
||||||
(instance? java.nio.channels.ServerSocketChannel v)
|
(instance? sci.impl.types.IReified v)
|
||||||
java.nio.channels.ServerSocketChannel
|
(first (t/getInterfaces v))
|
||||||
(instance? java.nio.channels.SocketChannel v)
|
;; fix for #1061
|
||||||
java.nio.channels.SocketChannel
|
(instance? java.io.Closeable v)
|
||||||
(instance? java.net.CookieStore v)
|
java.io.Closeable
|
||||||
java.net.CookieStore
|
(instance? java.nio.file.attribute.BasicFileAttributes v)
|
||||||
;; this makes interop on reified classes work
|
java.nio.file.attribute.BasicFileAttributes
|
||||||
;; see java_net_http_test/interop-test
|
(instance? java.util.concurrent.Future v)
|
||||||
(instance? sci.impl.types.IReified v)
|
java.util.concurrent.Future
|
||||||
(first (t/getInterfaces v))
|
(instance? java.util.concurrent.ScheduledExecutorService v)
|
||||||
;; fix for #1061
|
java.util.concurrent.ScheduledExecutorService
|
||||||
(instance? java.net.URLClassLoader v)
|
(instance? java.util.Iterator v)
|
||||||
java.net.URLClassLoader
|
java.util.Iterator
|
||||||
(instance? java.lang.ClassLoader v)
|
;; keep commas for merge friendliness
|
||||||
java.lang.ClassLoader
|
,,,)))
|
||||||
(instance? java.nio.file.attribute.PosixFileAttributes v)
|
m (assoc m (list 'quote 'clojure.lang.Var) 'sci.lang.Var)]
|
||||||
java.nio.file.attribute.PosixFileAttributes
|
|
||||||
(instance? java.nio.file.attribute.BasicFileAttributes v)
|
|
||||||
java.nio.file.attribute.BasicFileAttributes
|
|
||||||
(instance? java.nio.file.attribute.UserDefinedFileAttributeView v)
|
|
||||||
java.nio.file.attribute.UserDefinedFileAttributeView
|
|
||||||
(instance? java.util.concurrent.Future v)
|
|
||||||
java.util.concurrent.Future
|
|
||||||
(instance? java.util.concurrent.ScheduledExecutorService v)
|
|
||||||
java.util.concurrent.ScheduledExecutorService
|
|
||||||
(instance? java.util.concurrent.ExecutorService v)
|
|
||||||
java.util.concurrent.ExecutorService
|
|
||||||
(instance? java.util.Iterator v)
|
|
||||||
java.util.Iterator
|
|
||||||
(instance? javax.crypto.SecretKey v)
|
|
||||||
javax.crypto.SecretKey
|
|
||||||
(instance? javax.net.ssl.SSLSocketFactory v)
|
|
||||||
javax.net.ssl.SSLSocketFactory
|
|
||||||
(instance? javax.net.ssl.SSLSocket v)
|
|
||||||
javax.net.ssl.SSLSocket
|
|
||||||
(instance? java.lang.Thread v)
|
|
||||||
java.lang.Thread
|
|
||||||
(instance? java.util.concurrent.ThreadFactory v)
|
|
||||||
java.util.concurrent.ThreadFactory
|
|
||||||
(instance? java.security.cert.X509Certificate v)
|
|
||||||
java.security.cert.X509Certificate
|
|
||||||
(instance? java.io.Console v)
|
|
||||||
java.io.Console
|
|
||||||
(instance? java.security.KeyPairGenerator v)
|
|
||||||
java.security.KeyPairGenerator
|
|
||||||
(instance? java.security.Signature v)
|
|
||||||
java.security.Signature
|
|
||||||
(instance? java.security.Key v)
|
|
||||||
java.security.Key
|
|
||||||
(instance? java.util.Set v)
|
|
||||||
java.util.Set
|
|
||||||
(instance? java.io.Closeable v)
|
|
||||||
java.io.Closeable
|
|
||||||
(instance? java.util.Collection v)
|
|
||||||
java.util.Collection
|
|
||||||
(instance? java.lang.Throwable v)
|
|
||||||
java.lang.Throwable
|
|
||||||
(instance? org.jsoup.nodes.Element v)
|
|
||||||
org.jsoup.nodes.Element
|
|
||||||
(and thread-builder
|
|
||||||
(instance? thread-builder v))
|
|
||||||
thread-builder
|
|
||||||
(instance? java.text.BreakIterator v)
|
|
||||||
java.text.BreakIterator
|
|
||||||
;; keep commas for merge friendliness
|
|
||||||
,)]
|
|
||||||
;; (prn :res res)
|
|
||||||
res)))
|
|
||||||
m (assoc m (list 'quote 'clojure.lang.Var) 'sci.lang.Var)
|
|
||||||
m (assoc m (list 'quote 'clojure.lang.Namespace) 'sci.lang.Namespace)]
|
|
||||||
m))
|
m))
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -841,14 +635,6 @@
|
||||||
allowed to be initialized at build time."
|
allowed to be initialized at build time."
|
||||||
(gen-class-map))
|
(gen-class-map))
|
||||||
|
|
||||||
#_(let [class-name (str c)]
|
|
||||||
(cond-> (Class/forName class-name)
|
|
||||||
(= "java.lang.Class" class-name)
|
|
||||||
(->> (hash-map :static-methods {'forName (fn [class-name]
|
|
||||||
(prn :class-for)
|
|
||||||
(Class/forName class-name))}
|
|
||||||
:class))))
|
|
||||||
|
|
||||||
(def class-map
|
(def class-map
|
||||||
"A delay to delay initialization of java-net-http classes to run time, since GraalVM 22.1"
|
"A delay to delay initialization of java-net-http classes to run time, since GraalVM 22.1"
|
||||||
(delay (persistent! (reduce (fn [acc c]
|
(delay (persistent! (reduce (fn [acc c]
|
||||||
|
|
@ -865,7 +651,6 @@
|
||||||
BigInteger java.math.BigInteger
|
BigInteger java.math.BigInteger
|
||||||
Boolean java.lang.Boolean
|
Boolean java.lang.Boolean
|
||||||
Byte java.lang.Byte
|
Byte java.lang.Byte
|
||||||
Callable java.util.concurrent.Callable
|
|
||||||
Character java.lang.Character
|
Character java.lang.Character
|
||||||
CharSequence java.lang.CharSequence
|
CharSequence java.lang.CharSequence
|
||||||
Class java.lang.Class
|
Class java.lang.Class
|
||||||
|
|
@ -873,7 +658,6 @@
|
||||||
ClassNotFoundException java.lang.ClassNotFoundException
|
ClassNotFoundException java.lang.ClassNotFoundException
|
||||||
Comparable java.lang.Comparable
|
Comparable java.lang.Comparable
|
||||||
Double java.lang.Double
|
Double java.lang.Double
|
||||||
Error java.lang.Error
|
|
||||||
Exception java.lang.Exception
|
Exception java.lang.Exception
|
||||||
ExceptionInInitializerError java.lang.ExceptionInInitializerError
|
ExceptionInInitializerError java.lang.ExceptionInInitializerError
|
||||||
IndexOutOfBoundsException java.lang.IndexOutOfBoundsException
|
IndexOutOfBoundsException java.lang.IndexOutOfBoundsException
|
||||||
|
|
@ -882,8 +666,6 @@
|
||||||
Integer java.lang.Integer
|
Integer java.lang.Integer
|
||||||
InterruptedException java.lang.InterruptedException
|
InterruptedException java.lang.InterruptedException
|
||||||
Iterable java.lang.Iterable
|
Iterable java.lang.Iterable
|
||||||
;; NOTE: in hindsight File never belonged to the default imports of Clojure,
|
|
||||||
;; but it's been here to long to remove probably
|
|
||||||
File java.io.File
|
File java.io.File
|
||||||
Float java.lang.Float
|
Float java.lang.Float
|
||||||
Long java.lang.Long
|
Long java.lang.Long
|
||||||
|
|
@ -893,26 +675,21 @@
|
||||||
Number java.lang.Number
|
Number java.lang.Number
|
||||||
NumberFormatException java.lang.NumberFormatException
|
NumberFormatException java.lang.NumberFormatException
|
||||||
Object java.lang.Object
|
Object java.lang.Object
|
||||||
Runnable java.lang.Runnable
|
|
||||||
Runtime java.lang.Runtime
|
Runtime java.lang.Runtime
|
||||||
RuntimeException java.lang.RuntimeException
|
RuntimeException java.lang.RuntimeException
|
||||||
Process java.lang.Process
|
Process java.lang.Process
|
||||||
ProcessBuilder java.lang.ProcessBuilder
|
ProcessBuilder java.lang.ProcessBuilder
|
||||||
SecurityException java.lang.SecurityException
|
|
||||||
Short java.lang.Short
|
Short java.lang.Short
|
||||||
StackTraceElement java.lang.StackTraceElement
|
StackTraceElement java.lang.StackTraceElement
|
||||||
String java.lang.String
|
String java.lang.String
|
||||||
StringBuilder java.lang.StringBuilder
|
StringBuilder java.lang.StringBuilder
|
||||||
System java.lang.System
|
System java.lang.System
|
||||||
Thread java.lang.Thread
|
Thread java.lang.Thread
|
||||||
ThreadLocal java.lang.ThreadLocal
|
|
||||||
Thread$UncaughtExceptionHandler java.lang.Thread$UncaughtExceptionHandler
|
|
||||||
Throwable java.lang.Throwable
|
Throwable java.lang.Throwable
|
||||||
VirtualMachineError java.lang.VirtualMachineError
|
VirtualMachineError java.lang.VirtualMachineError
|
||||||
ThreadDeath java.lang.ThreadDeath
|
ThreadDeath java.lang.ThreadDeath
|
||||||
UnsupportedOperationException java.lang.UnsupportedOperationException})
|
;; UnsupportedOperationException java.lang.UnsupportedOperationException
|
||||||
|
})
|
||||||
;; (eval (vec (keys imports)))
|
|
||||||
|
|
||||||
(defn reflection-file-entries []
|
(defn reflection-file-entries []
|
||||||
(let [entries (vec (for [c (sort (concat (:all classes)
|
(let [entries (vec (for [c (sort (concat (:all classes)
|
||||||
|
|
@ -954,13 +731,13 @@
|
||||||
"resources/META-INF/native-image/babashka/babashka/reflect-config.json")
|
"resources/META-INF/native-image/babashka/babashka/reflect-config.json")
|
||||||
(json/generate-string all-entries {:pretty true}))))
|
(json/generate-string all-entries {:pretty true}))))
|
||||||
|
|
||||||
(defn public-declared-method? [^Class c ^java.lang.reflect.Method m]
|
(defn public-declared-method? [c m]
|
||||||
(and (= c (.getDeclaringClass m))
|
(and (= c (.getDeclaringClass m))
|
||||||
(not (.getAnnotation m Deprecated))))
|
(not (.getAnnotation m Deprecated))))
|
||||||
|
|
||||||
(defn public-declared-method-names [^Class c]
|
(defn public-declared-method-names [c]
|
||||||
(->> (.getMethods c)
|
(->> (.getMethods c)
|
||||||
(keep (fn [^java.lang.reflect.Method m]
|
(keep (fn [m]
|
||||||
(when (public-declared-method? c m)
|
(when (public-declared-method? c m)
|
||||||
{:class c
|
{:class c
|
||||||
:name (.getName m)})))
|
:name (.getName m)})))
|
||||||
|
|
@ -968,9 +745,8 @@
|
||||||
(sort-by :name)
|
(sort-by :name)
|
||||||
(vec)))
|
(vec)))
|
||||||
|
|
||||||
(defn all-classes
|
(defn all-classes []
|
||||||
"Returns every java.lang.Class instance Babashka supports."
|
"Returns every java.lang.Class instance Babashka supports."
|
||||||
[]
|
|
||||||
(->> (reflection-file-entries)
|
(->> (reflection-file-entries)
|
||||||
(map :name)
|
(map :name)
|
||||||
(map #(Class/forName %))))
|
(map #(Class/forName %))))
|
||||||
|
|
@ -988,4 +764,6 @@
|
||||||
(public-declared-method-names java.net.URL)
|
(public-declared-method-names java.net.URL)
|
||||||
(public-declared-method-names java.util.Properties)
|
(public-declared-method-names java.util.Properties)
|
||||||
|
|
||||||
(all-classes))
|
(all-classes)
|
||||||
|
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -5,64 +5,93 @@
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[sci.core :as sci])
|
[sci.core :as sci])
|
||||||
(:import [java.util.jar Manifest]
|
(:import (java.io File)
|
||||||
|
[java.util.jar JarFile Manifest]
|
||||||
(java.net URL)))
|
(java.net URL)))
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
||||||
(defn getResource [^babashka.impl.URLClassLoader class-loader resource-paths url?]
|
(defprotocol IResourceResolver
|
||||||
(some (fn [resource]
|
(getResource [this paths opts])
|
||||||
(when-let [^java.net.URL res (.findResource class-loader resource)]
|
(getResources [this paths opts]))
|
||||||
(if url?
|
|
||||||
res
|
(deftype DirectoryResolver [path]
|
||||||
{:file (if (= "jar" (.getProtocol res))
|
IResourceResolver
|
||||||
resource
|
(getResource [_ resource-paths url?]
|
||||||
(.getFile res))
|
(some
|
||||||
:source (slurp res)})))
|
(fn [resource-path]
|
||||||
resource-paths))
|
(let [f (io/file path resource-path)]
|
||||||
|
(when (.exists f)
|
||||||
|
(if url?
|
||||||
|
;; manual conversion, faster than going through .toURI
|
||||||
|
(URL. "file" nil (.getAbsolutePath f))
|
||||||
|
{:file (.getAbsolutePath f)
|
||||||
|
:source (slurp f)}))))
|
||||||
|
resource-paths)))
|
||||||
|
|
||||||
|
(defn path-from-jar
|
||||||
|
[^File jar-file resource-paths url?]
|
||||||
|
(with-open [jar (JarFile. jar-file)]
|
||||||
|
(some (fn [path]
|
||||||
|
(when-let [entry (.getEntry jar path)]
|
||||||
|
(if url?
|
||||||
|
;; manual conversion, faster than going through .toURI
|
||||||
|
(URL. "jar" nil
|
||||||
|
(str "file:" (.getAbsolutePath jar-file) "!/" path))
|
||||||
|
{:file path
|
||||||
|
:source (slurp (.getInputStream jar entry))})))
|
||||||
|
resource-paths)))
|
||||||
|
|
||||||
|
(deftype JarFileResolver [jar-file]
|
||||||
|
IResourceResolver
|
||||||
|
(getResource [_ resource-paths url?]
|
||||||
|
(path-from-jar jar-file resource-paths url?)))
|
||||||
|
|
||||||
|
(defn part->entry [part]
|
||||||
|
(when-not (str/blank? part)
|
||||||
|
(if (str/ends-with? part ".jar")
|
||||||
|
(JarFileResolver. (io/file part))
|
||||||
|
(DirectoryResolver. (io/file part)))))
|
||||||
|
|
||||||
|
(deftype Loader [entries]
|
||||||
|
IResourceResolver
|
||||||
|
(getResource [_ resource-paths opts]
|
||||||
|
(some #(getResource % resource-paths opts) entries))
|
||||||
|
(getResources [_ resource-paths opts]
|
||||||
|
(keep #(getResource % resource-paths opts) entries)))
|
||||||
|
|
||||||
(def path-sep (System/getProperty "path.separator"))
|
(def path-sep (System/getProperty "path.separator"))
|
||||||
|
|
||||||
(defn ->url ^java.net.URL [^String s]
|
(defn classpath-entries [^String classpath]
|
||||||
(.toURL (java.io.File. s)))
|
(let [parts (.split classpath path-sep)]
|
||||||
|
(keep part->entry parts)))
|
||||||
|
|
||||||
(defn new-loader ^babashka.impl.URLClassLoader
|
(defn loader [^String classpath]
|
||||||
([paths]
|
(Loader. (classpath-entries classpath)))
|
||||||
(babashka.impl.URLClassLoader. (into-array java.net.URL (map ->url paths)))))
|
|
||||||
|
|
||||||
(def ^babashka.impl.URLClassLoader the-url-loader (delay (new-loader [])))
|
(declare get-classpath)
|
||||||
|
|
||||||
(defn add-classpath
|
(defn source-for-namespace
|
||||||
"Adds extra-classpath, a string as for example returned by clojure
|
([namespace opts]
|
||||||
-Spath, to the current classpath."
|
(some-> (get-classpath) loader (source-for-namespace namespace opts)))
|
||||||
[^String extra-classpath]
|
([loader namespace opts]
|
||||||
(let [paths (.split extra-classpath path-sep)
|
(let [ns-str (name namespace)
|
||||||
paths (map ->url paths)
|
^String ns-str (munge ns-str)
|
||||||
loader @the-url-loader]
|
;; do NOT pick the platform specific file separator here, since that doesn't work for searching in .jar files
|
||||||
(run! (fn [path]
|
;; (io/file "foo" "bar/baz") does work on Windows, despite the forward slash
|
||||||
(._addURL ^babashka.impl.URLClassLoader loader path)
|
base-path (.replace ns-str "." "/")
|
||||||
loader)
|
manifest-paths (loop [ns (str/split ns-str #"\.")
|
||||||
paths)
|
paths []]
|
||||||
;; (run! prn (.getURLs the-url-loader))
|
(let [path (str/join "/" (conj ns "pod-manifest.edn"))
|
||||||
(System/setProperty "java.class.path"
|
next-ns (-> ns butlast vec)
|
||||||
(let [system-cp (System/getProperty "java.class.path")]
|
next-paths (conj paths path)]
|
||||||
(-> (cond-> system-cp
|
(if (< 1 (count next-ns)) ; don't look in top-level (e.g. com, pod) namespaces
|
||||||
(not (str/blank? system-cp)) (str path-sep))
|
(recur next-ns next-paths)
|
||||||
(str extra-classpath)))))
|
next-paths)))
|
||||||
nil)
|
resource-paths (into (mapv #(str base-path %)
|
||||||
|
[".bb" ".clj" ".cljc"])
|
||||||
(defn resource-paths [namespace]
|
manifest-paths)]
|
||||||
(let [ns-str (name namespace)
|
(getResource loader resource-paths opts))))
|
||||||
^String ns-str (namespace-munge ns-str)
|
|
||||||
;; do NOT pick the platform specific file separator here, since that doesn't work for searching in .jar files
|
|
||||||
;; (io/file "foo" "bar/baz") does work on Windows, despite the forward slash
|
|
||||||
base-path (.replace ns-str "." "/")
|
|
||||||
resource-paths (mapv #(str base-path %) [".bb" ".clj" ".cljc"])]
|
|
||||||
resource-paths))
|
|
||||||
|
|
||||||
(defn source-for-namespace [loader namespace opts]
|
|
||||||
(let [rps (resource-paths namespace)]
|
|
||||||
(getResource loader rps opts)))
|
|
||||||
|
|
||||||
(defn main-ns [manifest-resource]
|
(defn main-ns [manifest-resource]
|
||||||
(with-open [is (io/input-stream manifest-resource)]
|
(with-open [is (io/input-stream manifest-resource)]
|
||||||
|
|
@ -71,21 +100,34 @@
|
||||||
(.getValue "Main-Class")
|
(.getValue "Main-Class")
|
||||||
(demunge))))
|
(demunge))))
|
||||||
|
|
||||||
|
(def cp-state (atom nil))
|
||||||
|
|
||||||
|
(defn add-classpath
|
||||||
|
"Adds extra-classpath, a string as for example returned by clojure
|
||||||
|
-Spath, to the current classpath."
|
||||||
|
[extra-classpath]
|
||||||
|
(swap! cp-state
|
||||||
|
(fn [{:keys [:cp]}]
|
||||||
|
(let [new-cp
|
||||||
|
(if-not cp extra-classpath
|
||||||
|
(str cp path-sep extra-classpath))]
|
||||||
|
{:loader (loader new-cp)
|
||||||
|
:cp new-cp})))
|
||||||
|
nil)
|
||||||
|
|
||||||
(defn split-classpath
|
(defn split-classpath
|
||||||
"Returns the classpath as a seq of strings, split by the platform
|
"Returns the classpath as a seq of strings, split by the platform
|
||||||
specific path separator."
|
specific path separator."
|
||||||
([^String cp] (vec (when cp (.split cp path-sep)))))
|
([^String cp] (vec (.split cp path-sep))))
|
||||||
|
|
||||||
(defn get-classpath
|
(defn get-classpath
|
||||||
"Returns the current classpath as set by --classpath, BABASHKA_CLASSPATH and add-classpath."
|
"Returns the current classpath as set by --classpath, BABASHKA_CLASSPATH and add-classpath."
|
||||||
[]
|
[]
|
||||||
(let [cp (System/getProperty "java.class.path")]
|
(:cp @cp-state))
|
||||||
(when-not (str/blank? cp)
|
|
||||||
cp)))
|
|
||||||
|
|
||||||
(defn resource
|
(defn resource
|
||||||
(^URL [path] (resource path @the-url-loader))
|
(^URL [path] (when-let [st @cp-state] (resource (:loader st) path)))
|
||||||
(^URL [path loader]
|
(^URL [loader path]
|
||||||
(if (str/starts-with? path "/") nil ;; non-relative paths always return nil
|
(if (str/starts-with? path "/") nil ;; non-relative paths always return nil
|
||||||
(getResource loader [path] true))))
|
(getResource loader [path] true))))
|
||||||
|
|
||||||
|
|
@ -104,3 +146,4 @@
|
||||||
(def l (loader cp))
|
(def l (loader cp))
|
||||||
(source-for-namespace l 'babashka.impl.cheshire nil)
|
(source-for-namespace l 'babashka.impl.cheshire nil)
|
||||||
(time (:file (source-for-namespace l 'cheshire.core nil)))) ;; 20ms -> 2.25ms
|
(time (:file (source-for-namespace l 'cheshire.core nil)))) ;; 20ms -> 2.25ms
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,23 +17,18 @@
|
||||||
(let [extra-opts '%s
|
(let [extra-opts '%s
|
||||||
sym `%s
|
sym `%s
|
||||||
the-var (requiring-resolve sym)
|
the-var (requiring-resolve sym)
|
||||||
_ (when-not the-var
|
|
||||||
(throw (ex-info (str \"Could not resolve sym to a function: \" sym) {:babashka/exit 1})))
|
|
||||||
the-var-meta (meta the-var)
|
the-var-meta (meta the-var)
|
||||||
ns (:ns (meta the-var))
|
ns (:ns (meta the-var))
|
||||||
ns-meta (meta ns)
|
ns-meta (meta ns)
|
||||||
ct (babashka.tasks/current-task)
|
ct (babashka.tasks/current-task)
|
||||||
exec-args (babashka.cli/merge-opts (:exec-args (:org.babashka/cli ns-meta))
|
|
||||||
(:exec-args (:org.babashka/cli the-var-meta))
|
|
||||||
(:exec-args (:org.babashka/cli ct))
|
|
||||||
(:exec-args ct)
|
|
||||||
(:exec-args extra-opts))
|
|
||||||
cli-opts (babashka.cli/merge-opts (:org.babashka/cli ns-meta)
|
cli-opts (babashka.cli/merge-opts (:org.babashka/cli ns-meta)
|
||||||
(:org.babashka/cli the-var-meta)
|
(:org.babashka/cli the-var-meta)
|
||||||
(:org.babashka/cli ct)
|
(:org.babashka/cli ct)
|
||||||
extra-opts)
|
extra-opts)
|
||||||
cli-opts (assoc cli-opts :exec-args exec-args)
|
opts (babashka.cli/parse-opts *command-line-args* cli-opts)
|
||||||
opts (babashka.cli/parse-opts *command-line-args* cli-opts)]
|
task-exec-args (:exec-args ct)
|
||||||
|
cli-exec-args (:exec-args cli-opts)
|
||||||
|
opts (babashka.cli/merge-opts cli-exec-args task-exec-args opts)]
|
||||||
(the-var opts))"
|
(the-var opts))"
|
||||||
(random-uuid)
|
(random-uuid)
|
||||||
(pr-str extra-opts)
|
(pr-str extra-opts)
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,27 @@
|
||||||
(:refer-clojure :exclude [future read+string clojure-version with-precision
|
(:refer-clojure :exclude [future read+string clojure-version with-precision
|
||||||
send-via send send-off sync into-array])
|
send-via send send-off sync into-array])
|
||||||
(:require [babashka.impl.common :as common]
|
(:require [babashka.impl.common :as common]
|
||||||
|
[borkdude.graal.locking :as locking]
|
||||||
[clojure.core :as c]
|
[clojure.core :as c]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[sci.impl.copy-vars :refer [copy-core-var new-var macrofy]]
|
[sci.impl.namespaces :refer [copy-core-var core-var macrofy]]
|
||||||
[sci.impl.parser :as parser]
|
[sci.impl.parser :as parser]
|
||||||
[sci.impl.utils :refer [clojure-core-ns]]
|
[sci.impl.utils :refer [clojure-core-ns]]
|
||||||
[sci.impl.vars :as vars]))
|
[sci.impl.vars :as vars]))
|
||||||
|
|
||||||
|
(defn locking* [form bindings v f & args]
|
||||||
|
(apply @#'locking/locking form bindings v f args))
|
||||||
|
|
||||||
|
(defn time*
|
||||||
|
"Evaluates expr and prints the time it took. Returns the value of
|
||||||
|
expr."
|
||||||
|
[_ _ expr]
|
||||||
|
`(let [start# (. System (nanoTime))
|
||||||
|
ret# ~expr]
|
||||||
|
(prn (str "Elapsed time: " (/ (double (- (. System (nanoTime)) start#)) 1000000.0) " msecs"))
|
||||||
|
ret#))
|
||||||
|
|
||||||
(defn core-dynamic-var
|
(defn core-dynamic-var
|
||||||
([sym] (core-dynamic-var sym nil))
|
([sym] (core-dynamic-var sym nil))
|
||||||
([sym init-val] (sci/new-dynamic-var sym init-val {:ns clojure-core-ns})))
|
([sym init-val] (sci/new-dynamic-var sym init-val {:ns clojure-core-ns})))
|
||||||
|
|
@ -21,9 +34,6 @@
|
||||||
(def compile-files (core-dynamic-var '*compile-files* false))
|
(def compile-files (core-dynamic-var '*compile-files* false))
|
||||||
(def unchecked-math (core-dynamic-var '*unchecked-math* false))
|
(def unchecked-math (core-dynamic-var '*unchecked-math* false))
|
||||||
(def math-context (core-dynamic-var '*math-context*))
|
(def math-context (core-dynamic-var '*math-context*))
|
||||||
(def compile-path (core-dynamic-var '*compile-path* *compile-path*))
|
|
||||||
(def compiler-options (core-dynamic-var '*compiler-options*))
|
|
||||||
(def repl (core-dynamic-var '*repl* true)) ;; set to true, basically just a dummy for now
|
|
||||||
|
|
||||||
(defn read+string
|
(defn read+string
|
||||||
"Added for compatibility. Must be used with
|
"Added for compatibility. Must be used with
|
||||||
|
|
@ -52,7 +62,7 @@
|
||||||
The rounding mode is one of CEILING, FLOOR, HALF_UP, HALF_DOWN,
|
The rounding mode is one of CEILING, FLOOR, HALF_UP, HALF_DOWN,
|
||||||
HALF_EVEN, UP, DOWN and UNNECESSARY; it defaults to HALF_UP."
|
HALF_EVEN, UP, DOWN and UNNECESSARY; it defaults to HALF_UP."
|
||||||
[precision & exprs]
|
[precision & exprs]
|
||||||
(let [[body rm] (if (= :rounding (first exprs))
|
(let [[body rm] (if (= (first exprs) :rounding)
|
||||||
[(next (next exprs))
|
[(next (next exprs))
|
||||||
`((. java.math.RoundingMode ~(second exprs)))]
|
`((. java.math.RoundingMode ~(second exprs)))]
|
||||||
[exprs nil])]
|
[exprs nil])]
|
||||||
|
|
@ -118,7 +128,7 @@
|
||||||
:static true}
|
:static true}
|
||||||
([aseq]
|
([aseq]
|
||||||
(try (clojure.lang.RT/seqToTypedArray (seq aseq))
|
(try (clojure.lang.RT/seqToTypedArray (seq aseq))
|
||||||
(catch Throwable _
|
(catch IllegalArgumentException _
|
||||||
(clojure.lang.RT/seqToTypedArray Object (seq aseq)))))
|
(clojure.lang.RT/seqToTypedArray Object (seq aseq)))))
|
||||||
([type aseq]
|
([type aseq]
|
||||||
(clojure.lang.RT/seqToTypedArray type (seq aseq))))
|
(clojure.lang.RT/seqToTypedArray type (seq aseq))))
|
||||||
|
|
@ -144,9 +154,11 @@
|
||||||
'file-seq (copy-core-var file-seq)
|
'file-seq (copy-core-var file-seq)
|
||||||
'promise (copy-core-var promise)
|
'promise (copy-core-var promise)
|
||||||
'deliver (copy-core-var deliver)
|
'deliver (copy-core-var deliver)
|
||||||
|
'locking (macrofy 'locking locking*)
|
||||||
'shutdown-agents (copy-core-var shutdown-agents)
|
'shutdown-agents (copy-core-var shutdown-agents)
|
||||||
'slurp (copy-core-var slurp)
|
'slurp (copy-core-var slurp)
|
||||||
'spit (copy-core-var spit)
|
'spit (copy-core-var spit)
|
||||||
|
'time (macrofy 'time time*)
|
||||||
'Throwable->map (copy-core-var Throwable->map)
|
'Throwable->map (copy-core-var Throwable->map)
|
||||||
'tap> (copy-core-var tap>)
|
'tap> (copy-core-var tap>)
|
||||||
'add-tap (copy-core-var add-tap)
|
'add-tap (copy-core-var add-tap)
|
||||||
|
|
@ -154,16 +166,13 @@
|
||||||
'*data-readers* data-readers
|
'*data-readers* data-readers
|
||||||
'default-data-readers (copy-core-var default-data-readers)
|
'default-data-readers (copy-core-var default-data-readers)
|
||||||
'xml-seq (copy-core-var xml-seq)
|
'xml-seq (copy-core-var xml-seq)
|
||||||
'read+string (new-var 'read+string (fn [& args]
|
'read+string (core-var 'read+string (fn [& args]
|
||||||
(apply read+string (common/ctx) args)))
|
(apply read+string @common/ctx args)))
|
||||||
'*command-line-args* command-line-args
|
'*command-line-args* command-line-args
|
||||||
'*warn-on-reflection* warn-on-reflection
|
'*warn-on-reflection* warn-on-reflection
|
||||||
'*compile-files* compile-files
|
'*compile-files* compile-files
|
||||||
'*unchecked-math* unchecked-math
|
'*unchecked-math* unchecked-math
|
||||||
'*math-context* math-context
|
'*math-context* math-context
|
||||||
'*compiler-options* compiler-options
|
|
||||||
'*compile-path* compile-path
|
|
||||||
'*source-path* sci/file
|
|
||||||
'with-precision (sci/copy-var with-precision clojure-core-ns)
|
'with-precision (sci/copy-var with-precision clojure-core-ns)
|
||||||
'-with-precision (sci/copy-var -with-precision clojure-core-ns)
|
'-with-precision (sci/copy-var -with-precision clojure-core-ns)
|
||||||
;; STM
|
;; STM
|
||||||
|
|
@ -174,8 +183,6 @@
|
||||||
'sync (sci/copy-var sync clojure-core-ns)
|
'sync (sci/copy-var sync clojure-core-ns)
|
||||||
'ref (sci/copy-var ref clojure-core-ns)
|
'ref (sci/copy-var ref clojure-core-ns)
|
||||||
'ref-set (sci/copy-var ref-set clojure-core-ns)
|
'ref-set (sci/copy-var ref-set clojure-core-ns)
|
||||||
'ensure (sci/copy-var ensure clojure-core-ns)
|
|
||||||
;; end STM
|
|
||||||
'update-vals (sci/copy-var update-vals clojure-core-ns)
|
'update-vals (sci/copy-var update-vals clojure-core-ns)
|
||||||
'update-keys (sci/copy-var update-keys clojure-core-ns)
|
'update-keys (sci/copy-var update-keys clojure-core-ns)
|
||||||
'parse-boolean (sci/copy-var parse-boolean clojure-core-ns)
|
'parse-boolean (sci/copy-var parse-boolean clojure-core-ns)
|
||||||
|
|
@ -191,17 +198,5 @@
|
||||||
'into-array (sci/copy-var into-array clojure-core-ns)
|
'into-array (sci/copy-var into-array clojure-core-ns)
|
||||||
'print-method (sci/copy-var print-method clojure-core-ns)
|
'print-method (sci/copy-var print-method clojure-core-ns)
|
||||||
'print-dup (sci/copy-var print-dup clojure-core-ns)
|
'print-dup (sci/copy-var print-dup clojure-core-ns)
|
||||||
'PrintWriter-on (sci/copy-var PrintWriter-on clojure-core-ns)
|
'PrintWriter-on (sci/copy-var PrintWriter-on clojure-core-ns)}
|
||||||
'set-agent-send-executor! (sci/copy-var set-agent-send-executor! clojure-core-ns)
|
|
||||||
'set-agent-send-off-executor! (sci/copy-var set-agent-send-off-executor! clojure-core-ns)
|
|
||||||
;; 1.12
|
|
||||||
'splitv-at (sci/copy-var splitv-at clojure-core-ns)
|
|
||||||
'stream-transduce! (sci/copy-var stream-transduce! clojure-core-ns)
|
|
||||||
'partitionv (sci/copy-var partitionv clojure-core-ns)
|
|
||||||
'stream-into! (sci/copy-var stream-into! clojure-core-ns)
|
|
||||||
'stream-reduce! (sci/copy-var stream-reduce! clojure-core-ns)
|
|
||||||
'stream-seq! (sci/copy-var stream-seq! clojure-core-ns)
|
|
||||||
'partitionv-all (sci/copy-var partitionv-all clojure-core-ns)
|
|
||||||
'*repl* repl
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -2,94 +2,33 @@
|
||||||
{:no-doc true}
|
{:no-doc true}
|
||||||
(:require [clojure.core.async :as async]
|
(:require [clojure.core.async :as async]
|
||||||
[clojure.core.async.impl.protocols :as protocols]
|
[clojure.core.async.impl.protocols :as protocols]
|
||||||
[clojure.core.async.impl.dispatch :as dispatch]
|
|
||||||
[sci.core :as sci :refer [copy-var]]
|
[sci.core :as sci :refer [copy-var]]
|
||||||
[sci.impl.copy-vars :refer [macrofy]]
|
[sci.impl.namespaces :refer [macrofy]]
|
||||||
[sci.impl.vars :as vars])
|
[sci.impl.vars :as vars]))
|
||||||
(:import [java.util.concurrent Executors ExecutorService ThreadFactory]))
|
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
(def ^java.util.concurrent.Executor executor @#'async/thread-macro-executor)
|
||||||
|
|
||||||
#_(def ^java.util.concurrent.Executor executor @#'async/thread-macro-executor)
|
|
||||||
(def executor-for
|
|
||||||
"Given a workload tag, returns an ExecutorService instance and memoizes the result. By
|
|
||||||
default, core.async will defer to a user factory (if provided via sys prop) or construct
|
|
||||||
a specialized ExecutorService instance for each tag :io, :compute, and :mixed. When
|
|
||||||
given the tag :core-async-dispatch it will default to the executor service for :io."
|
|
||||||
(memoize
|
|
||||||
(fn ^ExecutorService [workload]
|
|
||||||
(let [sysprop-factory nil #_(when-let [esf (System/getProperty "clojure.core.async.executor-factory")]
|
|
||||||
(requiring-resolve (symbol esf)))
|
|
||||||
sp-exec (and sysprop-factory (sysprop-factory workload))]
|
|
||||||
(or sp-exec
|
|
||||||
(if (= workload :core-async-dispatch)
|
|
||||||
(executor-for :io)
|
|
||||||
(@#'dispatch/create-default-executor workload)))))))
|
|
||||||
|
|
||||||
(alter-var-root #'dispatch/executor-for (constantly executor-for))
|
|
||||||
|
|
||||||
#_#_(defn exec
|
|
||||||
[^Runnable r workload]
|
|
||||||
(prn :r r :w workload)
|
|
||||||
(let [^ExecutorService e (executor-for workload)]
|
|
||||||
(.execute e r)))
|
|
||||||
|
|
||||||
(alter-var-root #'dispatch/exec (constantly exec))
|
|
||||||
|
|
||||||
(def ^java.util.concurrent.Executor virtual-executor
|
|
||||||
(try (eval '(java.util.concurrent.Executors/newVirtualThreadPerTaskExecutor))
|
|
||||||
(catch Exception _ nil)))
|
|
||||||
|
|
||||||
(defn thread-call
|
(defn thread-call
|
||||||
"Executes f in another thread, returning immediately to the calling
|
"Executes f in another thread, returning immediately to the calling
|
||||||
thread. Returns a channel which will receive the result of calling
|
thread. Returns a channel which will receive the result of calling
|
||||||
f when completed, then close. workload is a keyword that describes
|
|
||||||
the work performed by f, where:
|
|
||||||
|
|
||||||
:io - may do blocking I/O but must not do extended computation
|
|
||||||
:compute - must not ever block
|
|
||||||
:mixed - anything else (default)
|
|
||||||
|
|
||||||
when workload not supplied, defaults to :mixed"
|
|
||||||
([f] (thread-call f :mixed))
|
|
||||||
([f workload]
|
|
||||||
(let [c (async/chan 1)
|
|
||||||
returning-to-chan (fn [bf]
|
|
||||||
#(try
|
|
||||||
(when-some [ret (bf)]
|
|
||||||
(async/>!! c ret))
|
|
||||||
(finally (async/close! c))))
|
|
||||||
f (vars/binding-conveyor-fn f)]
|
|
||||||
(-> f #_bound-fn* returning-to-chan (dispatch/exec workload))
|
|
||||||
c)))
|
|
||||||
|
|
||||||
(defn -vthread-call
|
|
||||||
"Executes f in another virtual thread, returning immediately to the calling
|
|
||||||
thread. Returns a channel which will receive the result of calling
|
|
||||||
f when completed, then close."
|
f when completed, then close."
|
||||||
[f]
|
[f]
|
||||||
(let [c (async/chan 1)]
|
(let [c (async/chan 1)]
|
||||||
(let [returning-to-chan (fn [bf]
|
(let [binds (vars/get-thread-binding-frame)]
|
||||||
#(try
|
(.execute executor
|
||||||
(when-some [ret (bf)]
|
(fn []
|
||||||
(async/>!! c ret))
|
(vars/reset-thread-binding-frame binds)
|
||||||
(finally (async/close! c))))
|
(try
|
||||||
f (vars/binding-conveyor-fn f)]
|
(let [ret (f)]
|
||||||
(.execute virtual-executor
|
(when-not (nil? ret)
|
||||||
(-> f returning-to-chan)))
|
(async/>!! c ret)))
|
||||||
|
(finally
|
||||||
|
(async/close! c))))))
|
||||||
c))
|
c))
|
||||||
|
|
||||||
(defn thread
|
(defn thread
|
||||||
[_ _ & body]
|
[_ _ & body]
|
||||||
`(~'clojure.core.async/thread-call (fn [] ~@body) :mixed))
|
`(~'clojure.core.async/thread-call (fn [] ~@body)))
|
||||||
|
|
||||||
(defn io-thread
|
|
||||||
[_ _ & body]
|
|
||||||
`(~'clojure.core.async/thread-call (fn [] ~@body) :io))
|
|
||||||
|
|
||||||
(defn -vthread
|
|
||||||
[_ _ & body]
|
|
||||||
`(~'clojure.core.async/-vthread-call (fn [] ~@body)))
|
|
||||||
|
|
||||||
(defn alt!!
|
(defn alt!!
|
||||||
"Like alt!, except as if by alts!!, will block until completed, and
|
"Like alt!, except as if by alts!!, will block until completed, and
|
||||||
|
|
@ -99,19 +38,10 @@
|
||||||
|
|
||||||
(defn go-loop
|
(defn go-loop
|
||||||
[_ _ bindings & body]
|
[_ _ bindings & body]
|
||||||
(list 'clojure.core.async/go (list* 'loop bindings body)))
|
(list 'clojure.core.async/thread (list* 'loop bindings body)))
|
||||||
|
|
||||||
(def core-async-namespace (sci/create-ns 'clojure.core.async nil))
|
(def core-async-namespace (sci/create-ns 'clojure.core.async nil))
|
||||||
|
|
||||||
(defn timeout [ms]
|
|
||||||
(if virtual-executor
|
|
||||||
(let [chan (async/chan nil)]
|
|
||||||
(.execute virtual-executor (fn []
|
|
||||||
(Thread/sleep (long ms))
|
|
||||||
(async/close! chan)))
|
|
||||||
chan)
|
|
||||||
(async/timeout ms)))
|
|
||||||
|
|
||||||
(def async-namespace
|
(def async-namespace
|
||||||
{:obj core-async-namespace
|
{:obj core-async-namespace
|
||||||
'<!! (copy-var async/<!! core-async-namespace)
|
'<!! (copy-var async/<!! core-async-namespace)
|
||||||
|
|
@ -161,10 +91,8 @@
|
||||||
'take! (copy-var async/take! core-async-namespace)
|
'take! (copy-var async/take! core-async-namespace)
|
||||||
'tap (copy-var async/tap core-async-namespace)
|
'tap (copy-var async/tap core-async-namespace)
|
||||||
'thread (macrofy 'thread thread core-async-namespace)
|
'thread (macrofy 'thread thread core-async-namespace)
|
||||||
'io-thread (macrofy 'io-thread io-thread core-async-namespace)
|
|
||||||
'thread-call (copy-var thread-call core-async-namespace)
|
'thread-call (copy-var thread-call core-async-namespace)
|
||||||
'-vthread-call (copy-var -vthread-call core-async-namespace)
|
'timeout (copy-var async/timeout core-async-namespace)
|
||||||
'timeout (copy-var timeout core-async-namespace)
|
|
||||||
'to-chan (copy-var async/to-chan core-async-namespace)
|
'to-chan (copy-var async/to-chan core-async-namespace)
|
||||||
'to-chan! (copy-var async/to-chan! core-async-namespace)
|
'to-chan! (copy-var async/to-chan! core-async-namespace)
|
||||||
'to-chan!! (copy-var async/to-chan!! core-async-namespace)
|
'to-chan!! (copy-var async/to-chan!! core-async-namespace)
|
||||||
|
|
@ -179,9 +107,7 @@
|
||||||
'untap (copy-var async/untap core-async-namespace)
|
'untap (copy-var async/untap core-async-namespace)
|
||||||
'untap-all (copy-var async/untap-all core-async-namespace)
|
'untap-all (copy-var async/untap-all core-async-namespace)
|
||||||
;; polyfill
|
;; polyfill
|
||||||
'go (if virtual-executor
|
'go (macrofy 'go thread core-async-namespace)
|
||||||
(macrofy 'go -vthread core-async-namespace)
|
|
||||||
(macrofy 'go thread core-async-namespace))
|
|
||||||
'<! (copy-var async/<!! core-async-namespace {:name '<!})
|
'<! (copy-var async/<!! core-async-namespace {:name '<!})
|
||||||
'>! (copy-var async/>!! core-async-namespace {:name '>!})
|
'>! (copy-var async/>!! core-async-namespace {:name '>!})
|
||||||
'alt! (macrofy 'alt! alt!! core-async-namespace)
|
'alt! (macrofy 'alt! alt!! core-async-namespace)
|
||||||
|
|
@ -193,4 +119,3 @@
|
||||||
(def async-protocols-namespace
|
(def async-protocols-namespace
|
||||||
{:obj async-protocols-ns
|
{:obj async-protocols-ns
|
||||||
'ReadPort (copy-var protocols/ReadPort async-protocols-ns)})
|
'ReadPort (copy-var protocols/ReadPort async-protocols-ns)})
|
||||||
;; trigger CI
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
(case os
|
(case os
|
||||||
:mac (sh "open" url)
|
:mac (sh "open" url)
|
||||||
:linux (sh "xdg-open" url)
|
:linux (sh "xdg-open" url)
|
||||||
:windows (sh "cmd" "/C" "start" (.replace url "&" "^&"))))))
|
:windows (sh "cmd" "/C" "start" url)))))
|
||||||
|
|
||||||
(def browse-namespace
|
(def browse-namespace
|
||||||
{'*open-url-script* open-url-script
|
{'*open-url-script* open-url-script
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
(ns babashka.impl.clojure.java.process
|
|
||||||
(:require [clojure.java.process]
|
|
||||||
[sci.core :as sci]))
|
|
||||||
|
|
||||||
(def cjp (sci/create-ns 'clojure.java.process nil))
|
|
||||||
(def cjp-namespace (sci/copy-ns clojure.java.process cjp))
|
|
||||||
|
|
@ -55,13 +55,6 @@ by default when a new command-line REPL is started."} repl-requires
|
||||||
'[[clojure.repl :refer (source apropos pst dir doc find-doc)]
|
'[[clojure.repl :refer (source apropos pst dir doc find-doc)]
|
||||||
[clojure.pprint :refer (pp pprint)]])
|
[clojure.pprint :refer (pp pprint)]])
|
||||||
|
|
||||||
(defmacro with-read-known
|
|
||||||
"Evaluates body with *read-eval* set to a \"known\" value,
|
|
||||||
i.e. substituting true for :unknown if necessary."
|
|
||||||
[& body]
|
|
||||||
`(binding [*read-eval* (if (= :unknown *read-eval*) true *read-eval*)]
|
|
||||||
~@body))
|
|
||||||
|
|
||||||
(defn repl
|
(defn repl
|
||||||
"Generic, reusable, read-eval-print loop. By default, reads from *in*,
|
"Generic, reusable, read-eval-print loop. By default, reads from *in*,
|
||||||
writes to *out*, and prints exception summaries to *err*. If you use the
|
writes to *out*, and prints exception summaries to *err*. If you use the
|
||||||
|
|
@ -118,9 +111,8 @@ by default when a new command-line REPL is started."} repl-requires
|
||||||
:file "<repl>"
|
:file "<repl>"
|
||||||
:type :sci/error) e)))))))
|
:type :sci/error) e)))))))
|
||||||
(catch Throwable e
|
(catch Throwable e
|
||||||
(let [e' (ex-cause e)]
|
(caught e)
|
||||||
(caught e)
|
(set! *e e))))]
|
||||||
(set! *e e')))))]
|
|
||||||
(with-bindings
|
(with-bindings
|
||||||
(try
|
(try
|
||||||
(init)
|
(init)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
(ns babashka.impl.clojure.reflect
|
|
||||||
(:require [clojure.reflect]
|
|
||||||
[sci.core :as sci]))
|
|
||||||
|
|
||||||
(def rns (sci/create-ns 'clojure.reflect))
|
|
||||||
|
|
||||||
(def reflect-namespace {'reflect (sci/copy-var clojure.reflect/reflect rns)})
|
|
||||||
|
|
@ -297,7 +297,7 @@
|
||||||
current assertion."
|
current assertion."
|
||||||
{:added "1.1"}
|
{:added "1.1"}
|
||||||
[m]
|
[m]
|
||||||
(let [{:keys [:file :line]} (merge m (meta (first @testing-vars)))]
|
(let [{:keys [:file :line]} (meta (first @testing-vars))]
|
||||||
(str
|
(str
|
||||||
;; Uncomment to include namespace in failure report:
|
;; Uncomment to include namespace in failure report:
|
||||||
;;(ns-name (:ns (meta (first *testing-vars*)))) "/ "
|
;;(ns-name (:ns (meta (first *testing-vars*)))) "/ "
|
||||||
|
|
@ -316,8 +316,8 @@
|
||||||
Does nothing if *report-counters* is nil."
|
Does nothing if *report-counters* is nil."
|
||||||
{:added "1.1"}
|
{:added "1.1"}
|
||||||
[name]
|
[name]
|
||||||
(when-let [rc @report-counters]
|
(when @report-counters
|
||||||
(dosync (commute rc update-in [name] (fnil inc 0)))))
|
(swap! @report-counters update-in [name] (fnil inc 0))))
|
||||||
|
|
||||||
;;; TEST RESULT REPORTING
|
;;; TEST RESULT REPORTING
|
||||||
|
|
||||||
|
|
@ -408,7 +408,7 @@
|
||||||
{:added "1.1"}
|
{:added "1.1"}
|
||||||
[x]
|
[x]
|
||||||
(if (symbol? x)
|
(if (symbol? x)
|
||||||
(when-let [v (second (resolve/lookup (ctx) x false))]
|
(when-let [v (second (resolve/lookup @ctx x false))]
|
||||||
(when-let [value (if (instance? sci.lang.Var v)
|
(when-let [value (if (instance? sci.lang.Var v)
|
||||||
(get-possibly-unbound-var v)
|
(get-possibly-unbound-var v)
|
||||||
v)]
|
v)]
|
||||||
|
|
@ -660,12 +660,14 @@
|
||||||
|
|
||||||
;;; DEFINING FIXTURES
|
;;; DEFINING FIXTURES
|
||||||
|
|
||||||
|
(def ^:private ns->fixtures (atom {}))
|
||||||
|
|
||||||
(defn- add-ns-meta
|
(defn- add-ns-meta
|
||||||
"Adds elements in coll to the current namespace metadata as the
|
"Adds elements in coll to the current namespace metadata as the
|
||||||
value of key."
|
value of key."
|
||||||
{:added "1.1"}
|
{:added "1.1"}
|
||||||
[key coll]
|
[key coll]
|
||||||
(alter-meta! @sci/ns assoc key coll))
|
(swap! ns->fixtures assoc-in [(sci-namespaces/sci-ns-name @sci/ns) key] coll))
|
||||||
|
|
||||||
(defmulti use-fixtures
|
(defmulti use-fixtures
|
||||||
"Wrap test runs in a fixture function to perform setup and
|
"Wrap test runs in a fixture function to perform setup and
|
||||||
|
|
@ -675,10 +677,10 @@
|
||||||
(fn [fixture-type & args] fixture-type))
|
(fn [fixture-type & args] fixture-type))
|
||||||
|
|
||||||
(defmethod use-fixtures :each [fixture-type & args]
|
(defmethod use-fixtures :each [fixture-type & args]
|
||||||
(add-ns-meta :clojure.test/each-fixtures args))
|
(add-ns-meta ::each-fixtures args))
|
||||||
|
|
||||||
(defmethod use-fixtures :once [fixture-type & args]
|
(defmethod use-fixtures :once [fixture-type & args]
|
||||||
(add-ns-meta :clojure.test/once-fixtures args))
|
(add-ns-meta ::once-fixtures args))
|
||||||
|
|
||||||
(defn- default-fixture
|
(defn- default-fixture
|
||||||
"The default, empty, fixture function. Just calls its argument."
|
"The default, empty, fixture function. Just calls its argument."
|
||||||
|
|
@ -729,8 +731,10 @@
|
||||||
[vars]
|
[vars]
|
||||||
(doseq [[ns vars] (group-by (comp :ns meta) vars)
|
(doseq [[ns vars] (group-by (comp :ns meta) vars)
|
||||||
:when ns]
|
:when ns]
|
||||||
(let [once-fixture-fn (join-fixtures (:clojure.test/once-fixtures (meta ns)))
|
(let [ns-name (sci-namespaces/sci-ns-name ns)
|
||||||
each-fixture-fn (join-fixtures (:clojure.test/each-fixtures (meta ns)))]
|
fixtures (get @ns->fixtures ns-name)
|
||||||
|
once-fixture-fn (join-fixtures (::once-fixtures fixtures))
|
||||||
|
each-fixture-fn (join-fixtures (::each-fixtures fixtures))]
|
||||||
(once-fixture-fn
|
(once-fixture-fn
|
||||||
(fn []
|
(fn []
|
||||||
(doseq [v vars]
|
(doseq [v vars]
|
||||||
|
|
@ -754,7 +758,7 @@
|
||||||
*report-counters*."
|
*report-counters*."
|
||||||
{:added "1.1"}
|
{:added "1.1"}
|
||||||
[ctx ns]
|
[ctx ns]
|
||||||
(sci/binding [report-counters (ref @initial-report-counters)]
|
(sci/binding [report-counters (atom @initial-report-counters)]
|
||||||
(let [ns-obj (sci-namespaces/sci-the-ns ctx ns)]
|
(let [ns-obj (sci-namespaces/sci-the-ns ctx ns)]
|
||||||
(do-report {:type :begin-test-ns, :ns ns-obj})
|
(do-report {:type :begin-test-ns, :ns ns-obj})
|
||||||
;; If the namespace has a test-ns-hook function, call that:
|
;; If the namespace has a test-ns-hook function, call that:
|
||||||
|
|
@ -800,39 +804,3 @@
|
||||||
[summary]
|
[summary]
|
||||||
(and (zero? (:fail summary 0))
|
(and (zero? (:fail summary 0))
|
||||||
(zero? (:error summary 0))))
|
(zero? (:error summary 0))))
|
||||||
|
|
||||||
(defn run-test-var
|
|
||||||
"Runs the tests for a single Var, with fixtures executed around the test, and summary output after."
|
|
||||||
{:added "1.11"}
|
|
||||||
[v]
|
|
||||||
(sci/binding [report-counters (ref @initial-report-counters)]
|
|
||||||
(let [ns-obj (-> v meta :ns)
|
|
||||||
summary (do
|
|
||||||
(do-report {:type :begin-test-ns
|
|
||||||
:ns ns-obj})
|
|
||||||
(test-vars [v])
|
|
||||||
(do-report {:type :end-test-ns
|
|
||||||
:ns ns-obj})
|
|
||||||
(assoc @@report-counters :type :summary))]
|
|
||||||
(do-report summary)
|
|
||||||
summary)))
|
|
||||||
|
|
||||||
(defmacro run-test
|
|
||||||
"Runs a single test.
|
|
||||||
Because the intent is to run a single test, there is no check for the namespace test-ns-hook."
|
|
||||||
{:added "1.11"}
|
|
||||||
[test-symbol]
|
|
||||||
(let [test-var (sci/resolve (ctx) test-symbol)]
|
|
||||||
(cond
|
|
||||||
(nil? test-var)
|
|
||||||
(sci/binding [sci/out sci/err]
|
|
||||||
(binding [*out* sci/out]
|
|
||||||
(println "Unable to resolve" test-symbol "to a test function.")))
|
|
||||||
|
|
||||||
(not (-> test-var meta :test))
|
|
||||||
(sci/binding [sci/out sci/err]
|
|
||||||
(binding [*out* sci/out]
|
|
||||||
(println test-symbol "is not a test.")))
|
|
||||||
|
|
||||||
:else
|
|
||||||
`(clojure.test/run-test-var ~test-var))))
|
|
||||||
|
|
|
||||||
|
|
@ -1,91 +0,0 @@
|
||||||
(ns babashka.impl.clojure.tools.reader
|
|
||||||
(:refer-clojure :exclude [read read-string])
|
|
||||||
(:require
|
|
||||||
[clojure.tools.reader.reader-types :as rt]
|
|
||||||
[edamame.core :as e]
|
|
||||||
[sci.core :as sci]
|
|
||||||
[sci.ctx-store :as ctx]
|
|
||||||
[sci.impl.parser :as p]))
|
|
||||||
|
|
||||||
(def rns (sci/create-ns 'clojure.tools.reader))
|
|
||||||
|
|
||||||
(def default-opts
|
|
||||||
(e/normalize-opts
|
|
||||||
{:all true
|
|
||||||
:row-key :line
|
|
||||||
:col-key :column
|
|
||||||
:location? seq?
|
|
||||||
:end-location false}))
|
|
||||||
|
|
||||||
(def default-data-reader-fn (sci/new-dynamic-var '*default-data-reader-fn* nil {:ns rns}))
|
|
||||||
(def alias-map (sci/new-dynamic-var '*alias-map* nil {:ns rns}))
|
|
||||||
|
|
||||||
(defn resolve-tag [sym]
|
|
||||||
;; https://github.com/clojure/tools.reader/blob/ff18b1b872398a99e3e2941a0ed9abc0c2dec151/src/main/clojure/clojure/tools/reader.clj#L858
|
|
||||||
(or (default-data-readers sym)
|
|
||||||
(when-let [f @default-data-reader-fn]
|
|
||||||
(f sym))))
|
|
||||||
|
|
||||||
;; Added for compatibility with tools.namespace
|
|
||||||
(defn read
|
|
||||||
"Reads the first object from an IPushbackReader or a java.io.PushbackReader.
|
|
||||||
Returns the object read. If EOF, throws if eof-error? is true.
|
|
||||||
Otherwise returns sentinel. If no stream is provided, *in* will be used.
|
|
||||||
Opts is a persistent map with valid keys:
|
|
||||||
:read-cond - :allow to process reader conditionals, or
|
|
||||||
:preserve to keep all branches
|
|
||||||
:features - persistent set of feature keywords for reader conditionals
|
|
||||||
:eof - on eof, return value unless :eofthrow, then throw.
|
|
||||||
if not specified, will throw
|
|
||||||
***WARNING***
|
|
||||||
Note that read can execute code (controlled by *read-eval*),
|
|
||||||
and as such should be used only with trusted sources.
|
|
||||||
To read data structures only, use clojure.tools.reader.edn/read
|
|
||||||
Note that the function signature of clojure.tools.reader/read and
|
|
||||||
clojure.tools.reader.edn/read is not the same for eof-handling"
|
|
||||||
{:arglists '([] [reader] [opts reader] [reader eof-error? eof-value])}
|
|
||||||
([] (read @sci/in true nil))
|
|
||||||
([reader] (read reader true nil))
|
|
||||||
([{eof :eof :as opts :or {eof :eofthrow}} reader]
|
|
||||||
(let [opts (assoc default-opts
|
|
||||||
:read-cond (:read-cond opts)
|
|
||||||
:features (:features opts)
|
|
||||||
:readers (fn [sym]
|
|
||||||
(resolve-tag sym))
|
|
||||||
:auto-resolve (fn [alias]
|
|
||||||
(if (= :current alias)
|
|
||||||
(symbol (str @sci/ns))
|
|
||||||
(or (when-let [alias-map @alias-map]
|
|
||||||
(@alias-map alias))
|
|
||||||
(sci/eval-form (ctx/get-ctx)
|
|
||||||
(list 'get '(ns-aliases *ns*)
|
|
||||||
(list 'quote alias)))))))
|
|
||||||
v (e/parse-next reader opts)]
|
|
||||||
(if (identical? ::e/eof v)
|
|
||||||
(if (identical? :eofthrow eof)
|
|
||||||
(throw (java.io.EOFException.))
|
|
||||||
eof)
|
|
||||||
v)))
|
|
||||||
([reader eof-error? sentinel]
|
|
||||||
(let [v (e/parse-next reader default-opts)]
|
|
||||||
(if (identical? ::e/eof v)
|
|
||||||
(if eof-error?
|
|
||||||
(throw (java.io.EOFException.))
|
|
||||||
sentinel)
|
|
||||||
v))))
|
|
||||||
|
|
||||||
(defn read-string
|
|
||||||
([s] (read-string nil s))
|
|
||||||
([opts s]
|
|
||||||
(when (and s (not (identical? s "")))
|
|
||||||
(read opts (rt/string-push-back-reader s)))))
|
|
||||||
|
|
||||||
(defn resolve-symbol [sym]
|
|
||||||
(p/fully-qualify (ctx/get-ctx) sym))
|
|
||||||
|
|
||||||
(def reader-namespace
|
|
||||||
{'read (sci/copy-var read rns)
|
|
||||||
'read-string (sci/copy-var read-string rns)
|
|
||||||
'resolve-symbol (sci/copy-var resolve-symbol rns)
|
|
||||||
'*default-data-reader-fn* default-data-reader-fn
|
|
||||||
'*alias-map* alias-map})
|
|
||||||
|
|
@ -3,10 +3,7 @@
|
||||||
[clojure.tools.reader.reader-types :as rt]
|
[clojure.tools.reader.reader-types :as rt]
|
||||||
[sci.core :as sci]))
|
[sci.core :as sci]))
|
||||||
|
|
||||||
(def tr-edn-ns (sci/create-ns 'clojure.tools.reader.edn))
|
(def edn-namespace {'read-string (sci/copy-var edn/read-string (sci/create-ns 'clojure.tools.reader.edn))})
|
||||||
|
|
||||||
(def edn-namespace {'read-string (sci/copy-var edn/read-string tr-edn-ns)
|
|
||||||
'read (sci/copy-var edn/read tr-edn-ns)})
|
|
||||||
|
|
||||||
(def rtns (sci/create-ns 'clojure.tools.reader.reader-types))
|
(def rtns (sci/create-ns 'clojure.tools.reader.reader-types))
|
||||||
|
|
||||||
|
|
@ -16,6 +13,4 @@
|
||||||
'peek-char (sci/copy-var rt/peek-char rtns)
|
'peek-char (sci/copy-var rt/peek-char rtns)
|
||||||
'read-char (sci/copy-var rt/read-char rtns)
|
'read-char (sci/copy-var rt/read-char rtns)
|
||||||
'unread (sci/copy-var rt/unread rtns)
|
'unread (sci/copy-var rt/unread rtns)
|
||||||
'source-logging-push-back-reader (sci/copy-var rt/source-logging-push-back-reader rtns)
|
'source-logging-push-back-reader (sci/copy-var rt/source-logging-push-back-reader rtns)})
|
||||||
'source-logging-reader? (sci/copy-var rt/source-logging-reader? rtns)
|
|
||||||
'string-push-back-reader (sci/copy-var rt/string-push-back-reader rtns)})
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,6 @@
|
||||||
(ns babashka.impl.common
|
(ns babashka.impl.common)
|
||||||
(:require
|
|
||||||
[clojure.java.io :as io]
|
|
||||||
[clojure.string :as str]
|
|
||||||
[sci.ctx-store :as ctx-store]))
|
|
||||||
|
|
||||||
;; placeholder for ctx
|
;; placeholder for ctx
|
||||||
(defn ctx [] (ctx-store/get-ctx))
|
(def ctx (volatile! nil))
|
||||||
(def bb-edn (volatile! nil))
|
(def bb-edn (volatile! nil))
|
||||||
(def debug (volatile! false))
|
(def debug (volatile! false))
|
||||||
(def version (str/trim (slurp (io/resource "BABASHKA_VERSION"))))
|
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,4 @@
|
||||||
(def data-ns (sci/create-ns 'clojure.data nil))
|
(def data-ns (sci/create-ns 'clojure.data nil))
|
||||||
|
|
||||||
(def data-namespace
|
(def data-namespace
|
||||||
{'diff (copy-var data/diff data-ns)
|
{'diff (copy-var data/diff data-ns)})
|
||||||
'equality-partition (copy-var data/equality-partition data-ns)})
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
[babashka.fs :as fs]
|
[babashka.fs :as fs]
|
||||||
[babashka.impl.classpath :as cp]
|
[babashka.impl.classpath :as cp]
|
||||||
[babashka.impl.common :refer [bb-edn]]
|
[babashka.impl.common :refer [bb-edn]]
|
||||||
[babashka.process :as process]
|
|
||||||
[borkdude.deps :as deps]
|
[borkdude.deps :as deps]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[sci.core :as sci]))
|
[sci.core :as sci]))
|
||||||
|
|
@ -60,61 +59,42 @@
|
||||||
then used to resolve dependencies in babashka."
|
then used to resolve dependencies in babashka."
|
||||||
([deps-map] (add-deps deps-map nil))
|
([deps-map] (add-deps deps-map nil))
|
||||||
([deps-map {:keys [:aliases :env :extra-env :force]}]
|
([deps-map {:keys [:aliases :env :extra-env :force]}]
|
||||||
(let [deps-root (:deps-root @bb-edn)]
|
(when-let [paths (:paths deps-map)]
|
||||||
(when-let [paths (:paths deps-map)]
|
(let [paths (if-let [deps-root (:deps-root @bb-edn)]
|
||||||
(let [paths (if deps-root
|
(let [deps-root (fs/absolutize deps-root)
|
||||||
(let [deps-root (fs/absolutize deps-root)
|
paths (mapv #(str (fs/file deps-root %)) paths)]
|
||||||
paths (mapv #(str (fs/file deps-root %)) paths)]
|
paths)
|
||||||
paths)
|
paths)]
|
||||||
paths)]
|
(cp/add-classpath (str/join cp/path-sep paths))))
|
||||||
(cp/add-classpath (str/join cp/path-sep paths))))
|
(let [need-deps? (or (seq (:deps deps-map))
|
||||||
(let [need-deps? (or (seq (:deps deps-map))
|
(and (:aliases deps-map)
|
||||||
(and (:aliases deps-map)
|
aliases))]
|
||||||
aliases))]
|
(when need-deps?
|
||||||
(when need-deps?
|
(let [deps-map (dissoc deps-map
|
||||||
(let [deps-map (dissoc deps-map
|
;; paths are added manually above
|
||||||
;; paths are added manually above
|
;; extra-paths are added as :paths in tasks
|
||||||
;; extra-paths are added as :paths in tasks
|
:paths :tasks :raw :file :deps-root
|
||||||
:paths :tasks :raw :file :deps-root
|
:min-bb-version)]
|
||||||
:min-bb-version)
|
(binding [*print-namespace-maps* false]
|
||||||
;; associate deps-root to avoid cache conflict between different
|
(let [deps-map (assoc-in deps-map [:aliases :org.babashka/defaults]
|
||||||
;; bb.edns with relative local/roots by the same name NOTE:
|
{:replace-paths [] ;; babashka sets paths manually
|
||||||
;; deps-root is nil when bb.edn isn't used, so clashes may still
|
:classpath-overrides (cond->
|
||||||
;; happen with dynamic add-deps, but at least we don't invoke
|
'{org.clojure/clojure ""
|
||||||
;; clojure CLI's java process each time we call a script from a
|
org.clojure/spec.alpha ""}
|
||||||
;; different directory.
|
;; only remove core specs when they are not mentioned in deps map
|
||||||
deps-map (assoc deps-map :deps-root (str deps-root))]
|
(not (str/includes? (str deps-map) "org.clojure/core.specs.alpha"))
|
||||||
(binding [*print-namespace-maps* false]
|
(assoc 'org.clojure/core.specs.alpha ""))})
|
||||||
(let [deps-map (assoc-in deps-map [:aliases :org.babashka/defaults]
|
args (list "-Srepro" ;; do not include deps.edn from user config
|
||||||
{:replace-paths [] ;; babashka sets paths manually
|
"-Spath" "-Sdeps" (str deps-map)
|
||||||
:classpath-overrides (cond->
|
"-Sdeps-file" "") ;; we reset deps file so the local deps.edn isn't used
|
||||||
'{org.clojure/clojure ""
|
args (if force (cons "-Sforce" args) args)
|
||||||
org.clojure/spec.alpha ""}
|
args (concat args [(str "-A:" (str/join ":" (cons ":org.babashka/defaults" aliases)))])
|
||||||
;; only remove core specs when they are not mentioned in deps map
|
cp (with-out-str (binding [deps/*env* env
|
||||||
(not (str/includes? (str deps-map) "org.clojure/core.specs.alpha"))
|
deps/*extra-env* extra-env]
|
||||||
(assoc 'org.clojure/core.specs.alpha ""))})
|
(apply deps/-main args)))
|
||||||
args (list "-Srepro" ;; do not include deps.edn from user config
|
cp (str/trim cp)
|
||||||
"-Spath" "-Sdeps" (str deps-map)
|
cp (str/replace cp (re-pattern (str cp/path-sep "+$")) "")]
|
||||||
"-Sdeps-file" "__babashka_no_deps_file__.edn") ;; we reset deps file so the local deps.edn isn't used
|
(cp/add-classpath cp))))))))
|
||||||
args (if force (cons "-Sforce" args) args)
|
|
||||||
args (concat args [(str "-A:" (str/join ":" (cons ":org.babashka/defaults" aliases)))])
|
|
||||||
bindings (cond->
|
|
||||||
{#'deps/*aux-process-fn* (fn [{:keys [cmd out]}]
|
|
||||||
(process/shell
|
|
||||||
{:cmd cmd
|
|
||||||
:out out
|
|
||||||
:env env
|
|
||||||
:dir (when deps-root (str deps-root))
|
|
||||||
:extra-env extra-env}))
|
|
||||||
#'deps/*exit-fn* (fn [{:keys [message]}]
|
|
||||||
(when message
|
|
||||||
(throw (Exception. message))))}
|
|
||||||
deps-root (assoc #'deps/*dir* (str deps-root)))
|
|
||||||
cp (with-out-str (with-bindings bindings
|
|
||||||
(apply deps/-main args)))
|
|
||||||
cp (str/trim cp)
|
|
||||||
cp (str/replace cp (re-pattern (str cp/path-sep "+$")) "")]
|
|
||||||
(cp/add-classpath cp)))))))))
|
|
||||||
|
|
||||||
(def deps-namespace
|
(def deps-namespace
|
||||||
{'add-deps (sci/copy-var add-deps dns)
|
{'add-deps (sci/copy-var add-deps dns)
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
(ns babashka.impl.http-client
|
|
||||||
(:require
|
|
||||||
[babashka.http-client]
|
|
||||||
[babashka.http-client.interceptors]
|
|
||||||
[babashka.http-client.websocket]
|
|
||||||
[sci.core :as sci]))
|
|
||||||
|
|
||||||
(def hns (sci/create-ns 'babashka.http-client))
|
|
||||||
(def wns (sci/create-ns 'babashka.http-client.websocket))
|
|
||||||
(def ins (sci/create-ns 'babashka.http-client.interceptors))
|
|
||||||
|
|
||||||
(def http-client-namespace
|
|
||||||
(sci/copy-ns babashka.http-client hns))
|
|
||||||
|
|
||||||
(def http-client-websocket-namespace
|
|
||||||
(sci/copy-ns babashka.http-client.websocket wns))
|
|
||||||
|
|
||||||
(def http-client-interceptors-namespace
|
|
||||||
(sci/copy-ns babashka.http-client.interceptors ins))
|
|
||||||
|
|
@ -1,32 +1,14 @@
|
||||||
(ns babashka.impl.nrepl-server
|
(ns babashka.impl.nrepl-server
|
||||||
{:no-doc true}
|
{:no-doc true}
|
||||||
(:require
|
(:require [babashka.impl.common :as common]
|
||||||
[babashka.impl.classpath :as cp]
|
[babashka.nrepl.server :as server]
|
||||||
[babashka.impl.clojure.core :as core-extras]
|
[sci.core :as sci]))
|
||||||
[babashka.impl.common :as common]
|
|
||||||
[babashka.nrepl.impl.server :refer [process-msg]]
|
|
||||||
[babashka.nrepl.server :as server]
|
|
||||||
[sci.core :as sci]))
|
|
||||||
|
|
||||||
(defmethod process-msg :classpath [rf result m]
|
|
||||||
(rf result {:response {"status" ["done"]
|
|
||||||
"classpath" (cp/split-classpath (cp/get-classpath))}
|
|
||||||
:response-for (:msg m)}))
|
|
||||||
|
|
||||||
(defn start-server!
|
(defn start-server!
|
||||||
([]
|
([]
|
||||||
(start-server! nil))
|
(server/start-server! @common/ctx))
|
||||||
([opts]
|
([opts]
|
||||||
(let [dev? (= "true" (System/getenv "BABASHKA_DEV"))
|
(server/start-server! @common/ctx opts)))
|
||||||
opts (merge {:debug dev?
|
|
||||||
:describe {"versions" {"babashka" common/version}}
|
|
||||||
:thread-bind [core-extras/warn-on-reflection
|
|
||||||
core-extras/unchecked-math
|
|
||||||
core-extras/data-readers
|
|
||||||
sci/ns
|
|
||||||
sci/print-length]}
|
|
||||||
opts)]
|
|
||||||
(server/start-server! (common/ctx) opts))))
|
|
||||||
|
|
||||||
(def nrepl-server-namespace
|
(def nrepl-server-namespace
|
||||||
(let [ns-sci (sci/create-ns 'babashka.nrepl.server)]
|
(let [ns-sci (sci/create-ns 'babashka.nrepl.server)]
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
Namespace
|
Namespace
|
||||||
(datafy [n]
|
(datafy [n]
|
||||||
(with-meta {:name (sci-ns-name n)
|
(with-meta {:name (sci-ns-name n)
|
||||||
:publics (->> n (sci-ns-publics (ctx)) sortmap)
|
:publics (->> n (sci-ns-publics @ctx) sortmap)
|
||||||
:imports (->> n (sci-ns-imports (ctx)) sortmap)
|
:imports (->> n (sci-ns-imports @ctx) sortmap)
|
||||||
:interns (->> n (sci-ns-interns (ctx)) sortmap)}
|
:interns (->> n (sci-ns-interns @ctx) sortmap)}
|
||||||
(meta n))))
|
(meta n))))
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
(ns babashka.impl.pods
|
(ns babashka.impl.pods
|
||||||
{:no-doc true}
|
{:no-doc true}
|
||||||
(:refer-clojure :exclude [read])
|
(:refer-clojure :exclude [read])
|
||||||
(:require
|
(:require [babashka.impl.common :refer [ctx bb-edn]]
|
||||||
[babashka.impl.common :refer [bb-edn ctx]]
|
[babashka.pods.sci :as pods]
|
||||||
[babashka.pods.sci :as pods]
|
[sci.core :as sci]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]))
|
||||||
[sci.core :as sci]))
|
|
||||||
|
|
||||||
(defn load-pod [& args]
|
(defn load-pod [& args]
|
||||||
(apply pods/load-pod (ctx) args))
|
(apply pods/load-pod @ctx args))
|
||||||
|
|
||||||
(defn load-pods-metadata [pods-map opts]
|
(defn load-pods-metadata [pods-map opts]
|
||||||
(reduce-kv
|
(reduce-kv
|
||||||
|
|
@ -33,10 +32,19 @@
|
||||||
"for pods on your local filesystem."))))))
|
"for pods on your local filesystem."))))))
|
||||||
{} pods-map))
|
{} pods-map))
|
||||||
|
|
||||||
|
(defn load-pod-metadata-from-manifest
|
||||||
|
[manifest]
|
||||||
|
(pods/load-pod-metadata-from-manifest manifest (-> @bb-edn :file io/file)))
|
||||||
|
|
||||||
|
(defn pod-manifest-file
|
||||||
|
[manifest]
|
||||||
|
(pods/pod-manifest-file manifest))
|
||||||
|
|
||||||
(def podns (sci/create-ns 'babashka.pods nil))
|
(def podns (sci/create-ns 'babashka.pods nil))
|
||||||
|
|
||||||
(def pods-namespace
|
(def pods-namespace
|
||||||
{'load-pod (sci/copy-var load-pod podns)
|
{'load-pod (sci/copy-var load-pod podns)
|
||||||
|
'load-pod-metadata-from-manifest (sci/copy-var load-pod-metadata-from-manifest podns)
|
||||||
'invoke (sci/copy-var pods/invoke podns)
|
'invoke (sci/copy-var pods/invoke podns)
|
||||||
'unload-pod (sci/copy-var pods/unload-pod podns)
|
'unload-pod (sci/copy-var pods/unload-pod podns)
|
||||||
'add-transit-read-handler! (sci/copy-var pods/add-transit-read-handler! podns)
|
'add-transit-read-handler! (sci/copy-var pods/add-transit-read-handler! podns)
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
{:no-doc true}
|
{:no-doc true}
|
||||||
(:require [clojure.pprint :as pprint]
|
(:require [clojure.pprint :as pprint]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[sci.pprint]
|
[sci.pprint]))
|
||||||
[babashka.impl.clojure.core.async]))
|
|
||||||
|
|
||||||
(defonce patched? (volatile! false))
|
(defonce patched? (volatile! false))
|
||||||
|
|
||||||
|
|
@ -209,7 +208,6 @@
|
||||||
'init-navigator (sci/copy-var pprint/init-navigator pprint-ns)
|
'init-navigator (sci/copy-var pprint/init-navigator pprint-ns)
|
||||||
'execute-format (sci/copy-var execute-format pprint-ns)
|
'execute-format (sci/copy-var execute-format pprint-ns)
|
||||||
'with-pprint-dispatch (sci/copy-var pprint/with-pprint-dispatch pprint-ns)
|
'with-pprint-dispatch (sci/copy-var pprint/with-pprint-dispatch pprint-ns)
|
||||||
'code-dispatch (sci/copy-var pprint/code-dispatch pprint-ns)
|
|
||||||
'*print-pprint-dispatch* print-pprint-dispatch
|
'*print-pprint-dispatch* print-pprint-dispatch
|
||||||
'*print-miser-width* print-miser-width
|
'*print-miser-width* print-miser-width
|
||||||
'get-pretty-writer (sci/copy-var get-pretty-writer pprint-ns)
|
'get-pretty-writer (sci/copy-var get-pretty-writer pprint-ns)
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,10 @@
|
||||||
edn/read-string)
|
edn/read-string)
|
||||||
deps (:deps deps)
|
deps (:deps deps)
|
||||||
deps (assoc deps
|
deps (assoc deps
|
||||||
'babashka/fs {:mvn/version "0.5.25"}
|
'babashka/fs {:mvn/version "0.1.2"}
|
||||||
'babashka/babashka.curl {:mvn/version "0.1.2"}
|
'babashka/babashka.curl {:mvn/version "0.1.1"}
|
||||||
'babashka/babashka.core {:git/url "https://github.com/babashka/babashka.core"
|
'babashka/babashka.core {:git/url "https://github.com/babashka/babashka.core"
|
||||||
:git/sha "52a6037bd4b632bffffb04394fb4efd0cdab6b1e"}
|
:git/sha "52a6037bd4b632bffffb04394fb4efd0cdab6b1e"})
|
||||||
'babashka/process {:mvn/version "0.6.23"})
|
|
||||||
deps (dissoc deps
|
deps (dissoc deps
|
||||||
'borkdude/sci
|
'borkdude/sci
|
||||||
'org.babashka/sci
|
'org.babashka/sci
|
||||||
|
|
@ -30,7 +29,6 @@
|
||||||
'org.hsqldb/hsqldb)
|
'org.hsqldb/hsqldb)
|
||||||
bb-edn-deps (:deps @common/bb-edn)
|
bb-edn-deps (:deps @common/bb-edn)
|
||||||
deps (merge deps bb-edn-deps)
|
deps (merge deps bb-edn-deps)
|
||||||
deps (into (sorted-map) deps)
|
|
||||||
paths (:paths @common/bb-edn)
|
paths (:paths @common/bb-edn)
|
||||||
deps {:deps deps}
|
deps {:deps deps}
|
||||||
deps (cond-> deps
|
deps (cond-> deps
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue