Compare commits
1 commit
master
...
simple-dat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b214843f1 |
454 changed files with 3942 additions and 41611 deletions
|
|
@ -2,5 +2,5 @@
|
|||
:deps {borkdude/gh-release-artifact
|
||||
#_{:local/root "../gh-release-artifact"}
|
||||
{:git/url "https://github.com/borkdude/gh-release-artifact"
|
||||
:git/sha "4a9a74f0e50e897c45df8cc70684360eb30fce80"}}
|
||||
:sha "2f8898d84126a4e922c490f8614211a8b0cf67cd"}}
|
||||
:tasks {release-artifact babashka.release-artifact/release}}
|
||||
|
|
|
|||
|
|
@ -3,38 +3,541 @@
|
|||
# Check https://circleci.com/docs/2.0/language-clojure/ for more details
|
||||
#
|
||||
version: 2.1
|
||||
|
||||
# this allows you to use CircleCI's dynamic configuration feature
|
||||
setup: true
|
||||
|
||||
# the continuation orb is required in order to use dynamic configuration
|
||||
orbs:
|
||||
continuation: circleci/continuation@0.1.2
|
||||
|
||||
# our defined job, and its steps
|
||||
jobs:
|
||||
setup:
|
||||
jvm:
|
||||
docker:
|
||||
- image: cimg/clojure:1.11.1
|
||||
# specify the version you desire here
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
BABASHKA_PLATFORM: linux # could be used in jar name
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: Bootstrap Babashka
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
|
||||
sudo bash install --dir /tmp
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "project.clj" }}-{{ checksum "deps.edn" }}
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v1-dependencies-
|
||||
- run:
|
||||
name: Rename bb binary
|
||||
command: mv /tmp/bb /tmp/bbb
|
||||
- run:
|
||||
name: Generate config
|
||||
name: Install Clojure
|
||||
command: |
|
||||
/tmp/bbb .circleci/script/gen_ci.clj > generated_config.yml
|
||||
- continuation/continue:
|
||||
configuration_path: generated_config.yml
|
||||
wget -nc https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Run JVM tests
|
||||
command: |
|
||||
export BABASHKA_FEATURE_JDBC=true
|
||||
export BABASHKA_FEATURE_POSTGRESQL=true
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
# - run:
|
||||
# name: Run as tools.deps dependency
|
||||
# command: |
|
||||
# .circleci/script/tools.deps
|
||||
- run:
|
||||
name: Run as lein command
|
||||
command: |
|
||||
.circleci/script/lein
|
||||
- run:
|
||||
name: Create uberjar
|
||||
command: |
|
||||
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"
|
||||
BABASHKA_EDN=".build/bb.edn" java -jar "$jar" release-artifact "$jar"
|
||||
BABASHKA_EDN=".build/bb.edn" java -jar "$jar" release-artifact "$reflection"
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "project.clj" }}-{{ checksum "deps.edn" }}
|
||||
linux:
|
||||
docker:
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-21.1.0
|
||||
BABASHKA_PLATFORM: linux # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Install native dev tools
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install g++ zlib1g-dev
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- persist_to_workspace:
|
||||
root: /tmp
|
||||
paths:
|
||||
- release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-21.1.0
|
||||
key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj || true
|
||||
linux-static:
|
||||
docker:
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-21.1.0
|
||||
BABASHKA_PLATFORM: linux # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_STATIC: "true"
|
||||
BABASHKA_MUSL: "true"
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /tmp
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
# - run:
|
||||
# name: "Short circuit on SNAPSHOT"
|
||||
# command: |
|
||||
# VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
# if [[ "$VERSION" == *-SNAPSHOT ]]
|
||||
# then
|
||||
# circleci task halt
|
||||
# fi
|
||||
- restore_cache:
|
||||
keys:
|
||||
- linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Install native dev tools
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||
sudo -E script/setup-musl
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- persist_to_workspace:
|
||||
root: /tmp
|
||||
paths:
|
||||
- release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-21.1.0
|
||||
key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj || true
|
||||
linux-aarch64:
|
||||
machine:
|
||||
enabled: true
|
||||
image: ubuntu-2004:202101-01
|
||||
resource_class: arm.large
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-21.1.0
|
||||
BABASHKA_PLATFORM: linux # used in release script
|
||||
BABASHKA_ARCH: aarch64
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- run:
|
||||
name: "Short circuit on SNAPSHOT"
|
||||
command: |
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
if [[ "$VERSION" == *-SNAPSHOT ]]
|
||||
then
|
||||
circleci task halt
|
||||
fi
|
||||
- restore_cache:
|
||||
keys:
|
||||
- linux-aarch64-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Leiningen
|
||||
command: |
|
||||
sudo script/install-leiningen
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Install native dev tools
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-aarch64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-aarch64-21.1.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- persist_to_workspace:
|
||||
root: /tmp
|
||||
paths:
|
||||
- release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-21.1.0
|
||||
key: linux-aarch64-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj || true
|
||||
linux-aarch64-static:
|
||||
machine:
|
||||
enabled: true
|
||||
image: ubuntu-2004:202101-01
|
||||
resource_class: arm.large
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_HOME: /home/circleci/graalvm-ce-java11-21.1.0
|
||||
BABASHKA_PLATFORM: linux # used in release script
|
||||
BABASHKA_ARCH: aarch64
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
BABASHKA_STATIC: "true"
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
# - run:
|
||||
# name: "Short circuit on SNAPSHOT"
|
||||
# command: |
|
||||
# VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
# if [[ "$VERSION" == *-SNAPSHOT ]]
|
||||
# then
|
||||
# circleci task halt
|
||||
# fi
|
||||
- restore_cache:
|
||||
keys:
|
||||
- linux-aarch64-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Leiningen
|
||||
command: |
|
||||
sudo script/install-leiningen
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
wget https://download.clojure.org/install/linux-install-1.10.1.447.sh
|
||||
chmod +x linux-install-1.10.1.447.sh
|
||||
sudo ./linux-install-1.10.1.447.sh
|
||||
- run:
|
||||
name: Install lsof
|
||||
command: |
|
||||
sudo apt-get install lsof
|
||||
- run:
|
||||
name: Install native dev tools
|
||||
command: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install gcc g++ zlib1g-dev
|
||||
# sudo -E script/setup-musl
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-aarch64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-aarch64-21.1.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- persist_to_workspace:
|
||||
root: /tmp
|
||||
paths:
|
||||
- release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-21.1.0
|
||||
key: linux-aarch64-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj || true
|
||||
mac:
|
||||
macos:
|
||||
xcode: "12.0.0"
|
||||
environment:
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.13 # 10.12 is EOL
|
||||
GRAALVM_HOME: /Users/distiller/graalvm-ce-java11-21.1.0/Contents/Home
|
||||
BABASHKA_PLATFORM: macos # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
resource_class: large
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- run:
|
||||
name: Install Clojure
|
||||
command: |
|
||||
script/install-clojure /usr/local
|
||||
- run:
|
||||
name: Install Leiningen
|
||||
command: |
|
||||
script/install-leiningen
|
||||
- run:
|
||||
name: Download GraalVM
|
||||
command: |
|
||||
cd ~
|
||||
ls -la
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-darwin-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-darwin-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
- run:
|
||||
name: Build binary
|
||||
command: |
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
script/uberjar
|
||||
script/compile
|
||||
no_output_timeout: 30m
|
||||
- run:
|
||||
name: Run tests
|
||||
command: |
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
- run:
|
||||
name: Release
|
||||
command: |
|
||||
.circleci/script/release
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
- ~/graalvm-ce-java11-21.1.0
|
||||
key: mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }}
|
||||
- store_artifacts:
|
||||
path: /tmp/release
|
||||
destination: release
|
||||
- run:
|
||||
name: Publish artifact link to Slack
|
||||
command: |
|
||||
./bb .circleci/script/publish_artifact.clj || true
|
||||
deploy:
|
||||
resource_class: large
|
||||
docker:
|
||||
- image: circleci/clojure:lein-2.9.1
|
||||
working_directory: ~/repo
|
||||
environment:
|
||||
LEIN_ROOT: "true"
|
||||
steps:
|
||||
- checkout
|
||||
- run:
|
||||
name: "Pull Submodules"
|
||||
command: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-dependencies-{{ checksum "project.clj" }}
|
||||
# fallback to using the latest cache if no exact match is found
|
||||
- v1-dependencies-
|
||||
- run: .circleci/script/deploy
|
||||
- save_cache:
|
||||
paths:
|
||||
- ~/.m2
|
||||
key: v1-dependencies-{{ checksum "project.clj" }}
|
||||
docker:
|
||||
docker:
|
||||
- image: circleci/buildpack-deps:stretch
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: /tmp
|
||||
- setup_remote_docker:
|
||||
version: 19.03.12
|
||||
- run:
|
||||
name: Build Docker image
|
||||
command: .circleci/script/docker
|
||||
|
||||
# our single workflow, that triggers the setup job defined above
|
||||
workflows:
|
||||
setup:
|
||||
version: 2
|
||||
ci:
|
||||
jobs:
|
||||
- setup
|
||||
- jvm
|
||||
- linux
|
||||
- linux-static
|
||||
- mac
|
||||
- linux-aarch64
|
||||
- linux-aarch64-static
|
||||
- deploy:
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
requires:
|
||||
- jvm
|
||||
- linux
|
||||
- mac
|
||||
- docker:
|
||||
filters:
|
||||
branches:
|
||||
only: master
|
||||
requires:
|
||||
- linux
|
||||
- linux-static
|
||||
|
|
|
|||
46
.circleci/script/docker
Executable file
46
.circleci/script/docker
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
image_name="babashka/babashka"
|
||||
image_tag=$(cat resources/BABASHKA_VERSION)
|
||||
latest_tag="latest"
|
||||
|
||||
if [[ $image_tag =~ SNAPSHOT$ ]]; then
|
||||
echo "This is a snapshot version"
|
||||
snapshot="true"
|
||||
else
|
||||
echo "This is a non-snapshot version"
|
||||
snapshot="false"
|
||||
fi
|
||||
|
||||
if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then
|
||||
echo "Building Docker image $image_name:$image_tag"
|
||||
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin
|
||||
tar zxvf "/tmp/release/babashka-${image_tag}-linux-amd64.tar.gz"
|
||||
docker build -t "$image_name" -f Dockerfile.ci .
|
||||
docker tag "$image_name:$latest_tag" "$image_name:$image_tag"
|
||||
rm -f bb
|
||||
if [[ $snapshot == "false" ]]; then
|
||||
tar zxvf "/tmp/release/babashka-${image_tag}-linux-amd64-static.tar.gz"
|
||||
docker build -t "$image_name:alpine" -f Dockerfile.alpine .
|
||||
docker tag "$image_name:alpine" "$image_name:$image_tag-alpine"
|
||||
fi
|
||||
# we only update latest when it's not a SNAPSHOT version
|
||||
if [ "false" = "$snapshot" ]; then
|
||||
echo "Pushing image $image_name:$latest_tag"
|
||||
docker push "$image_name:$latest_tag"
|
||||
echo "Pushing image $image_name:alpine"
|
||||
docker push "$image_name:alpine"
|
||||
fi
|
||||
# we update the version tag, even if it's a SNAPSHOT version
|
||||
echo "Pushing image $image_name:$image_tag"
|
||||
docker push "$image_name:$image_tag"
|
||||
if [[ $snapshot == "false" ]]; then
|
||||
docker push "$image_name:$image_tag-alpine"
|
||||
fi
|
||||
else
|
||||
echo "Not publishing Docker image"
|
||||
fi
|
||||
|
||||
exit 0;
|
||||
|
|
@ -1,125 +0,0 @@
|
|||
(require '[babashka.fs :as fs]
|
||||
'[babashka.process :as proc]
|
||||
'[clojure.string :as str])
|
||||
(import '[java.time Instant])
|
||||
|
||||
(defn read-env
|
||||
([k]
|
||||
(read-env k nil))
|
||||
([k default]
|
||||
(or (System/getenv k)
|
||||
default)))
|
||||
|
||||
(def image-name "babashka/babashka")
|
||||
|
||||
(def ghcr-image-name "ghcr.io/babashka/babashka")
|
||||
|
||||
(def image-tag (str/trim (slurp "resources/BABASHKA_VERSION")))
|
||||
|
||||
(def latest-tag "latest")
|
||||
|
||||
(def platforms (read-env "PLATFORMS" "linux/amd64"))
|
||||
|
||||
(def circle-repository-url (read-env "CIRCLE_REPOSITORY_URL"))
|
||||
|
||||
(def label-args
|
||||
["--label" "'org.opencontainers.image.description=Native, fast starting Clojure interpreter for scripting'"
|
||||
"--label" "org.opencontainers.image.title=Babashka"
|
||||
"--label" (str "org.opencontainers.image.created=" (Instant/now))
|
||||
"--label" (str "org.opencontainers.image.url=" circle-repository-url)
|
||||
"--label" (str "org.opencontainers.image.documentation=" circle-repository-url)
|
||||
"--label" (str "org.opencontainers.image.source=" circle-repository-url)
|
||||
"--label" (str "org.opencontainers.image.revision=" (read-env "CIRCLE_SHA1"))
|
||||
"--label"
|
||||
(format "org.opencontainers.image.ref.name=%s:%s"
|
||||
(read-env "CIRCLE_TAG")
|
||||
(read-env "CIRCLE_BRANCH"))
|
||||
"--label" (str "org.opencontainers.image.version=" image-tag)])
|
||||
|
||||
(def snapshot? (str/includes? image-tag "SNAPSHOT"))
|
||||
|
||||
(defn exec
|
||||
[cmd]
|
||||
(-> cmd
|
||||
(proc/process {:out :inherit :err :inherit})
|
||||
(proc/check)))
|
||||
|
||||
(defn docker-login
|
||||
[username 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
|
||||
[image-tag platform docker-file]
|
||||
(println (format "Building and pushing %s Docker image(s) %s:%s"
|
||||
platform
|
||||
image-name
|
||||
image-tag))
|
||||
(let [base-cmd ["docker" "buildx" "build"
|
||||
"-t" (str image-name ":" image-tag)
|
||||
"--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"
|
||||
"-f" docker-file]]
|
||||
(exec (concat base-cmd label-args ["."]))))
|
||||
|
||||
(defn build-push-images
|
||||
[]
|
||||
(doseq [platform (str/split platforms #",")]
|
||||
(let [tarball-platform (str/replace platform #"\/" "-")
|
||||
tarball-platform (if (= "linux-arm64" tarball-platform)
|
||||
"linux-aarch64-static"
|
||||
tarball-platform)
|
||||
tarball-path (format "/tmp/release/babashka-%s-%s.tar.gz"
|
||||
image-tag
|
||||
tarball-platform)]
|
||||
(fs/create-dirs platform)
|
||||
(exec ["tar" "zxvf" tarball-path "-C" platform])
|
||||
; 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})))
|
||||
(build-push image-tag platforms "Dockerfile.ci")
|
||||
(build-push-ghcr image-tag platforms "Dockerfile.ci")
|
||||
(when-not snapshot?
|
||||
(build-push latest-tag platforms "Dockerfile.ci")
|
||||
(build-push-ghcr latest-tag platforms "Dockerfile.ci")))
|
||||
|
||||
(defn build-push-alpine-images
|
||||
"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")])
|
||||
(build-push (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
||||
(build-push-ghcr (str image-tag "-alpine") "linux/amd64" "Dockerfile.alpine")
|
||||
(when-not snapshot?
|
||||
(build-push "alpine" "linux/amd64" "Dockerfile.alpine")
|
||||
(build-push-ghcr "alpine" "linux/amd64" "Dockerfile.alpine")))
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(if (and (nil? (read-env "CIRCLE_PULL_REQUEST"))
|
||||
(= "master" (read-env "CIRCLE_BRANCH")))
|
||||
(do
|
||||
(if snapshot?
|
||||
(println "This is a snapshot version")
|
||||
(println "This is a non-snapshot version"))
|
||||
(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-alpine-images))
|
||||
(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))
|
||||
|
|
@ -6,7 +6,9 @@ cp bb /tmp/release
|
|||
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
|
||||
|
||||
cd /tmp/release
|
||||
mkdir -p /tmp/bb_size
|
||||
./bb '(spit "/tmp/bb_size/size" (.length (io/file "bb")))'
|
||||
|
||||
## release binary as tar.gz archive
|
||||
|
||||
|
|
@ -16,22 +18,13 @@ if [ "$BABASHKA_STATIC" = "true" ]; then
|
|||
arch="$arch-static"
|
||||
fi
|
||||
|
||||
# because circle won't allow the same file to be saved/restored in the same workspace concurrently
|
||||
cp metabom.jar "/tmp/release/$BABASHKA_PLATFORM-$arch-metabom.jar"
|
||||
|
||||
cd /tmp/release
|
||||
mkdir -p /tmp/bb_size
|
||||
./bb '(spit "/tmp/bb_size/size" (.length (io/file "bb")))'
|
||||
|
||||
archive="babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz"
|
||||
|
||||
tar zcvf "$archive" bb # bbk
|
||||
|
||||
cd -
|
||||
|
||||
if [ "$BABASHKA_RELEASE" = "true" ]; then
|
||||
./bb --config .build/bb.edn --deps-root . release-artifact "/tmp/release/$archive"
|
||||
fi
|
||||
BABASHKA_EDN=".build/bb.edn" ./bb release-artifact "/tmp/release/$archive"
|
||||
|
||||
## cleanup
|
||||
|
||||
|
|
|
|||
42
.cirrus.yml
42
.cirrus.yml
|
|
@ -1,42 +0,0 @@
|
|||
macos_instance:
|
||||
image: ghcr.io/cirruslabs/macos-monterey-base:latest
|
||||
|
||||
task:
|
||||
skip: "changesIncludeOnly('logo/*', '**.md')"
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_VERSION: "24"
|
||||
GRAALVM_HOME: ${HOME}/graalvm-${GRAALVM_VERSION}/Contents/Home
|
||||
BABASHKA_PLATFORM: macos # used in release script
|
||||
BABASHKA_ARCH: aarch64
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
GITHUB_TOKEN: ENCRYPTED[d6ff8cdc392157f211c754fa0763875434d1bfde0c00a05e48ba9470003a76c14c9213adb80623f81e13f2f0fa8fbd57]
|
||||
script: |
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
sudo script/install-clojure
|
||||
sudo script/install-leiningen
|
||||
script/install-graalvm
|
||||
export PATH=$GRAALVM_HOME/bin:$PATH
|
||||
export JAVA_HOME=$GRAALVM_HOME
|
||||
sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
||||
java -version
|
||||
|
||||
export BABASHKA_SHA=$(git rev-parse HEAD)
|
||||
|
||||
script/uberjar
|
||||
# curl -sLO 'https://github.com/babashka/pgo-profiles/releases/download/2023.10.11/default.iprof'
|
||||
script/compile # --pgo=default.iprof
|
||||
|
||||
# script/test
|
||||
# script/run_lib_tests
|
||||
|
||||
VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
arch=${BABASHKA_ARCH:-amd64}
|
||||
archive="babashka-$VERSION-$BABASHKA_PLATFORM-$arch.tar.gz"
|
||||
tar zcvf "$archive" bb
|
||||
./bb --config .build/bb.edn --deps-root . release-artifact "$archive" || true
|
||||
binaries_artifacts:
|
||||
path: "babashka-*.tar.gz"
|
||||
|
|
@ -1 +0,0 @@
|
|||
{:lint-as {babashka.fs/with-temp-dir clojure.core/let}}
|
||||
|
|
@ -1 +0,0 @@
|
|||
{:hooks {:macroexpand {sci.core/copy-ns sci.core/copy-ns}}}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
(ns sci.core)
|
||||
|
||||
(defmacro copy-ns
|
||||
([ns-sym sci-ns]
|
||||
`(copy-ns ~ns-sym ~sci-ns nil))
|
||||
([ns-sym sci-ns opts]
|
||||
`[(quote ~ns-sym)
|
||||
~sci-ns
|
||||
(quote ~opts)]))
|
||||
|
|
@ -1,9 +1,7 @@
|
|||
{:config-paths ["babashka/sci"]
|
||||
:lint-as {me.raynes.conch/let-programs clojure.core/let
|
||||
{:lint-as {me.raynes.conch/let-programs clojure.core/let
|
||||
babashka.impl.File/gen-wrapper-fn clojure.core/def
|
||||
babashka.impl.Pattern/gen-wrapper-fn 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-constants clojure.core/declare}
|
||||
:linters {:unsorted-required-namespaces {:level :warning}}
|
||||
:hooks {:analyze-call {clojure.core/requiring-resolve hooks.mine/req-resolve}}}
|
||||
:linters {:unsorted-required-namespaces {:level :warning}}}
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
{:lint-as
|
||||
{rewrite-clj.zip/subedit-> clojure.core/->
|
||||
rewrite-clj.zip/subedit->> clojure.core/->>
|
||||
rewrite-clj.zip/edit-> clojure.core/->
|
||||
rewrite-clj.zip/edit->> clojure.core/->>}}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
((clojure-mode
|
||||
(cider-clojure-cli-aliases . "test")))
|
||||
|
|
@ -12,8 +12,7 @@ test/
|
|||
.gitmodules
|
||||
appveyor.yml
|
||||
CHANGES.md
|
||||
deps.edn
|
||||
Dockerfile
|
||||
LICENSE
|
||||
README.md
|
||||
.cpcache/
|
||||
target/
|
||||
|
|
|
|||
5
.github/ISSUE_TEMPLATE/bug_report.md
vendored
5
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
|
@ -7,9 +7,6 @@ assignees: ''
|
|||
|
||||
---
|
||||
|
||||
[ To keep development of this project going, consider sponsoring. If you are
|
||||
already a sponsor, thank you! ]
|
||||
|
||||
**version**
|
||||
|
||||
[ Please specify which version of babashka you're using. You can find this with `babashka --version`. The documentation on the master branch may be ahead of the most released version. ]
|
||||
|
|
@ -30,3 +27,5 @@ new binary when the issue is resolved. ]
|
|||
**expected behavior**
|
||||
|
||||
[ What is the behavior you expected to see? Please provide a minimal working example ]
|
||||
|
||||
[ Optional: if you or your organization is sponsoring this project, please write "**Sponsor**" in this ticket for higher priority. ]
|
||||
|
|
|
|||
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
5
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
|
@ -7,9 +7,6 @@ assignees: ''
|
|||
|
||||
---
|
||||
|
||||
[ To keep development of this project going, consider sponsoring. If you are
|
||||
already a sponsor, thank you! ]
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
|
|
@ -21,3 +18,5 @@ A clear and concise description of any alternative solutions or features you've
|
|||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
[ Optional: if you or your organization is sponsoring this project, please write "**Sponsor**" in this ticket for higher priority _after vetting_. ]
|
||||
|
|
|
|||
9
.github/pull_request_template.md
vendored
9
.github/pull_request_template.md
vendored
|
|
@ -1,9 +0,0 @@
|
|||
Please answer the following questions and leave the below in as part of your PR.
|
||||
|
||||
- [ ] I have read the [developer documentation](https://github.com/babashka/babashka/blob/master/doc/dev.md).
|
||||
|
||||
- [ ] This PR corresponds to an [issue with a clear problem statement](https://github.com/babashka/babashka/blob/master/doc/dev.md#start-with-an-issue-before-writing-code).
|
||||
|
||||
- [ ] This PR contains a [test](https://github.com/babashka/babashka/blob/master/doc/dev.md#tests) to prevent against future regressions
|
||||
|
||||
- [ ] I have updated the [CHANGELOG.md](https://github.com/babashka/babashka/blob/master/CHANGELOG.md) file with a description of the addressed issue.
|
||||
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
|
||||
467
.github/workflows/build.yml
vendored
467
.github/workflows/build.yml
vendored
|
|
@ -2,75 +2,82 @@ name: build
|
|||
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "logo/**"
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- "**.md"
|
||||
- "logo/**"
|
||||
branches:
|
||||
- master
|
||||
|
||||
# TODO: Add deploy if needed
|
||||
jobs:
|
||||
jvm:
|
||||
if: ${{ false }} # Disabled
|
||||
# if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
BABASHKA_PLATFORM: linux # could be used in jar name
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BABASHKA_SHA: ${{ github.sha }}
|
||||
|
||||
scratch:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Scratch
|
||||
run: |
|
||||
echo "Scratch"
|
||||
|
||||
jvm:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
# ubuntu 18.04 comes with lein + java8 installed
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v1
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Prepare java
|
||||
uses: actions/setup-java@v2
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
with:
|
||||
distribution: 'adopt-hotspot'
|
||||
java-version: '19'
|
||||
path: ~/graalvm-ce-java11-21.1.0
|
||||
key: ${{ runner.os }}-graalvm-21.1.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-21.1.0
|
||||
|
||||
- name: Install clojure tools
|
||||
uses: DeLaGuardo/setup-clojure@5.0
|
||||
with:
|
||||
cli: 1.10.3.1040
|
||||
lein: 2.9.8
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Fetch deps
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
lein deps
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
BABASHKA_FEATURE_JDBC: "true"
|
||||
BABASHKA_FEATURE_POSTGRESQL: "true"
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
script/test
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
sudo script/install-clojure
|
||||
script/run_lib_tests
|
||||
|
||||
- name: Build uberjar
|
||||
run: |
|
||||
mkdir -p /tmp/release
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
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"
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
|
|
@ -78,130 +85,289 @@ jobs:
|
|||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
- name: Reflection artifact
|
||||
run: |
|
||||
cp reflection.json babashka-${{ steps.babashka-version.outputs.version }}-reflection.json
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
name: jar
|
||||
path: target/babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
|
||||
native:
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: babashka-${{ steps.babashka-version.outputs.version }}-reflection.json
|
||||
|
||||
linux:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-13
|
||||
name: macos
|
||||
static: false
|
||||
#- os: ubuntu-latest
|
||||
# name: linux
|
||||
# static: false
|
||||
#- os: ubuntu-latest
|
||||
# name: linux
|
||||
# static: true
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
LEIN_ROOT: "true"
|
||||
GRAALVM_VERSION: "24"
|
||||
BABASHKA_PLATFORM: ${{ matrix.name }} # used in release script
|
||||
BABASHKA_TEST_ENV: native
|
||||
BABASHKA_XMX: "-J-Xmx6500m"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BABASHKA_SHA: ${{ github.sha }}
|
||||
needs: [jvm]
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: jar
|
||||
path: .
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: .
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v1
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-21.1.0
|
||||
key: ${{ runner.os }}-graalvm-21.1.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-21.1.0
|
||||
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build Linux native image
|
||||
run: |
|
||||
export BABASHKA_JAR=babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
export BABASHKA_XMX="-J-Xmx6g"
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
cp babashka-${{ steps.babashka-version.outputs.version }}-reflection.json reflection.json
|
||||
script/compile
|
||||
|
||||
- name: Test binary
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
BABASHKA_TEST_ENV=native script/test
|
||||
|
||||
- name: Install clojure
|
||||
run: |
|
||||
sudo script/install-clojure /usr/local
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
BABASHKA_TEST_ENV=native script/run_lib_tests
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip
|
||||
|
||||
linux-static:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
needs: [jvm]
|
||||
runs-on: ubuntu-16.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: jar
|
||||
path: .
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: .
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v1
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-21.1.0
|
||||
key: ${{ runner.os }}-graalvm-21.1.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-21.1.0
|
||||
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build Linux native image
|
||||
run: |
|
||||
export BABASHKA_JAR=babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
export BABASHKA_XMX="-J-Xmx6g"
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
export BABASHKA_STATIC=true
|
||||
cp babashka-${{ steps.babashka-version.outputs.version }}-reflection.json reflection.json
|
||||
script/compile
|
||||
|
||||
- name: Test binary
|
||||
run: |
|
||||
./bb '(+ 1 2 3)'
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
BABASHKA_TEST_ENV=native script/test
|
||||
|
||||
- name: Install clojure
|
||||
run: |
|
||||
sudo script/install-clojure
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0"
|
||||
BABASHKA_TEST_ENV=native script/run_lib_tests
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip
|
||||
|
||||
mac:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
||||
needs: [jvm]
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: jar
|
||||
path: .
|
||||
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: reflection.json
|
||||
path: .
|
||||
|
||||
- name: Cache GraalVM
|
||||
uses: actions/cache@v1
|
||||
id: cache-graalvm
|
||||
with:
|
||||
path: ~/graalvm-ce-java11-21.1.0
|
||||
key: ${{ runner.os }}-graalvm-21.1.0
|
||||
restore-keys: |
|
||||
${{ runner.os }}-graalvm-21.1.0
|
||||
|
||||
- name: Download GraalVM
|
||||
run: |
|
||||
cd ~
|
||||
if ! [ -d graalvm-ce-java11-21.1.0 ]; then
|
||||
curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-darwin-amd64-21.1.0.tar.gz
|
||||
tar xzf graalvm-ce-java11-darwin-amd64-21.1.0.tar.gz
|
||||
fi
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build macOS native image
|
||||
run: |
|
||||
export BABASHKA_JAR=babashka-${{ steps.babashka-version.outputs.version }}-standalone.jar
|
||||
export BABASHKA_XMX="-J-Xmx6g"
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0/Contents/Home"
|
||||
cp babashka-${{ steps.babashka-version.outputs.version }}-reflection.json reflection.json
|
||||
script/compile
|
||||
|
||||
- name: Test binary
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0/Contents/Home"
|
||||
sudo script/install-leiningen
|
||||
BABASHKA_TEST_ENV=native script/test
|
||||
|
||||
- name: Test libraries
|
||||
run: |
|
||||
export GRAALVM_HOME="$HOME/graalvm-ce-java11-21.1.0/Contents/Home"
|
||||
sudo script/install-clojure
|
||||
BABASHKA_TEST_ENV=native script/run_lib_tests
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
path: bb
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-macos-amd64.zip
|
||||
|
||||
deploy:
|
||||
if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'"
|
||||
needs: [jvm, linux, linux-static, mac]
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
||||
- name: Cache deps
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v1
|
||||
id: cache-deps
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('project.clj') }}
|
||||
restore-keys: ${{ runner.os }}-maven-
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Setup GraalVM
|
||||
if: "matrix.static == false"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '24'
|
||||
distribution: 'graalvm'
|
||||
components: 'native-image'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup GraalVM+musl
|
||||
if: "matrix.static == true"
|
||||
uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '24'
|
||||
distribution: 'graalvm'
|
||||
components: 'native-image'
|
||||
native-image-musl: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install clojure tools
|
||||
uses: DeLaGuardo/setup-clojure@5.0
|
||||
with:
|
||||
cli: 1.10.3.1040
|
||||
lein: 2.9.8
|
||||
|
||||
- name: Install native dev tools
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install build-essential zlib1g-dev
|
||||
|
||||
- name: Babashka version
|
||||
id: babashka-version
|
||||
run: |
|
||||
BABASHKA_VERSION=$(cat resources/BABASHKA_VERSION)
|
||||
echo "##[set-output name=version;]${BABASHKA_VERSION}"
|
||||
|
||||
- name: Build uberjar
|
||||
run: script/uberjar
|
||||
|
||||
- name: Build native image
|
||||
if: "matrix.static == false"
|
||||
run: script/compile
|
||||
|
||||
- name: Build static native image
|
||||
if: "matrix.static == true"
|
||||
- name: Deploy
|
||||
env:
|
||||
BABASHKA_STATIC: "true"
|
||||
BABASHKA_MUSL: "true"
|
||||
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
|
||||
CLOJARS_USER: "${{ secrets.CLOJARS_USER }}"
|
||||
CLOJARS_PASS: "${{ secrets.CLOJARS_PASS }}"
|
||||
run: |
|
||||
script/test
|
||||
script/run_lib_tests
|
||||
|
||||
- name: Release
|
||||
run: .circleci/script/release
|
||||
.github/script/deploy
|
||||
|
||||
docker:
|
||||
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'"
|
||||
needs:
|
||||
- native
|
||||
runs-on: ubuntu-latest
|
||||
- linux
|
||||
- linux-static
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: 'true'
|
||||
|
|
@ -216,27 +382,20 @@ jobs:
|
|||
run: mkdir -p /tmp/release
|
||||
|
||||
- name: Download linux binary
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-amd64.zip
|
||||
path: /tmp/release
|
||||
|
||||
- name: Download static linux binary
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: babashka-${{ steps.babashka-version.outputs.version }}-linux-static-amd64.zip
|
||||
path: /tmp/release-static
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build uberjar
|
||||
run: script/uberjar
|
||||
|
||||
- name: Docker build
|
||||
env:
|
||||
DOCKERHUB_USER: "${{ secrets.DOCKERHUB_USER }}"
|
||||
DOCKERHUB_PASS: "${{ secrets.DOCKERHUB_PASS }}"
|
||||
PLATFORMS: linux/amd64,linux/arm64
|
||||
run: java -jar ./target/babashka-$(cat resources/BABASHKA_VERSION)-standalone.jar .circleci/script/docker.clj
|
||||
run: |
|
||||
.github/script/docker
|
||||
|
|
|
|||
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -16,7 +16,7 @@ pom.xml.asc
|
|||
!test-resources/babashka/src_for_classpath_test/foo.jar
|
||||
!test-resources/pom.xml
|
||||
.cpcache
|
||||
*reflect-config.json
|
||||
*reflection.json
|
||||
/tmp
|
||||
/reports
|
||||
*.dylib
|
||||
|
|
@ -33,9 +33,3 @@ org_babashka*.h
|
|||
.envrc
|
||||
.lsp
|
||||
bb.build_artifacts.txt
|
||||
target
|
||||
.nrepl-port
|
||||
.DS_Store
|
||||
.portal
|
||||
default.iprof
|
||||
scratch.clj
|
||||
|
|
|
|||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -23,6 +23,3 @@
|
|||
[submodule "fs"]
|
||||
path = fs
|
||||
url = https://github.com/babashka/fs
|
||||
[submodule "babashka.core"]
|
||||
path = babashka.core
|
||||
url = https://github.com/babashka/babashka.core.git
|
||||
|
|
|
|||
930
CHANGELOG.md
930
CHANGELOG.md
|
|
@ -2,927 +2,11 @@
|
|||
|
||||
For a list of breaking changes, check [here](#breaking-changes).
|
||||
|
||||
A preview of the next release can be installed from
|
||||
[babashka-dev-builds](https://github.com/babashka/babashka-dev-builds).
|
||||
|
||||
[Babashka](https://github.com/babashka/babashka): Native, fast starting Clojure interpreter for scripting
|
||||
|
||||
## 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))
|
||||
- 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
|
||||
- [#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
|
||||
- [#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)
|
||||
|
||||
- [#808](https://github.com/babashka/babashka/issues/808): support `-Sdeps` option to support passing extra deps map which will be merged last
|
||||
- [#1336](https://github.com/babashka/babashka/issues/1336): tasks subcommand doesn't work with global `-Sforce` option ([@bobisageek](https://github.com/bobisageek))
|
||||
- [#1340](https://github.com/babashka/babashka/issues/1340): `defprotocol` methods are missing `:doc` metadata ([@bobisageek](https://github.com/bobisageek))
|
||||
- [#1368](https://github.com/babashka/babashka/issues/1368): `-x`: do not pick up on aliases in `user` ns
|
||||
- [#1367](https://github.com/babashka/babashka/issues/1367): Fix line number in clojure.test output ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
||||
- [#1370](https://github.com/babashka/babashka/issues/1370): Add `core.async` `to-chan!`, `to-chan!!`, `onto-chan!` ([@cap10morgan](https://github.com/cap10morgan))
|
||||
- [#1358](https://github.com/babashka/babashka/issues/1358): Expose a subset of `java.lang.ref` to enable hooking into the destruction/GC of objects ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
||||
- [#1364](https://github.com/babashka/babashka/issues/1364): Be tolerant of unknown tags in `bb.edn`
|
||||
- Add and expose `babashka.classes/all-classes` to get a list of all available classes (as `java.lang.Class` objects) ([@eerohele](https://github.com/eerohele))
|
||||
- Add more reflection class methods ([@eerohele](https://github.com/eerohele))
|
||||
- Bump `clj-yaml`
|
||||
- Add `-x` help
|
||||
- Set `TCP_NODELAY` in pods for performance
|
||||
- Expose `clojure.main/with-bindings`
|
||||
- Add `ThreadPoolExecutor` rejection policy classes ([@eerohele](https://github.com/eerohele))
|
||||
- Download but don't run pods when `os.name` / `os.arch` don't match ([@cap10morgan](https://github.com/cap10morgan))
|
||||
- Add `clojure.core.server/stop-server` ([@eerohele](https://github.com/eerohele))
|
||||
- Add `ns-unalias`
|
||||
- Add `AtomicInteger` and `AtomicLong` to full interop
|
||||
- Add `PrintWriter-on`
|
||||
- Improve `reify` error messages ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
||||
- Expose `core.async` `ManyToManyChannel`
|
||||
- fs: add `write-lines`
|
||||
- fs: add `write-bytes`
|
||||
- [#1350](https://github.com/babashka/babashka/issues/1350): map `clojure.lang.Var` to `sci.lang.Var`
|
||||
- Use temporary fork of `clj-yaml` with new `:load-all`, `:unknown-tag-fn`
|
||||
options and preserves strings with numbers that start with zeros as strings
|
||||
(this solves a problem when YAML 1.1 output is read as YAML 1.2.). Once
|
||||
upstream SnakeYAML 1.33 lands, this will be used again.
|
||||
|
||||
## 0.9.162 (2022-09-04)
|
||||
|
||||
Check out our new project: [bbin](https://github.com/babashka/bbin): install any Babashka script or project with one command. Thanks [@rads](https://github.com/rads)!
|
||||
|
||||
- Throw exception on attempt to reify multiple interfaces ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
||||
- Allow java.lang.Object reify with empty methods ([@retrogradeorbit](https://github.com/retrogradeorbit))
|
||||
- [#1343](https://github.com/babashka/babashka/issues/1343): Fix postgres feature
|
||||
- [#1345](https://github.com/babashka/babashka/issues/1345): add `javax.net.ssl.SSLException` and `java.net.SocketTimeoutException` classes ([@lread](https://github.com/lread))
|
||||
- Fix `satisfies?` with marker protocol (no methods)
|
||||
- Update `rewrite-clj`
|
||||
- Update `deps.clj`
|
||||
- Update `babashka.cli`
|
||||
- Update `org.clj-commons/clj-yaml`
|
||||
- `babashka.fs`: fix `expand-home` on Windows
|
||||
- `babashka.fs`: expose `:win-exts`
|
||||
- nREPL: preserve stacktrace on exception
|
||||
- Fix [#1322](https://github.com/babashka/babashka/issues/1322): improve error location
|
||||
- Fix [#1338](https://github.com/babashka/babashka/issues/1338): `add-watch` segfault
|
||||
- Fix [#1339](https://github.com/babashka/babashka/issues/1339): resolve record name ending with dot.
|
||||
|
||||
## 0.9.161 (2022-07-31)
|
||||
|
||||
- Fix `exec`
|
||||
|
||||
## 0.9.160 (2022-07-29)
|
||||
|
||||
- Breaking: change `exec`, introduced in `0.9.159` to a function instead.
|
||||
You now write `(exec 'mynamespace.function)` instead.
|
||||
|
||||
## 0.9.159 (2022-07-29)
|
||||
|
||||
Read the introductory blog post about the new babashka CLI integration [here](https://blog.michielborkent.nl/babashka-tasks-meets-babashka-cli.html).
|
||||
|
||||
- [#1324](https://github.com/babashka/babashka/issues/1324): `-x` to invoke a function with babashka CLI
|
||||
- [#1324](https://github.com/babashka/babashka/issues/1324): `babashka.tasks/exec` to invoke a function with babashka CLI in tasks
|
||||
- SCI: don't eval metatada on defn body
|
||||
- SCI issue 774: make interpreter stacktrace available to user
|
||||
- `babashka.process`: improve `tokenize`
|
||||
- Upgrade to GraalVM 22.2.0 (#1325)
|
||||
|
||||
## 0.8.157 (2022-07-01)
|
||||
|
||||
- Add compatibility with [`metosin/malli`](https://github.com/metosin/malli#babashka) `{:mvn/version "0.8.9"}`.
|
||||
- Expose `babashka.nrepl.server/start-server!`- and `stop-server!`-functions to support programmatically starting
|
||||
an nrepl-server. `start-server!` is redefined to not require a sci-context as its first argument.
|
||||
- Fix misspelling in script/uberjar: `BABASHKA_FEATURE_TRANSIT`
|
||||
|
||||
## 0.8.156 (2022-06-08)
|
||||
|
||||
- macOS aarch64 support. Upgrading via brew or the installer script should
|
||||
install the aarch64 version on an M1 system.
|
||||
- Support for running [prismatic/schema](https://github.com/plumatic/schema)
|
||||
from source. There is an open PR for babashka. Until it is merged you can use
|
||||
[this](https://github.com/borkdude/schema/tree/bb-test-suite) fork.
|
||||
- SCI: many small improvements, especially in `defrecord` (discovered while
|
||||
trying to make `schema.core` work)
|
||||
- Switch version schema to major.minor.release_count.
|
||||
- babashka.nrepl: fix completions for static Java interop
|
||||
- `fs/read-all-lines`, support charset
|
||||
- fs: `strip` and `split-ext` are less reliant on file system and are now just
|
||||
string operations
|
||||
- Bump cheshire
|
||||
- Add `babashka.process/exec` for exec call (replacing the current process)
|
||||
- Improve `babashka.process/tokenize`
|
||||
- [#1264](https://github.com/babashka/babashka/issues/1264): add support for calling `ScheduledExecutorService`
|
||||
- Add support for `sun.misc.SignalHandler`
|
||||
- Add `java.net.BindException`, `clojure.lang.AFunction`, `AbstractMethodError`
|
||||
- Upgrade httpkit to `2.6.0-RC1`
|
||||
- Add `process/shell`, similar to `babashka.tasks/shell` but in process ns
|
||||
- pods: fix benign socket closed exception error output
|
||||
|
||||
## 0.8.2 (2022-05-06)
|
||||
|
||||
- Convey `*print-length*` to pprint and allow `set!`
|
||||
- `babashka.nrepl`: support pprint length
|
||||
- SCI: support invoking field, without dash
|
||||
- Add compatibility with clojure numeric tower
|
||||
- Update deps.clj to tools jar `1.11.1.1113`
|
||||
- Compatibility with fipp and puget
|
||||
- Fix [#1233](https://github.com/babashka/babashka/issues/1233): don't print error to stdout in prepl
|
||||
- Update process with `:pre-start-fn` option
|
||||
- Update fs with `cwd` and Windows glob improvements
|
||||
- Expose edamame, fixes [#549](https://github.com/babashka/babashka/issues/549) and [#1258](https://github.com/babashka/babashka/issues/1258) (#1259)
|
||||
- Support `BABASBHKA_PODS_DIR` environment variable
|
||||
|
||||
## 0.8.1 (2022-04-15)
|
||||
|
||||
- Add `prepare` subcommand to download deps & pods and cache pod metadata
|
||||
- [#1041](https://github.com/babashka/babashka/issues/1041): Improve error message when regex literal in EDN config
|
||||
- [#1223](https://github.com/babashka/babashka/issues/1223): Ensure that var metadata (specifically `:name`) aligns with the var's symbol (which in turn ensures that `doc` will print the var's name)
|
||||
- [#556](https://github.com/babashka/babashka/issues/556) Add server-status to org.httpkit.server
|
||||
- [#1231](https://github.com/babashka/babashka/issues/1231): missing methods in `reify` should fall back to default interface methods
|
||||
- Fix destructuring in defrecord protocol impls
|
||||
- Support `*print-dup*`
|
||||
|
||||
## 0.8.0 (2022-04-04)
|
||||
|
||||
### New
|
||||
|
||||
- [#863](https://github.com/babashka/babashka/issues/863): allow pods to be declared in `bb.edn` and load them when required. See [pod library docs](https://github.com/babashka/pods#in-a-babashka-project) and the entry in the [babashka book](https://book.babashka.org/#_pods_in_bb_edn) for details.
|
||||
|
||||
### Enhanced
|
||||
|
||||
- [#1216](https://github.com/babashka/babashka/issues/1216): support `core.async/alts!` using polyfill
|
||||
- [#1220](https://github.com/babashka/babashka/issues/1220): add reflection on java.util.concurrent.Future
|
||||
- [#1211](https://github.com/babashka/babashka/issues/1211): return exit code 130 on sigint
|
||||
- [#1224](https://github.com/babashka/babashka/issues/1224): add `proxy` support for `java.io.PipedInputStream` and `java.io.PipedOutputStream`. Add reflection for `java.utils.Scanner`.
|
||||
- [babashka.curl#43](https://github.com/babashka/babashka.curl/issues/43) fix: last set-cookie headers on a page overwrites the ones before
|
||||
- [#1216](https://github.com/babashka/babashka/issues/1216): fix `core.async` alts example with polyfill
|
||||
- SCI: support `let*` special form
|
||||
- Add compatibility with GraalVM 22.1
|
||||
- Bump timbre
|
||||
- Bump Clojure to 1.11.0
|
||||
- Pods: support Rosetta2 fallback
|
||||
- Process: fix for pprint
|
||||
- Fs: improvement for which: do not match on local paths
|
||||
- Proxy support for PipedInputStream and PipedOutputStream
|
||||
- Expose `java.util.Scanner` for interop
|
||||
- Bump Selmer
|
||||
- Add `->Eduction`
|
||||
- Add `*unchecked-math` for compatibility
|
||||
|
||||
## 0.7.8 (2022-03-13)
|
||||
|
||||
This release improves compatibility with several libraries: [loom](https://github.com/aysylu/loom), [hugsql.core](https://www.hugsql.org) and [specter](https://github.com/redplanetlabs/specter)!
|
||||
|
||||
To use specter in babashka, use the following coordinates:
|
||||
|
||||
``` clojure
|
||||
{:deps {com.rpl/specter {:mvn/version "1.1.4"}}}
|
||||
```
|
||||
|
||||
- Add `clojure.data.priority-map` as built-in library - this makes babashka compatible with [aysylu/loom](https://github.com/aysylu/loom)
|
||||
- Add part of `clojure.tools.reader.reader-types` to support [hugsql.core](https://www.hugsql.org)
|
||||
- [#1204](https://github.com/babashka/babashka/issues/1204) add property `babashka.config` to reflect `bb.edn` location ([@mknoszlig](https://github.com/mknoszlig))
|
||||
- Several fixes and enhancements to run Red Planet Lab's [specter](https://github.com/borkdude/specter/commit/8ba809a2cd35d3b6f8c5287e6bd3b4e06e42f6dc) library in babashka
|
||||
- [#1199](https://github.com/babashka/babashka/issues/1199): support `print-method` impls on records
|
||||
- `babashka.fs`: add `windows?` predicate
|
||||
- SCI: add `*clojure-version*` and `(clojure-version)`
|
||||
- Add `java.util.zip.Deflater` and `java.util.zip.DeflaterOutputStream`
|
||||
- SCI: implement `declare` as macro
|
||||
- [#938](https://github.com/babashka/babashka/issues/938): drop location metadata from symbols, except top level
|
||||
|
||||
## 0.7.7 (2022-03-04)
|
||||
|
||||
### New
|
||||
|
||||
- [#1187](https://github.com/babashka/babashka/issues/1187) tasks: Add `:result` key to `(current-task)` map that can be used in `:leave` task hook
|
||||
- [#1192](https://github.com/babashka/babashka/issues/1192): expose `*assert*`
|
||||
- Add `clojure.instant/parse-timestamp`
|
||||
- Compatibility with [at-at](https://github.com/overtone/at-at) by adding:
|
||||
- `java.text.SimpleDateFormat`
|
||||
- `java.util.concurrent.ThreadPoolExecutor`
|
||||
- `java.util.concurrent.ScheduledThreadPoolExecutor`
|
||||
- Add `pprint/get-pretty-writer`
|
||||
|
||||
### Enhancements
|
||||
|
||||
- [#1190](https://github.com/babashka/babashka/issues/1190) tasks: task dependencies resolve as core.async channels
|
||||
- Bump tools deps jar to `1.10.3.1087`
|
||||
|
||||
## 0.7.6 (2022-02-24)
|
||||
|
||||
Please leave some feedback about babashka in the [2022 Q1 Survey](https://forms.gle/ko3NjDg2SwXeEoNQ9)!
|
||||
|
||||
- SCI performance improvements
|
||||
- Bump clj-yaml to 0.7.1.108
|
||||
- [#1181](https://github.com/babashka/babashka/issues/1181): clojure.test report does not respect *test-out* correctly
|
||||
- [#1180](https://github.com/babashka/babashka/issues/1180): limit bb tasks output to first line of docstring
|
||||
- babashka.process: support appending to `:out` file
|
||||
- babashka.fs: add `create-temp-file`, `read-attributes*`, `zip`
|
||||
|
||||
## 0.7.5 (2022-02-16)
|
||||
|
||||
Please leave some feedback about babashka in the [2022 Q1 Survey](https://forms.gle/ko3NjDg2SwXeEoNQ9)!
|
||||
|
||||
- SCI: Performance improvements for loops and varargs function invocation.
|
||||
- Fix [#1170](https://github.com/babashka/babashka/issues/1170): `defmacro` with a `defrecord` inside fails to resolve classname in protocol implementation.
|
||||
- Bump deps.clj to tools jar `1.10.3.1082`.
|
||||
- Upgrade to GraalVM 22.0.0.2.
|
||||
- Add `halt-when`.
|
||||
- Add `java.io.Data` classes
|
||||
- Add compatibility with [clojure-msgpack](https://github.com/edma2/clojure-msgpack)
|
||||
- Upgrade to clojure 11 beta1
|
||||
- Bump transit to 1.0.329
|
||||
|
||||
## 0.7.4 (2022-01-25)
|
||||
|
||||
Please leave some feedback about babashka [here](https://forms.gle/ko3NjDg2SwXeEoNQ9).
|
||||
|
||||
- Add new namespace from clojure 1.11: `clojure.math`
|
||||
- Add new vars from clojure 1.11: `abs`, `iteration`
|
||||
- Add compatibility with `org.clojure/algo.monads`
|
||||
- SCI: support `:as-alias`
|
||||
- SCI: add `pop!` ([@kbaba1001](https://github.com/kbaba1001))
|
||||
- `deps.clj`: update to clojure CLI 1.10.3.1058
|
||||
- Add metabom jar to docker images [#1133](https://github.com/babashka/babashka/issues/1133) ([@kipz](https://github.com/kipz), [@lispyclouds](https://github.com/lispyclouds))
|
||||
- Add opencontainers annotations to docker image [#1134](https://github.com/babashka/babashka/issues/1134) ([@kipz](https://github.com/kipz), [@lispyclouds](https://github.com/lispyclouds))
|
||||
- Fix Alpine Linux Docker images in CI script [#1140](https://github.com/babashka/babashka/issues/1140) ([@kipz](https://github.com/kipz), [@lispyclouds](https://github.com/lispyclouds))
|
||||
- `babashka.fs`: create dirs in `copy-tree` ([@duzunov](https://github.com/duzunov))
|
||||
- SCI: fix order of metadata evaluation ([@erdos](https://github.com/erdos))
|
||||
- Fix: cannot take value of macro of `->`
|
||||
- Fix [#1144](https://github.com/babashka/babashka/issues/1144): cannot create multidimensional arrays
|
||||
- Fix [#1143](https://github.com/babashka/babashka/issues/1143): allow optional (ignored) `--` when using using `--main` ([@grzm](https://github.com/grzm))
|
||||
- SCI: throw when `recur` is used from non-tail position
|
||||
- Add more libraries to CI lib tests ([@cljwalker](https://github.com/cljwalker))
|
||||
- Upgrade several built-in deps: `org.clojure/clojure`, `cheshire`, `core.async`, `test.check`
|
||||
|
||||
## 0.7.3 (2021-12-30)
|
||||
|
||||
- Do not require java for bb tasks without deps [#1123](https://github.com/babashka/babashka/issues/1123), [#1124](https://github.com/babashka/babashka/issues/1124)
|
||||
|
||||
## 0.7.2 (2021-12-29)
|
||||
|
||||
- Add `spy` macro from `taoensso.timbre` [#1087](https://github.com/babashka/babashka/issues/1087)
|
||||
- Better error for higher order fn arity mismatch
|
||||
- Check `shasum` / `sha256sum` in `PATH` on install script ([@thiagokokada](https://github.com/thiagokokada))
|
||||
- Build arm64 docker image in CI [#1099](https://github.com/babashka/babashka/issues/1099) ([@cap10morgan](https://github.com/cap10morgan))
|
||||
- Upgrade to `edamame` v0.0.19
|
||||
- Load tasks and deps from other bb.edn file using `--config` and `--deps-root` options [#1110](https://github.com/babashka/babashka/issues/1110)
|
||||
- Uberscript improvements [#584](https://github.com/babashka/babashka/issues/584), [#1037](https://github.com/babashka/babashka/issues/1037)
|
||||
- Include native elements in printed stacktrace [#1105](https://github.com/babashka/babashka/issues/1105)
|
||||
- Missing error message when exception happens in REPL print [#1116](https://github.com/babashka/babashka/issues/1116)
|
||||
- Undeprecate `$` in babashka.process
|
||||
- Add lots of library tests to CI ([@cldwalker](https://github.com/cldwalker))
|
||||
- Release SNAPSHOT builds to
|
||||
[babashka-dev-builds](https://github.com/babashka/babashka-dev-builds/releases)
|
||||
(use only for testing)
|
||||
|
||||
## 0.7.0 (2021-12-10)
|
||||
|
||||
- Add compatibility with `clojure.spec.alpha`. See
|
||||
[babashka/spec.alpha](https://github.com/babashka/spec.alpha) and this [blog
|
||||
post](https://blog.michielborkent.nl/using-clojure-spec-alpha-with-babashka.html).
|
||||
- Add `to-array-2d`, `aclone`, `areduce` and `amap` ([@MrEbbinghaus](https://github.com/MrEbbinghaus))
|
||||
- Add `inst-ms`
|
||||
- Add `java.util.StringTokenizer`
|
||||
- `clojure.core/read` can read with `PushbackReader` that is not `LineNumberingPushbackReader`
|
||||
- Allow macroexpand on `for` and `doseq` ([@erdos](https://github.com/erdos))
|
||||
- Add `clojure.instant/read-instant-date`
|
||||
- Add `StackTraceElement->vec`
|
||||
- Add `memfn`
|
||||
- Implement Java field access (for `clojure.spec.alpha`)
|
||||
- Warn on requiring `clojure.spec.alpha`, suggesting to use [babashka/spec.alpha](https://github.com/babashka/spec.alpha)
|
||||
- Warn on requiring `clojure.core.specs.alpha`, suggesting to explicitly add it to deps
|
||||
- Deprecate `$` in babashka.process (still available, but no longer recommended)
|
||||
|
||||
## 0.6.8 (2021-12-02)
|
||||
|
||||
- Add `reader-conditional?`, `test`
|
||||
- Deps.clj: bump to tools jar `1.10.3.1040`
|
||||
- Babashka.process: support `deref` with timeout ([@SevereOverfl0w](https://github.com/SevereOverfl0w))
|
||||
- Add new functions from clojure 1.11 alpha 3 except `clojure.java.math`
|
||||
- nREPL server: catch `Throwable` instead of `Exception`, fixes hanging with `assert`
|
||||
|
||||
## 0.6.7 (2021-11-29)
|
||||
|
||||
Minor bugfix release:
|
||||
|
||||
- `print-deps` included `:local/root` dependency which is not valid outside babashka repo
|
||||
- `fs/which` edge case improvement on Windows [#1083](https://github.com/babashka/babashka/issues/1083)
|
||||
|
||||
## 0.6.6 (2021-11-29)
|
||||
|
||||
- Resolve program in `babashka.process` on Windows using known extensions. This
|
||||
means you can now invoke `(shell "yarn")` and it will work on both Unix-like
|
||||
systems and Windows.
|
||||
- Add `babashka.core` namespace with `windows?` predicate.
|
||||
- Add `fs/with-temp-dir` to `babashka.fs` ([@hugoduncan](https://github.com/hugoduncan))
|
||||
- Add `fs/home` and `fs/expand-home` to `babashka.fs` ([@Kineolyan](https://github.com/Kineolyan))
|
||||
- `clojure.core/read` improvements: support `:eof` + `:read-cond`
|
||||
- Add support `*read-eval*`, `*default-reader-fn*` and `*reader-resolver*` dynamic vars to be used with `clojure.core/read`.
|
||||
- Add `SQLITE` feature flag ([@nikvdp](https://github.com/nikvdp))
|
||||
- Add `javax.crypto.Mac` and `javax.crypto.spec.SecretKeySpec` classes to support development of [yaaws-api](https://github.com/grzm/yaaws-api) ([@grzm](https://github.com/grzm))
|
||||
- Add `java.net.Inet4Address` and `java.net.Inet6Address` classes
|
||||
- Fix `--version` option, don't read cp file. [#1071](https://github.com/babashka/babashka/issues/1071) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Add classes to support running the
|
||||
[xforms](https://github.com/cgrand/xforms) library from source:
|
||||
- `java.util.ArrayDeque`
|
||||
- `java.util.ArrayList`
|
||||
- `java.util.Collections`
|
||||
- `java.util.Comparator`
|
||||
- `java.util.NoSuchElementException`
|
||||
- `babashka.curl`: support `:as :bytes` option to download binary file
|
||||
- Add compatibility with [hato](https://github.com/gnarroway/hato) and
|
||||
[clj-http-lite](https://github.com/clj-commons/clj-http-lite) insecure feature
|
||||
by adding classes:
|
||||
- `java.net.CookiePolicy`
|
||||
- `java.net.http.HttpTimeoutException`
|
||||
- `javax.net.ssl.HostnameVerifier`
|
||||
- `javax.net.ssl.HttpsURLConnection`
|
||||
- `javax.net.ssl.KeyManagerFactory`
|
||||
- `javax.net.ssl.SSLSession`
|
||||
- `javax.net.ssl.TrustManagerFactory`
|
||||
- `java.security.KeyStore`
|
||||
- `java.util.zip.Inflater`
|
||||
- `java.util.zip.ZipException`
|
||||
|
||||
## 0.6.5 (2021-11-13)
|
||||
|
||||
- Compatibility with a [fork of
|
||||
tools.namespace](https://github.com/babashka/tools.namespace). This allows
|
||||
running the Cognitect
|
||||
[test-runner](https://github.com/cognitect-labs/test-runner) (Cognitest) from source.
|
||||
- Add various `tools.build` related classes for running parts of tools.build
|
||||
with bb ([@hugoduncan](https://github.com/hugoduncan)). Keep an eye on [this
|
||||
repo](https://github.com/babashka/tools.bbuild).
|
||||
- Deps.clj: upgrade tools jar, support checking manifest staleness (see [TDEPS-83](https://clojure.atlassian.net/browse/TDEPS-83))
|
||||
- Add `clojure.lang.IPersistentList` ([@FieryCod](https://github.com/FieryCod))
|
||||
- The [contajners](https://github.com/lispyclouds/contajners) library is now compatible with babashka
|
||||
- Support `Object` `toString` override on defrecords [#999](https://github.com/babashka/babashka/issues/999).
|
||||
- Bump to GraalVM 21.3.0 JVM 11
|
||||
- Bump `core.async` to `1.4.627`
|
||||
- Bump edamame to `v0.0.14`, fixes parsing of `foo@bar`
|
||||
- Fix segfault when reifying `FileVisitor` with `visitFileFailed` [#1055](https://github.com/babashka/babashka/issues/1055)
|
||||
- Add `PGProperty` fields to reflection config (fix for postgres feature flag) [#1046](https://github.com/babashka/babashka/issues/1046) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Fix for `babashka.fs/unzip` when entry in dir comes before dir in entries
|
||||
- Calling `.close` on `DirectoryStream` fails [#1061](https://github.com/babashka/babashka/issues/1061)
|
||||
- Add support for `java.nio.file.attribute.BasicFileAttributes`
|
||||
|
||||
## 0.6.4
|
||||
|
||||
- Fix for `DEPS_CLJ_TOOLS_VERSION` introduced in deps.clj bundled in 0.6.3
|
||||
|
||||
## 0.6.3
|
||||
|
||||
- Add `java.security.Provider` and `java.security.Security`. This adds compatibility with [clj-commons/digest](https://github.com/clj-commons/digest).
|
||||
- Fix mapping for `babashka.fs/unzip` [#1030](https://github.com/babashka/babashka/issues/1030)
|
||||
- Pods: support metadata in pod vars, like docstrings ([@quoll](https://github.com/quoll))
|
||||
- babashka.curl: support `:follow-redirects false` ([@sudorock](https://github.com/sudorock))
|
||||
- Add support for `--init` as a file to be loaded before evaluation actions [#1033](https://github.com/babashka/babashka/issues/1033) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Bump rewrite-clj to v1.0.699-alpha ([@yannvanhalewyn](https://github.com/yannvanhalewyn))
|
||||
- Fix `BABASHKA_FEATURE_POSTGRESQL` feature flag, initialize `java.sql.SQLException` build time [#1040](https://github.com/babashka/babashka/issues/1040)
|
||||
- Deps.clj: upgrade to tools version `1.10.3.998` and include new
|
||||
`DEPS_CLJ_TOOLS_VERSION` environment variable to use older or newer tools jar.
|
||||
|
||||
## 0.6.2
|
||||
|
||||
- Add `java.util.zip.ZipFile`, `java.util.stream.BaseStream`
|
||||
- Fix data reader for clojure.data.xml and `*input*` [#1004](https://github.com/babashka/babashka/issues/1004) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Upgrade `deps.clj` (matches clojure CLI `1.10.986`)
|
||||
- Print locals only when debug option is enabled [#1015](https://github.com/babashka/babashka/issues/1015)
|
||||
|
||||
### SCI:
|
||||
|
||||
- Fix order of protocol handling wrt/ `extend-type`, `defrecord` and `:extend-via-metadata`
|
||||
|
||||
### babashka.curl:
|
||||
|
||||
- Support keywords as query and form param keys ([@lispyclouds](https://github.com/lispyclouds))
|
||||
|
||||
### babashka.nrepl:
|
||||
|
||||
- Fix hanging CIDER [#45](https://github.com/babashka/babashka.nrepl/issues/45)
|
||||
|
||||
### babashka.fs:
|
||||
|
||||
- Add `fs/unzip`
|
||||
|
||||
## 0.6.1
|
||||
|
||||
- Fix for `java-http-clj` `send-async` [#997](https://github.com/babashka/babashka/issues/997)
|
||||
- Add `PipedInput/OutputStream` [#1001](https://github.com/babashka/babashka/issues/1001)
|
||||
- `aarch64` static binaries are compiled with `"-H:+StaticExecutableWithDynamicLibC"`
|
||||
|
||||
SCI:
|
||||
|
||||
- Self-referential function returns wrong binding in presence of laziness
|
||||
[#1006](https://github.com/babashka/babashka/issues/1006)
|
||||
|
||||
## 0.6.0
|
||||
|
||||
- Support for `java.net` HTTP Client. This enables running
|
||||
[java-http-clj](https://github.com/schmee/java-http-clj) from source. The raw
|
||||
interop is the first part of a multi-stage plan to move all http related
|
||||
scripting towards `java.net.http` in favor of the other two solutions
|
||||
currently available in `bb`: `babashka.curl` and `org.httpkit.client`. ([@grzm](https://github.com/grzm))
|
||||
- Add `*print-readably*` and `*flush-on-newline*` [#959](https://github.com/babashka/babashka/issues/959)
|
||||
- Support `:clojure.core/eval-file metadata` [#960](https://github.com/babashka/babashka/issues/960)
|
||||
- Add `clojure.data.xml/alias-uri` [#995](https://github.com/babashka/babashka/issues/995)
|
||||
- Make REPL requires available in expression on command line [#972](https://github.com/babashka/babashka/issues/972) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Fix docstrings and metadata for large number of vars [#957](https://github.com/babashka/babashka/issues/957) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Upgrade `deps.clj` / `tools.jar` to match Clojure CLI 1.10.3.967
|
||||
- Add (limited) support for `java.lang.reflect.Method` (`getName` only) [#969](https://github.com/babashka/babashka/issues/969)
|
||||
- Use tagged-literal for unknown tags when reading EDN via `*input*` [#975](https://github.com/babashka/babashka/issues/975) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Logging feature flag and `tools.logging.readable` [#981](https://github.com/babashka/babashka/issues/981) ([@bobisageek](https://github.com/bobisageek))
|
||||
- Migrate GraalVM config to uberjar [#973](https://github.com/babashka/babashka/issues/973) ([@ericdallo](https://github.com/ericdallo))
|
||||
- Upgrade to GraalVM 21.2.0
|
||||
|
||||
## 0.5.1
|
||||
|
||||
- Add new `print-deps` subcommand for printing a `deps.edn` map and classpath
|
||||
which includes all built-in deps. This can be used for editor tooling like
|
||||
Cursive and clojure-lsp, but also for migrating a babashka project to a Graal
|
||||
native-image project.
|
||||
- Upgrade `clj-yaml` to 0.7.107 which adds two new vars: `generate-stream`, `parse-stream`
|
||||
- Add `timbre/merge-config!`
|
||||
- Add `strip-ext` to `babashka.fs` ([@corasaurus-hex](https://github.com/corasaurus-hex))
|
||||
- Fixed: `with-open` fails on `java.io.PrintWriter` [#953](https://github.com/babashka/babashka/issues/953)
|
||||
- Upgrade `deps.clj` to match Clojure CLI `1.10.3.933`
|
||||
- Upgrade several other deps
|
||||
- Add `timbre/merge-config!`
|
||||
|
||||
## 0.5.0
|
||||
|
||||
|
|
@ -1029,7 +113,7 @@ Babashka.pods:
|
|||
- 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)
|
||||
|
||||
## 0.4.0 (2021-05-08)
|
||||
## 0.4.0
|
||||
|
||||
Babashka proper:
|
||||
|
||||
|
|
@ -1039,7 +123,7 @@ Babashka proper:
|
|||
[jasentaa](https://github.com/rm-hull/jasentaa) parser combinator library
|
||||
- Update Selmer to 1.12.40
|
||||
|
||||
SCI:
|
||||
Sci:
|
||||
|
||||
- Better error msg for protocol not found or class
|
||||
|
||||
|
|
@ -1609,14 +693,6 @@ Details about releases prior to v0.1.0 can be found
|
|||
|
||||
## 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
|
||||
|
||||
- Remove cheshire smile functions [#658](https://github.com/babashka/babashka/issues/658)
|
||||
|
|
|
|||
38
Dockerfile
38
Dockerfile
|
|
@ -1,29 +1,16 @@
|
|||
FROM clojure:openjdk-11-lein-2.9.6-bullseye AS BASE
|
||||
FROM clojure:lein-2.9.1 AS BASE
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt update
|
||||
RUN apt install --no-install-recommends -yy build-essential zlib1g-dev
|
||||
RUN apt install --no-install-recommends -yy curl unzip build-essential zlib1g-dev sudo
|
||||
WORKDIR "/opt"
|
||||
|
||||
ENV GRAALVM_VERSION="24"
|
||||
ARG TARGETARCH
|
||||
# Do not set those directly, use TARGETARCH instead
|
||||
ENV BABASHKA_ARCH=
|
||||
ENV GRAALVM_ARCH=
|
||||
RUN if [ "${TARGETARCH}" = "" ] || [ "${TARGETARCH}" = "amd64" ]; then \
|
||||
export GRAALVM_ARCH=x64; export BABASHKA_ARCH=x86_64; \
|
||||
elif [ "${TARGETARCH}" = "arm64" ]; then \
|
||||
export GRAALVM_ARCH=aarch64; \
|
||||
fi && \
|
||||
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 && \
|
||||
mkdir "graalvm-$GRAALVM_VERSION" && \
|
||||
tar -xzf graalvm-jdk-${GRAALVM_VERSION}_linux-${GRAALVM_ARCH}_bin.tar.gz -C graalvm-$GRAALVM_VERSION --strip-components 1
|
||||
RUN curl -sLO https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.1.0/graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
RUN tar -xzf graalvm-ce-java11-linux-amd64-21.1.0.tar.gz
|
||||
|
||||
ARG BABASHKA_XMX="-J-Xmx4500m"
|
||||
|
||||
ENV GRAALVM_HOME="/opt/graalvm-$GRAALVM_VERSION"
|
||||
ENV JAVA_HOME="$GRAALVM_HOME/bin"
|
||||
ENV GRAALVM_HOME="/opt/graalvm-ce-java11-21.1.0"
|
||||
ENV JAVA_HOME="/opt/graalvm-ce-java11-21.1.0/bin"
|
||||
ENV PATH="$JAVA_HOME:$PATH"
|
||||
ENV BABASHKA_XMX=$BABASHKA_XMX
|
||||
|
||||
|
|
@ -31,11 +18,11 @@ ENV BABASHKA_XMX=$BABASHKA_XMX
|
|||
# by setting them at build time via `docker build --build-arg ARG_NAME=true ...`
|
||||
ARG BABASHKA_LEAN=
|
||||
ARG BABASHKA_MUSL=
|
||||
ARG BABASHKA_FEATURE_CORE_ASYNC=
|
||||
ARG BABASHKA_FEATURE_CSV=
|
||||
ARG BABASHKA_FEATURE_JAVA_NET_HTTP=
|
||||
ARG BABASHKA_FEATURE_JAVA_NIO=
|
||||
ARG BABASHKA_FEATURE_JAVA_TIME=
|
||||
ARG BABASHKA_FEATURE_TRANSIT=
|
||||
ARG BABAHSKA_FEATURE_TRANSIT=
|
||||
ARG BABASHKA_FEATURE_XML=
|
||||
ARG BABASHKA_FEATURE_YAML=
|
||||
ARG BABASHKA_FEATURE_HTTPKIT_CLIENT=
|
||||
|
|
@ -48,11 +35,11 @@ ARG BABASHKA_FEATURE_DATASCRIPT=
|
|||
ARG BABASHKA_FEATURE_LANTERNA=
|
||||
ARG BABASHKA_STATIC=
|
||||
ENV BABASHKA_LEAN=$BABASHKA_LEAN
|
||||
ENV BABASHKA_FEATURE_CORE_ASYNC=$BABASHKA_FEATURE_CORE_ASYNC
|
||||
ENV BABASHKA_FEATURE_CSV=$BABASHKA_FEATURE_CSV
|
||||
ENV BABASHKA_FEATURE_JAVA_NET_HTTP=$BABASHKA_FEATURE_JAVA_NET_HTTP
|
||||
ENV BABASHKA_FEATURE_JAVA_NIO=$BABASHKA_FEATURE_JAVA_NIO
|
||||
ENV BABASHKA_FEATURE_JAVA_TIME=$BABASHKA_FEATURE_JAVA_TIME
|
||||
ENV BABASHKA_FEATURE_TRANSIT=$BABASHKA_FEATURE_TRANSIT
|
||||
ENV BABAHSKA_FEATURE_TRANSIT=$BABAHSKA_FEATURE_TRANSIT
|
||||
ENV BABASHKA_FEATURE_XML=$BABASHKA_FEATURE_XML
|
||||
ENV BABASHKA_FEATURE_YAML=$BABASHKA_FEATURE_YAML
|
||||
ENV BABASHKA_FEATURE_HTTPKIT_CLIENT=$BABASHKA_FEATURE_HTTPKIT_CLIENT
|
||||
|
|
@ -73,9 +60,6 @@ RUN ./script/compile
|
|||
|
||||
FROM ubuntu:latest
|
||||
RUN apt-get update && apt-get install -y curl \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /usr/local/bin
|
||||
|
||||
COPY --from=BASE /opt/target/metabom.jar /opt/babashka-metabom.jar
|
||||
&& mkdir -p /usr/local/bin
|
||||
COPY --from=BASE /opt/bb /usr/local/bin/bb
|
||||
CMD ["bb"]
|
||||
|
|
|
|||
|
|
@ -4,20 +4,15 @@ COPY bb /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 && \
|
||||
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
|
||||
|
||||
# TODO: Run actual native tests when they are ported
|
||||
|
||||
RUN curl --version
|
||||
# RUN bb -e '(prn (java.io.File/createTempFile "babashka.curl" ".headers"))'
|
||||
# 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 "(curl/get \"https://httpstat.us/200\")" # cURL http test
|
||||
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 "(.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
|
||||
|
||||
|
|
@ -26,10 +21,9 @@ FROM alpine:3
|
|||
|
||||
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 && \
|
||||
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
|
||||
|
||||
COPY metabom.jar /opt/babashka-metabom.jar
|
||||
COPY --from=tester /bin/bb /bin/bb
|
||||
|
||||
CMD ["bb"]
|
||||
|
|
|
|||
|
|
@ -2,14 +2,9 @@ FROM ubuntu:latest
|
|||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y curl \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p /usr/local/bin
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG TARGETOS
|
||||
|
||||
COPY metabom.jar /opt/babashka-metabom.jar
|
||||
COPY ${TARGETOS}/${TARGETARCH}/bb /usr/local/bin/bb
|
||||
COPY bb /usr/local/bin/bb
|
||||
|
||||
RUN chmod +x /usr/local/bin/bb
|
||||
|
||||
|
|
|
|||
259
README.md
259
README.md
|
|
@ -1,10 +1,9 @@
|
|||
[<img src="logo/babashka.svg" alt="Babashka" width="425px">](https://babashka.org)
|
||||
<img src="logo/babashka.svg" width="425px">
|
||||
|
||||
[](https://circleci.com/gh/babashka/babashka/tree/master)
|
||||
[](https://app.slack.com/client/T03RZGPFR/CLX41ASCS)
|
||||
[](https://opencollective.com/babashka) [](https://clojars.org/babashka/babashka)
|
||||
[](https://twitter.com/search?q=%23babashka&src=typed_query&f=live)
|
||||
[](https://book.babashka.org) [](https://gurubase.io/g/babashka)
|
||||
|
||||
<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>
|
||||
|
|
@ -34,16 +33,17 @@ As one user described it:
|
|||
|
||||
### Non-goals
|
||||
|
||||
* Performance
|
||||
* Provide a mixed Clojure/Bash DSL (see portability).
|
||||
* Replace existing shells. Babashka is a tool you can use inside existing shells like bash and it is designed to play well with them. It does not aim to replace them.
|
||||
|
||||
## Quickstart
|
||||
|
||||
For installation options check [Installation](https://github.com/babashka/babashka#installation).
|
||||
For quick installation using `bash`, use:
|
||||
For quick installation use:
|
||||
|
||||
``` 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
|
||||
|
|
@ -53,51 +53,23 @@ anywhere on the path.
|
|||
Then you're ready to go:
|
||||
|
||||
``` 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
|
||||
```
|
||||
### Babashka users
|
||||
|
||||
## Support :heart:
|
||||
Are you using babashka in your company or personal projects? Let us know [here](https://github.com/babashka/babashka/issues/254).
|
||||
|
||||
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/).
|
||||
### Setting expectations
|
||||
|
||||
<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
|
||||
|
||||
See [companies](doc/companies.md) for a list of companies using babashka.
|
||||
|
||||
Are you using babashka in your company or personal projects? Let us know
|
||||
[here](https://github.com/babashka/babashka/issues/254).
|
||||
|
||||
## Setting expectations
|
||||
|
||||
Babashka uses [SCI](https://github.com/borkdude/sci) for interpreting
|
||||
Clojure. SCI implements a substantial subset of Clojure. Interpreting code is in
|
||||
Babashka uses [sci](https://github.com/borkdude/sci) for interpreting
|
||||
Clojure. Sci implements a substantial subset of Clojure. Interpreting code is in
|
||||
general not as performant as executing compiled code. If your script takes more
|
||||
than a few seconds to run or has lots of loops, Clojure on the JVM may be a
|
||||
better fit as the performance on JVM is going to outweigh its startup time
|
||||
penalty. Read more about the differences with Clojure
|
||||
better fit as the performance on JVM is going to outweigh its
|
||||
startup time penalty. Read more about the differences with Clojure
|
||||
[here](#differences-with-clojure).
|
||||
|
||||
## Status
|
||||
|
|
@ -107,7 +79,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
|
||||
[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)):
|
||||
|
||||
|
|
@ -118,10 +90,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
|
||||
about how to get the most out of babashka scripting.
|
||||
|
||||
There is also the book [Babashka Babooka](https://www.braveclojure.com/quests/babooka/),
|
||||
by Daniel Higginbotham, who has also helped a lot of people learn Clojure with
|
||||
[Clojure for the Brave and
|
||||
True](https://www.braveclojure.com/clojure-for-the-brave-and-true/).
|
||||
## Examples
|
||||
|
||||
Read the output from a shell command as a lazy seq of strings:
|
||||
|
||||
``` 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
|
||||
|
||||
|
|
@ -142,30 +148,6 @@ Upgrade:
|
|||
|
||||
brew upgrade babashka
|
||||
|
||||
### Nix
|
||||
|
||||
Linux and macOS (including ARM Macs) binaries are provided via nix (see the installation instructions for nix [here](https://nixos.org/download.html)).
|
||||
|
||||
Install:
|
||||
|
||||
# Adding `nixpkgs-unstable` channel for more up-to-date binaries, skip this if you already have `nixpkgs-unstable` in your channel list
|
||||
nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
|
||||
nix-channel --update
|
||||
nix-env -iA nixpkgs-unstable.babashka
|
||||
|
||||
Upgrade:
|
||||
|
||||
nix-channel --update
|
||||
nix-env -iA nixpkgs-unstable.babashka
|
||||
|
||||
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)
|
||||
|
||||
`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,29 +157,15 @@ linux binary.
|
|||
|
||||
### 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:
|
||||
|
||||
asdf plugin add babashka https://github.com/pitch-io/asdf-babashka
|
||||
asdf plugin add babashka
|
||||
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
|
||||
|
||||
#### Scoop
|
||||
|
||||
On Windows you can install using [scoop](https://scoop.sh/) and the
|
||||
[scoop-clojure](https://github.com/littleli/scoop-clojure) bucket.
|
||||
|
||||
|
|
@ -212,28 +180,12 @@ scoop bucket add extras
|
|||
scoop install babashka
|
||||
```
|
||||
|
||||
#### Manual
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
Install via the installer script for linux and macOS:
|
||||
Install via the installer script:
|
||||
|
||||
``` shell
|
||||
$ 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
|
||||
$ ./install
|
||||
```
|
||||
|
|
@ -282,12 +234,6 @@ You may also download a binary from
|
|||
[Github](https://github.com/babashka/babashka/releases). For linux there is a
|
||||
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
|
||||
|
||||
Check out the image on [Docker hub](https://hub.docker.com/r/babashka/babashka/).
|
||||
|
|
@ -300,33 +246,17 @@ Check out the [news](doc/news.md) page to keep track of babashka-related news it
|
|||
|
||||
Go [here](https://book.babashka.org/#built-in-namespaces) to see the full list of built-in namespaces.
|
||||
|
||||
## [Compatible Projects](doc/projects.md)
|
||||
## [Projects](doc/projects.md)
|
||||
|
||||
A list of projects (scripts, libraries, pods and tools) known to work with babashka.
|
||||
|
||||
## Badges
|
||||
|
||||
[](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.
|
||||
|
||||
[](https://book.babashka.org#badges)
|
||||
The babashka built-in badge means that a library has been built directly into babashka and requires no extra dependencies to use it.
|
||||
If this rare honor belongs to your library, you should display this badge.
|
||||
|
||||
See [the babashka book for details](https://book.babashka.org#badges).
|
||||
|
||||
## Swag
|
||||
|
||||
- [t-shirt](https://www.etsy.com/listing/1241766068/babashka-clj-kondo-nbb-shirt)
|
||||
|
||||
## [Pods](https://github.com/babashka/babashka.pods)
|
||||
|
||||
Pods are programs that can be used as a Clojure library by
|
||||
babashka. Documentation is available in the [pod library
|
||||
repo](https://github.com/babashka/pods).
|
||||
repo](https://github.com/babashka/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
|
||||
|
||||
|
|
@ -368,38 +298,6 @@ handling of SIGINT and SIGPIPE. This can be done by setting
|
|||
|
||||
## 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
|
||||
- [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
|
||||
- [Babashka CLI](https://blog.michielborkent.nl/babashka-cli.html): turn Clojure functions into CLIs!
|
||||
- [Breakneck Babashka on K8s](https://www.linkedin.com/pulse/breakneck-babashka-k8s-heow-goodman/) by Heow Goodman
|
||||
- [Recursive document transformations with Pandoc and Clojure](https://play.teod.eu/document-transform-pandoc-clojure/)
|
||||
- [Detecting inconsistent aliases in a clojure codebase](https://www.youtube.com/watch?v=bf8KLKkCH2g) by Oxalorg
|
||||
- [I, too, Wrote Myself a Static Site Generator](https://dawranliou.com/blog/i-too-wrote-myself-a-static-site-generator/) by Daw-Ran Liou
|
||||
- [Babashka and Clojure](https://youtu.be/ZvOs5Ele6VE) by Rahul Dé at North Virginia Linux Users Group
|
||||
- [Create a password manager with Clojure using Babashka, sqlite, honeysql and stash](https://youtu.be/jm0RXmyjRJ8) by Daniel Amber
|
||||
- [Writing Clojure-living-cookbooks](https://www.loop-code-recur.io/live-clojure-cookbooks) by Cyprien Pannier
|
||||
- [Using babashka with PHP](https://blog.michielborkent.nl/using-babashka-with-php.html) by Michiel Borkent
|
||||
- [Moldable Emacs: a Clojure Playground with Babashka](https://ag91.github.io/blog/2021/11/05/moldable-emacs-a-clojure-playground-with-babashka/) by Andrea
|
||||
- [Finding my inner Wes Anderson with #Babashka](https://javahippie.net/clojure/2021/10/18/finding-my-inner-wes-anderson.html) by Tim Zöller
|
||||
- [Awesome Babashka: Parse & produce HTML and SQLite](https://blog.jakubholy.net/2021/awesome-babashka-dash/) by Jakub Holý
|
||||
- [Babashka tasks](https://youtu.be/u5ECoR7KT1Y), talk by Michiel Borkent
|
||||
- [Rewriting a clojure file with rewrite-clj and babashka](https://youtu.be/b7NPKsm8gkc), video by Oxalorg
|
||||
- [Integrating Babashka into Bazel](https://timjaeger.io/20210627-integrating-babashka-with-bazel.html) by Tim Jäger
|
||||
- [Talk](https://youtu.be/Yjeh57eE9rg): Babashka: a native Clojure interpreter for scripting — The 2021 Graal Workshop at CGO
|
||||
- [Blog](https://savo.rocks/posts/playing-new-music-on-old-car-stereo-with-clojure-and-babashka/): Playing New Music On Old Car Stereo With Clojure And Babashka
|
||||
|
|
@ -443,7 +341,7 @@ binary, these evaluation criteria are considered:
|
|||
- The library cannot be interpreted by with babashka using `--classpath`.
|
||||
- The functionality can't be met by shelling out to another CLI or can't be
|
||||
written as a small layer over an existing CLI (like `babashka.curl`) instead.
|
||||
- The library cannot be implemented as a
|
||||
- The library cannot be implemented a
|
||||
[pod](https://github.com/babashka/babashka.pods).
|
||||
|
||||
If not all of the criteria are met, but adding a feature is still useful to a
|
||||
|
|
@ -469,10 +367,47 @@ commit](https://github.com/babashka/babashka/commit/02c7c51ad4b2b1ab9aa95c26a744
|
|||
|
||||
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
|
||||
- [Nikita Prokopov](https://github.com/tonsky) for the logo
|
||||
- [Contributors](https://github.com/babashka/babashka/graphs/contributors) and
|
||||
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
|
||||
|
||||
|
|
|
|||
35
appveyor.yml
35
appveyor.yml
|
|
@ -2,20 +2,15 @@
|
|||
|
||||
version: "v-{build}"
|
||||
|
||||
image: Visual Studio 2022
|
||||
image: Visual Studio 2017
|
||||
|
||||
clone_folder: C:\projects\babashka
|
||||
|
||||
environment:
|
||||
GRAALVM_HOME: C:\projects\babashka\graalvm\graalvm-jdk-24+36.1
|
||||
JAVA_HOME: C:\projects\babashka\graalvm\graalvm-jdk-24+36.1
|
||||
GRAALVM_HOME: C:\projects\babashka\graalvm\graalvm-ce-java11-21.1.0
|
||||
JAVA_HOME: C:\projects\babashka\graalvm\graalvm-ce-java11-21.1.0
|
||||
BABASHKA_XMX: "-J-Xmx5g"
|
||||
|
||||
skip_commits:
|
||||
files:
|
||||
- "logo/*"
|
||||
- "**/*.md"
|
||||
|
||||
cache:
|
||||
- C:\ProgramData\chocolatey\lib -> project.clj, appveyor.yml
|
||||
- '%USERPROFILE%\.m2 -> project.clj'
|
||||
|
|
@ -23,9 +18,6 @@ cache:
|
|||
|
||||
clone_script:
|
||||
- cmd: git config --global core.autocrlf true
|
||||
|
||||
- cmd: git config --global core.symlinks true
|
||||
|
||||
- ps: >-
|
||||
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
|
||||
|
|
@ -39,12 +31,9 @@ clone_script:
|
|||
}
|
||||
- cmd: git submodule update --init --recursive
|
||||
|
||||
- cmd: git reset --hard
|
||||
|
||||
build_script:
|
||||
# TODO: Extract the zip by removing the top level folder to remove the hardcoded path for GRAALVM_HOME
|
||||
- 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-21.1.0/graalvm-ce-java11-windows-amd64-21.1.0.zip', 'graalvm.zip') }"
|
||||
|
||||
powershell -Command "if (Test-Path('graalvm')) { return } else { Expand-Archive graalvm.zip graalvm }"
|
||||
|
||||
|
|
@ -61,7 +50,7 @@ build_script:
|
|||
# see https://github.com/quarkusio/quarkus/pull/7663
|
||||
|
||||
- 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
|
||||
|
||||
|
|
@ -73,19 +62,19 @@ build_script:
|
|||
|
||||
jar -cMf %zip% bb.exe
|
||||
|
||||
bb --config .build/bb.edn --deps-root . release-artifact %zip%
|
||||
set BABASHKA_EDN=.build/bb.edn
|
||||
|
||||
bb release-artifact %zip%
|
||||
|
||||
set BABASHKA_EDN=
|
||||
|
||||
before_test:
|
||||
- cmd: >-
|
||||
set BABASHKA_CLASSPATH=
|
||||
|
||||
set BABASHKA_TEST_ENV=native
|
||||
|
||||
test_script:
|
||||
- cmd: >-
|
||||
call script/test.bat :windows
|
||||
call script/test.bat
|
||||
|
||||
call script/run_lib_tests.bat
|
||||
# call script/run_lib_tests.bat
|
||||
|
||||
artifacts:
|
||||
- path: babashka-*-windows-amd64.zip
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 52a6037bd4b632bffffb04394fb4efd0cdab6b1e
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit e936acd40544eb637b6041c7e89454b21eb7ee34
|
||||
Subproject commit cf71c8ae24a4f8ec85663970f4b8a3f63a0c1a6b
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit edd3d613bfb9bf3adabfd0bda5c3f5c6ee85ec20
|
||||
Subproject commit bd1ce0cbc0861350a4a36e9c31ef79fa0c7cff84
|
||||
2
deps.clj
2
deps.clj
|
|
@ -1 +1 @@
|
|||
Subproject commit 976cf7b0e54901ada3f7e83f12a4c0aed039adc9
|
||||
Subproject commit 985e5ca7f9cb123f86a0747aded1ee98e1f3deee
|
||||
188
deps.edn
188
deps.edn
|
|
@ -1,4 +1,4 @@
|
|||
{:paths ["src" "feature-xml"
|
||||
{:paths ["src" "feature-xml" "feature-core-async"
|
||||
"feature-yaml" "feature-csv" "feature-transit"
|
||||
"feature-java-time" "feature-java-nio"
|
||||
"feature-httpkit-client" "feature-httpkit-server"
|
||||
|
|
@ -7,52 +7,39 @@
|
|||
"feature-hiccup"
|
||||
"feature-test-check"
|
||||
"feature-spec-alpha"
|
||||
"feature-rewrite-clj"
|
||||
"feature-selmer"
|
||||
"feature-logging"
|
||||
"feature-priority-map"
|
||||
"feature-rrb-vector"
|
||||
"feature-jdbc"
|
||||
"pods/src"
|
||||
"babashka.nrepl/src"
|
||||
"depstar/src" "process/src"
|
||||
"deps.clj/src" "deps.clj/resources"
|
||||
"resources" "sci/resources"
|
||||
"impl-java/src"],
|
||||
:deps {org.clojure/clojure {:mvn/version "1.12.0"},
|
||||
org.babashka/sci {:local/root "sci"}
|
||||
org.babashka/babashka.impl.java {:mvn/version "0.1.10"}
|
||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||
"resources" "sci/resources"],
|
||||
:deps {org.clojure/clojure {:mvn/version "1.11.0-alpha1"},
|
||||
borkdude/sci {:local/root "sci"}
|
||||
babashka/babashka.curl {:local/root "babashka.curl"}
|
||||
babashka/fs {:local/root "fs"}
|
||||
babashka/babashka.core {:local/root "babashka.core"}
|
||||
org.clojure/core.async {:mvn/version "1.8.741"},
|
||||
org.clojure/tools.cli {:mvn/version "1.0.214"},
|
||||
borkdude/graal.locking {:mvn/version "0.0.2"},
|
||||
org.clojure/core.async {:mvn/version "1.3.618"},
|
||||
org.clojure/tools.cli {:mvn/version "1.0.206"},
|
||||
org.clojure/data.csv {:mvn/version "1.0.0"},
|
||||
cheshire/cheshire {:mvn/version "6.0.0"}
|
||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha8"}
|
||||
clj-commons/clj-yaml {:mvn/version "1.0.29"}
|
||||
com.cognitect/transit-clj {:mvn/version "1.0.333"}
|
||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||
nrepl/bencode {:mvn/version "1.2.0"}
|
||||
cheshire/cheshire {:mvn/version "5.10.1"}
|
||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha6"}
|
||||
clj-commons/clj-yaml {:mvn/version "0.7.107"}
|
||||
com.cognitect/transit-clj {:mvn/version "1.0.324"}
|
||||
org.clojure/test.check {:mvn/version "1.1.0"}
|
||||
nrepl/bencode {:mvn/version "1.1.0"}
|
||||
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
||||
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
||||
org.hsqldb/hsqldb {:mvn/version "2.5.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.5.3"}
|
||||
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
||||
org.clojure/core.match {:mvn/version "1.0.0"}
|
||||
hiccup/hiccup {:mvn/version "2.0.0-RC1"}
|
||||
rewrite-clj/rewrite-clj {:mvn/version "1.1.49"}
|
||||
selmer/selmer {:mvn/version "1.12.59"}
|
||||
com.taoensso/timbre {:mvn/version "6.6.0"}
|
||||
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
||||
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
||||
insn/insn {:mvn/version "0.5.2"}
|
||||
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
||||
org.babashka/cli {:mvn/version "0.8.65"}
|
||||
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"}}
|
||||
hiccup/hiccup {:mvn/version "2.0.0-alpha2"}
|
||||
rewrite-clj/rewrite-clj {:mvn/version "1.0.644-alpha"}
|
||||
selmer/selmer {:mvn/version "1.12.44"}
|
||||
com.taoensso/timbre {:mvn/version "5.1.2"}
|
||||
org.clojure/tools.logging {:mvn/version "1.1.0"}}
|
||||
:aliases {:babashka/dev
|
||||
{:main-opts ["-m" "babashka.main"]}
|
||||
:profile
|
||||
|
|
@ -63,14 +50,19 @@
|
|||
"-Dclojure.compiler.direct-linking=true"]
|
||||
:main-opts ["-m" "babashka.profile"]}
|
||||
: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"}
|
||||
#_#_org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
||||
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
||||
lambdaisland/regal {:mvn/version "0.0.143"}
|
||||
{:extra-paths ["process/src" "process/test"]
|
||||
:extra-deps {babashka/clj-http-lite
|
||||
{:git/url "https://github.com/babashka/clj-http-lite"
|
||||
:sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}
|
||||
borkdude/spartan.spec {:git/url "https://github.com/borkdude/spartan.spec"
|
||||
:sha "16f7eec4b6589c77c96c9fcf989f78fffcee7c4c"}
|
||||
lambdaisland/regal {:git/url "https://github.com/lambdaisland/regal"
|
||||
:sha "f902d2c43121f9e1c48603d6eb99f5900eb6a9f6"}
|
||||
weavejester/medley {:git/url "https://github.com/weavejester/medley"
|
||||
:sha "a4e5fb5383f5c0d83cb2d005181a35b76d8a136d"}
|
||||
cprop/cprop {:mvn/version "0.1.16"}
|
||||
comb/comb {:mvn/version "0.1.1"}
|
||||
mvxcvi/arrangement {:mvn/version "2.0.0"}
|
||||
mvxcvi/arrangement {:mvn/version "1.2.0"}
|
||||
org.clojure/data.zip {:mvn/version "1.0.0"}
|
||||
clojure-csv/clojure-csv {:mvn/version "2.0.2"}
|
||||
org.clojure/math.combinatorics {:mvn/version "0.1.6"}
|
||||
|
|
@ -78,121 +70,27 @@
|
|||
henryw374/cljc.java-time
|
||||
{:git/url "https://github.com/henryw374/cljc.java-time.git"
|
||||
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}
|
||||
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
|
||||
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.1"}
|
||||
aero/aero {:mvn/version "1.1.6"}
|
||||
org.clojure/data.generators {:mvn/version "1.0.0"}
|
||||
honeysql/honeysql {:mvn/version "1.0.461"}
|
||||
com.github.seancorfield/honeysql {:mvn/version "2.2.840"}
|
||||
minimallist/minimallist {:mvn/version "0.0.10"}
|
||||
circleci/bond {:mvn/version "0.6.0"}
|
||||
version-clj/version-clj {:mvn/version "2.0.2"}
|
||||
honeysql/honeysql {:mvn/version "1.0.444"}
|
||||
com.github.seancorfield/honeysql {:mvn/version "2.0.0-rc2"}
|
||||
minimallist/minimallist {:mvn/version "0.0.6"}
|
||||
circleci/bond {:mvn/version "0.4.0"}
|
||||
version-clj/version-clj {:mvn/version "2.0.1"}
|
||||
gaka/gaka {:mvn/version "0.3.0"}
|
||||
failjure/failjure {:mvn/version "2.2.0"}
|
||||
failjure/failjure {:mvn/version "2.1.1"}
|
||||
io.helins/binf {:mvn/version "1.1.0-beta0"}
|
||||
rm-hull/jasentaa {:mvn/version "0.2.5"}
|
||||
slingshot/slingshot {:mvn/version "0.12.2"}
|
||||
io.replikativ/hasch {:mvn/version "0.3.7"}
|
||||
com.grammarly/omniconf {:mvn/version "0.4.3"}
|
||||
crispin/crispin {:mvn/version "0.3.8"}
|
||||
org.clojure/data.json {:mvn/version "2.4.0"}
|
||||
clj-commons/multigrep {:mvn/version "0.5.0"}
|
||||
amperity/vault-clj {:mvn/version "1.0.4"}
|
||||
java-http-clj/java-http-clj {:mvn/version "0.4.3"}
|
||||
com.stuartsierra/component {:mvn/version "1.0.0"}
|
||||
org.clojars.askonomm/ruuter {:mvn/version "1.2.2"}
|
||||
org.clj-commons/digest {:mvn/version "1.4.100"}
|
||||
hato/hato {:mvn/version "0.8.2"}
|
||||
better-cond/better-cond {:mvn/version "2.1.1"}
|
||||
org.clojure/core.specs.alpha {:mvn/version "0.2.62"}
|
||||
reifyhealth/specmonstah {:git/url "https://github.com/reifyhealth/specmonstah", :sha "a2b357009a3aa99a0c2d2361f3bbcd0b0e36505e"}
|
||||
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
||||
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
||||
expound/expound {:mvn/version "0.8.10"}
|
||||
integrant/integrant {:git/url "https://github.com/weavejester/integrant", :git/sha "a9fd7c02bd7201f36344b47142badc3c3ef22f88"}
|
||||
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
||||
listora/again {:mvn/version "1.0.0"}
|
||||
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
||||
environ/environ {:mvn/version "1.2.0"}
|
||||
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
||||
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
||||
org.clojure/tools.namespace {:git/sha "daf82a10e70182aea4c0716a48f3922163441b32",
|
||||
:git/url "https://github.com/clojure/tools.namespace"}
|
||||
medley/medley {:mvn/version "1.3.0"}
|
||||
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner",
|
||||
:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}
|
||||
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
||||
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
||||
testdoc/testdoc {:mvn/version "1.4.1"}
|
||||
org.clojars.lispyclouds/contajners {:mvn/version "0.0.6"}
|
||||
borkdude/rewrite-edn {:mvn/version "0.1.0"}
|
||||
clojure-term-colors/clojure-term-colors {:mvn/version "0.1.0"}
|
||||
io.aviso/pretty {:mvn/version "1.1.1"}
|
||||
progrock/progrock {:mvn/version "0.1.2"}
|
||||
djblue/portal {:mvn/version "0.19.0"}
|
||||
com.wsscode/cljc-misc {:mvn/version "2021.10.16"}
|
||||
edn-query-language/eql {:mvn/version "2021.07.18"}
|
||||
meta-merge/meta-merge {:mvn/version "1.0.0"}
|
||||
com.exoscale/lingo {:mvn/version "1.0.0-alpha14"}
|
||||
io.github.swirrl/dogstatsd {:mvn/version "0.1.39"}
|
||||
org.clojure/algo.monads {:mvn/version "0.1.6"}
|
||||
io.lambdaforge/datalog-parser {:mvn/version "0.1.9"}
|
||||
clj-stacktrace/clj-stacktrace {:mvn/version "0.2.8"}
|
||||
clojure-msgpack/clojure-msgpack {:mvn/version "1.2.1"}
|
||||
cli-matic/cli-matic {:git/url "https://github.com/l3nz/cli-matic.git", :git/sha "9cd53ba7336363e3d06650dbad413b6f8b06e471"}
|
||||
aysylu/loom {:mvn/version "1.0.2"}
|
||||
com.layerware/hugsql-core {:mvn/version "0.5.3"}
|
||||
com.github.seancorfield/expectations {:mvn/version "2.0.157"}
|
||||
com.rpl/specter {:mvn/version "1.1.4"}
|
||||
com.github.askonomm/clarktown {:mvn/version "1.1.2"}
|
||||
org.clojure/math.numeric-tower {:git/tag "math.numeric-tower-0.0.5", :git/sha "12eb9c5", :git/url "https://github.com/clojure/math.numeric-tower"}
|
||||
prismatic/schema {:git/url "https://github.com/plumatic/schema"
|
||||
:git/sha "6846dc7c3a9df5bfd718f68f183c683ce0f621ff"
|
||||
:git/tag "schema-1.3.0"}
|
||||
metosin/malli {:git/url "https://github.com/metosin/malli"
|
||||
:git/sha "588147ef49b2e41c7d12a8aa994b39c1c6fedd99"
|
||||
:git/tag "0.8.9"}
|
||||
meander/epsilon {:git/url "https://github.com/noprompt/meander"
|
||||
:git/sha "55f5ce70e6ef717e95c58260f6bc725d70c0cb6d"}
|
||||
cc.qbits/auspex {:git/url "https://github.com/mpenet/auspex"
|
||||
:git/sha "1a9d7427e60e1a434a764aa820d1c53f7e22504a"
|
||||
:deps/manifest :deps}
|
||||
exoscale/interceptor {:git/url "https://github.com/exoscale/interceptor"
|
||||
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
||||
: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
|
||||
org.clojure/spec.alpha nil}}
|
||||
org.clojure/data.json {:mvn/version "2.4.0"}}
|
||||
:classpath-overrides {org.clojure/clojure nil
|
||||
org.clojure/spec.alpha nil
|
||||
org.clojure/core.specs.alpha nil}}
|
||||
:clj-nvd
|
||||
{:extra-deps {clj-nvd/clj-nvd {:git/url "https://github.com/miikka/clj-nvd.git"
|
||||
:sha "f2ec98699e057a379baf170cb49cf7ad76874a70"}}
|
||||
:main-opts ["-m" "clj-nvd.core"]}
|
||||
:test
|
||||
{:extra-paths ["test"]
|
||||
:extra-deps {io.github.cognitect-labs/test-runner
|
||||
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
|
||||
nubank/matcher-combinators {:mvn/version "3.6.0"}}
|
||||
:main-opts ["-m" "cognitect.test-runner"]
|
||||
:exec-fn cognitect.test-runner.api/test}
|
||||
:test-pod
|
||||
{:extra-paths ["test-resources"]
|
||||
:main-opts ["-m" "babashka.main" "test-resources/pod.clj"]}}}
|
||||
;; release
|
||||
:main-opts ["-m" "clj-nvd.core"]}}}
|
||||
|
|
|
|||
2
depstar
2
depstar
|
|
@ -1 +1 @@
|
|||
Subproject commit 2bf9d3c9f15298d7dd9de033674a42f830e23d6f
|
||||
Subproject commit c419b8c82041855d55593c5b561fc7cea8234712
|
||||
15
doc/build.md
15
doc/build.md
|
|
@ -3,24 +3,24 @@
|
|||
## Prerequisites
|
||||
|
||||
- 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-21.1.0*.
|
||||
- For Windows, installing Visual Studio 2019 with the "Desktop development
|
||||
with C++" workload is recommended.
|
||||
- Set `$GRAALVM_HOME` to the GraalVM distribution directory. On macOS this can look like:
|
||||
|
||||
``` shell
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-jdk-21.0.0.1/Contents/Home
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-21.1.0/Contents/Home
|
||||
```
|
||||
|
||||
On linux:
|
||||
|
||||
``` shell
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-jdk-21.0.0.1
|
||||
export GRAALVM_HOME=~/Downloads/graalvm-ce-java11-21.1.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):
|
||||
```
|
||||
set GRAALVM_HOME=%USERPROFILE%\Downloads\graalvm-ce-jdk-21.0.0.1
|
||||
set GRAALVM_HOME=%USERPROFILE%\Downloads\graalvm-ce-java11-21.1.0
|
||||
```
|
||||
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
|
||||
|
||||
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:
|
||||
|
||||
```shell
|
||||
|
|
@ -93,8 +93,8 @@ Babashka supports the following feature flags:
|
|||
|
||||
| Name | Description | Default |
|
||||
|--------|----------------------------------------------|----------|
|
||||
| `BABASHKA_FEATURE_CORE_ASYNC` | Includes the [clojure.core.async](https://github.com/clojure/core.async) library | `true` |
|
||||
| `BABASHKA_FEATURE_CSV` | Includes the [clojure.data.csv](https://github.com/clojure/data.csv) library | `true` |
|
||||
| `BABASHKA_FEATURE_JAVA_NET_HTTP` | Includes commonly used classes from the `java.net.http` package | `true` |
|
||||
| `BABASHKA_FEATURE_JAVA_NIO` | Includes commonly used classes from the `java.nio` package | `true` |
|
||||
| `BABASHKA_FEATURE_JAVA_TIME` | Includes commonly used classes from the `java.time` package | `true` |
|
||||
| `BABASHKA_FEATURE_TRANSIT` | Includes the [transit-clj](https://github.com/cognitect/transit-clj) library | `true` |
|
||||
|
|
@ -107,14 +107,11 @@ Babashka supports the following feature flags:
|
|||
| `BABASHKA_FEATURE_TEST_CHECK` | Includes the [clojure.test.check](https://github.com/clojure/test.check) library | `true` |
|
||||
| `BABASHKA_FEATURE_SPEC_ALPHA` | Includes the [clojure.spec.alpha](https://github.com/clojure/spec.alpha) library (WIP) | `false` |
|
||||
| `BABASHKA_FEATURE_JDBC` | Includes the [next.jdbc](https://github.com/seancorfield/next-jdbc) library | `false` |
|
||||
| `BABASHKA_FEATURE_SQLITE` | Includes the [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) library | `false` |
|
||||
| `BABASHKA_FEATURE_POSTGRESQL` | Includes the [PostgresSQL](https://jdbc.postgresql.org/) JDBC driver | `false` |
|
||||
| `BABASHKA_FEATURE_HSQLDB` | Includes the [HSQLDB](http://www.hsqldb.org/) 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_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_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.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,77 +0,0 @@
|
|||
# Companies using babashka
|
||||
|
||||
Is your company using babashka? Mention it in
|
||||
[this](https://github.com/babashka/babashka/discussions/1026) discussion to get
|
||||
yours listed!
|
||||
|
||||
If your company is using clj-kondo as well, mention it
|
||||
[here](https://github.com/clj-kondo/clj-kondo/discussions/1397).
|
||||
|
||||
If your company is sponsoring, it will be listed first (in order of sponsorship
|
||||
size) with a logo and hiring link (if applicable)!
|
||||
|
||||
## Sponsoring companies
|
||||
|
||||
### [Adgoji](https://www.adgoji.com/)
|
||||
|
||||

|
||||
|
||||
### [Nubank](https://nubank.com.br/)
|
||||
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/f/f7/Nubank_logo_2021.svg" width="200">
|
||||
|
||||
Sponsoring via [Cognitect](https://www.cognitect.com/).
|
||||
|
||||
### [Nextjournal](https://nextjournal.com/)
|
||||
|
||||
<img src="https://cdn.nextjournal.com/images/nextjournal-logo.svg" width="300">
|
||||
|
||||
### [ATA](https://ata-llc.com) - [hiring](https://www.ziprecruiter.com/c/ATA-LLC/Jobs)
|
||||
|
||||
<img width="250" alt="Screen Shot 2022-01-07 at 21 21 00" src="https://user-images.githubusercontent.com/284934/148602984-6c333501-505b-4692-ad7a-62383510fb9a.png">
|
||||
|
||||
### [Cognician](https://www.cognician.com)
|
||||
|
||||
<img src="https://avatars.githubusercontent.com/u/1450774?s=150&v=4">
|
||||
|
||||
### [Fluent](https://fluent.to)
|
||||
|
||||
<img src="https://uploads-ssl.webflow.com/600fdbbcf0cbfe02f1a48030/600fdf0fffe881c3e8e298f4_Fluent%20logotype-p-500.png" width="300">
|
||||
|
||||
### [180seg](https://www.180s.com.br)
|
||||
|
||||
<img src="https://avatars.githubusercontent.com/u/75583439?s=200&v=4">
|
||||
|
||||
### [Dr. Evidence](https://www.drevidence.com/)
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/284934/138914250-f447ca3d-c1c1-4c60-bfaf-9000541d4a0d.png" width="325">
|
||||
|
||||
### [EnjoyHQ](https://getenjoyhq.com/)
|
||||
|
||||
<img src="https://getenjoyhq.com/wp-content/uploads/2021/07/EnjoyHQ_uz-blue_cropp.svg" width="300">
|
||||
|
||||
### [Epic Castle](https://epiccastle.io)
|
||||
|
||||
<img src="https://epiccastle.io/images/logo.png" width="100">
|
||||
|
||||
## Companies
|
||||
|
||||
- [AWS](https://aws.amazon.com/)
|
||||
- [Barracuda](https://www.barracuda.com/)
|
||||
- [Datil](https://datil.com/)
|
||||
- [Deon Digital](https://www.deondigital.com/)
|
||||
- [Fluent](https://fluent.to/)
|
||||
- [Fluree](https://flur.ee/)
|
||||
- [Hi](https://www.hi.group/)
|
||||
- [Juxt](https://www.juxt.pro/)
|
||||
- [Kleene](https://www.kleene.ai/)
|
||||
- [Latacora](https://www.latacora.com/)
|
||||
- [Metosin](https://www.metosin.fi/en/)
|
||||
- [Nextdoc](https://www.nextdoc.io/)
|
||||
- [PractiTest](https://www.practitest.com/)
|
||||
- [Reify Health](https://www.reifyhealth.com/)
|
||||
- [Schnaq](https://schnaq.com/)
|
||||
- [Splash Financial](https://www.splashfinancial.com/)
|
||||
- [TOYOKUMO, Inc.](https://toyokumo.co.jp/)
|
||||
- [Xcoo](https://xcoo.com/)
|
||||
- [Zero one group](https://zero-one-group.com/)
|
||||
114
doc/dev.md
114
doc/dev.md
|
|
@ -1,46 +1,6 @@
|
|||
# Developing Babashka
|
||||
|
||||
## Workflow
|
||||
|
||||
### Start with an issue before writing code
|
||||
|
||||
Before writing any code, please create an issue first that describes the problem
|
||||
you are trying to solve with alternatives that you have considered. A little bit
|
||||
of prior communication can save a lot of time on coding. Keep the problem as
|
||||
small as possible. If there are two problems, make two issues. We discuss the
|
||||
issue and if we reach an agreement on the approach, it's time to move on to a
|
||||
PR.
|
||||
|
||||
### Follow up with a pull request
|
||||
|
||||
Post a corresponding PR with the smallest change possible to address the
|
||||
issue. Then we discuss the PR, make changes as needed and if we reach an
|
||||
agreement, the PR will be merged.
|
||||
|
||||
### Tests
|
||||
|
||||
Each bug fix, change or new feature should be tested well to prevent future
|
||||
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
|
||||
|
||||
Please do not use `git push --force` on your PR branch for the following
|
||||
reasons:
|
||||
|
||||
- It makes it more difficult for others to contribute to your branch if needed.
|
||||
- It makes it harder to review incremental commits.
|
||||
- Links (in e.g. e-mails and notifications) go stale and you're confronted with:
|
||||
this code isn't here anymore, when clicking on them.
|
||||
- CircleCI doesn't play well with it: it might try to fetch a commit which
|
||||
doesn't exist anymore.
|
||||
- Your PR will be squashed anyway.
|
||||
|
||||
## 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-21.1.0.
|
||||
|
||||
## Clone repository
|
||||
|
||||
|
|
@ -84,76 +44,12 @@ Test the native version:
|
|||
## Tests for Libraries
|
||||
|
||||
Babashka runs tests of libraries that are compatible with it through
|
||||
`script/run_lib_tests`.
|
||||
|
||||
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
|
||||
# To add tests for a new library on clojars
|
||||
script/add-libtest.clj com.exoscale/lingo -t
|
||||
|
||||
# To add tests for a new library that is git based only
|
||||
script/add-libtest.clj '{borkdude/carve {:git/url "https://github.com/borkdude/carve" :sha "df552797a198b6701fb2d92390fce7c59205ea77"}}' -t
|
||||
|
||||
# There are a number of options for specifying how to copy tests
|
||||
script/add-libtest.clj -h
|
||||
```
|
||||
|
||||
If the library you want to add doesn't work automatically, you can manually do the following:
|
||||
`script/run_lib_tests`. To add tests for a new library, do the following:
|
||||
|
||||
* Add an entry for the library in `deps.edn` under the `:lib-tests` alias.
|
||||
* Create a directory for the library in `test-resources/lib_tests/` and copy its tests to there.
|
||||
* Add a manual lib entry using `add-libtest.clj` e.g. `script/add-libtest.clj http-kit/http-kit -m '{:test-namespaces [httpkit.client-test]}'`.
|
||||
* Run the tests `script/lib_tests/run_all_libtests NS1 NS2`
|
||||
* Add an entry in `run_all_libtests.clj` to run the added test namespaces.
|
||||
|
||||
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.
|
||||
|
||||
## 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
|
||||
|
||||
|
|
@ -185,7 +81,7 @@ To progress work on sqlite and mySQL, I need a working Clojure example. If you
|
|||
want to contribute, consider making a an example Clojure GraalVM CLI that puts
|
||||
something in a sqlite / mysql DB and reads something from it.
|
||||
|
||||
## Design decisions
|
||||
## ADR
|
||||
|
||||
Some design decisions:
|
||||
|
||||
|
|
@ -209,7 +105,7 @@ Some of these design decisions were formed in [these discussions](https://github
|
|||
|
||||
- Tasks do not allow passing arguments to dependent tasks, other than by rebinding `*command-line-args*` (see discussion).
|
||||
- Does the list of dependencies need to be dynamic? No, see discussion (same reason as args)
|
||||
- bb <foo> is resolved as file > task > bb subcommand. Shadowing future subcommand is a problem that a user can solve by renaming a task or file. (same as lein aliases). Also see Conflicts.
|
||||
- bb <foo> is resolved as file > task > bb subcommand. Shadowing future subcommand is a problem that a user can solve by renaming a task or file. (same as lein aliases). Also see Conflicts.
|
||||
- It is a feature that tasks are defined as top-level vars (instead of local let-bound symbols). This plays well with the Gilardi scenario, e.g. here: https://github.com/babashka/babashka.github.io/blob/ad276625f6c41f269d19450f236cb54cab2591e1/bb.edn#L7.
|
||||
- The parallel option trickles down into run calls. People who use parallel will be confused if it’s dropped magically, people who don’t use parallel won’t notice anything either way so it doesn’t matter
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
FROM babashka/babashka:0.8.2
|
||||
|
||||
COPY example.clj /
|
||||
|
||||
ENTRYPOINT bb /example.clj
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
# Deploying a babashka app to fly.io
|
||||
|
||||
[Fly.io](https://fly.io/) is a service that can run full stack apps with minimal
|
||||
configuration. If you like the ease of Heroku, you might like fly.io and perhaps
|
||||
even better! This document shows how to get a minimal babashka application up
|
||||
and running on `fly.io`.
|
||||
|
||||
In `example.clj` we start an http-kit web server which spits out some HTML. You
|
||||
can run this locally by invoking `bb example.clj` from the command line.
|
||||
|
||||
To get this site running on `fly.io`, you need to
|
||||
[install](https://fly.io/docs/getting-started/installing-flyctl/) and [log
|
||||
in](https://fly.io/docs/getting-started/log-in-to-fly/).
|
||||
|
||||
Then run `flyctl launch` to create a new application. After making changes, you
|
||||
can re-deploy the site with `flyctl deploy`.
|
||||
|
||||
That's it! See this
|
||||
[tweet](https://twitter.com/borkdude/status/1526175120825401344) for a demo.
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
(ns example
|
||||
(:require [hiccup2.core :refer [html]]
|
||||
[org.httpkit.server :refer [run-server]]))
|
||||
|
||||
(def port (or (some-> (System/getenv "PORT")
|
||||
parse-long)
|
||||
8092))
|
||||
|
||||
(run-server
|
||||
(fn [_]
|
||||
{:body
|
||||
(str (html
|
||||
[:html
|
||||
[:body
|
||||
[:h1 "Hello world!"]
|
||||
[:p (str "This site is running with babashka v"
|
||||
(System/getProperty "babashka.version"))]]]))})
|
||||
{:port port})
|
||||
|
||||
(println "Site running on port" port)
|
||||
@(promise)
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
# fly.toml file generated for shy-sound-2847 on 2022-05-16T14:12:38+02:00
|
||||
|
||||
app = "shy-sound-2847"
|
||||
|
||||
kill_signal = "SIGINT"
|
||||
kill_timeout = 5
|
||||
processes = []
|
||||
|
||||
[env]
|
||||
PORT = "8092"
|
||||
|
||||
[experimental]
|
||||
allowed_public_ports = []
|
||||
auto_rollback = true
|
||||
|
||||
[[services]]
|
||||
http_checks = []
|
||||
internal_port = 8092
|
||||
processes = ["app"]
|
||||
protocol = "tcp"
|
||||
script_checks = []
|
||||
|
||||
[services.concurrency]
|
||||
hard_limit = 25
|
||||
soft_limit = 20
|
||||
type = "connections"
|
||||
|
||||
[[services.ports]]
|
||||
force_https = true
|
||||
handlers = ["http"]
|
||||
port = 80
|
||||
|
||||
[[services.ports]]
|
||||
handlers = ["tls", "http"]
|
||||
port = 443
|
||||
|
||||
[[services.tcp_checks]]
|
||||
grace_period = "1s"
|
||||
interval = "15s"
|
||||
restart_limit = 0
|
||||
timeout = "2s"
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
maven-name,git-url
|
||||
aero/aero,http://github.com/juxt/aero
|
||||
amperity/vault-clj,https://github.com/amperity/vault-clj
|
||||
aysylu/loom,https://github.com/aysylu/loom
|
||||
babashka/babashka.curl,https://github.com/babashka/babashka.curl
|
||||
better-cond/better-cond,https://github.com/Engelberg/better-cond
|
||||
borkdude/deps,https://github.com/borkdude/deps.clj
|
||||
borkdude/missing.test.assertions,https://github.com/borkdude/missing.test.assertions
|
||||
borkdude/rewrite-edn,https://github.com/borkdude/rewrite-edn
|
||||
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
|
||||
cli-matic/cli-matic,https://github.com/l3nz/cli-matic.git
|
||||
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-stacktrace/clj-stacktrace,https://github.com/mmcgrana/clj-stacktrace
|
||||
clojure-csv/clojure-csv,https://github.com/davidsantiago/clojure-csv
|
||||
clojure-msgpack/clojure-msgpack,https://github.com/edma2/clojure-msgpack
|
||||
clojure-term-colors/clojure-term-colors,https://github.com/trhura/clojure-term-colors
|
||||
com.exoscale/lingo,https://github.com/exoscale/lingo
|
||||
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/honeysql,https://github.com/seancorfield/honeysql
|
||||
com.grammarly/omniconf,https://github.com/grammarly/omniconf
|
||||
com.layerware/hugsql-core,
|
||||
com.rpl/specter,https://github.com/redplanetlabs/specter
|
||||
com.stuartsierra/component,https://github.com/stuartsierra/component
|
||||
com.stuartsierra/dependency,https://github.com/stuartsierra/dependency
|
||||
com.wsscode/cljc-misc,https://github.com/wilkerlucio/cljc-misc
|
||||
comb/comb,https://github.com/weavejester/comb
|
||||
cprop/cprop,https://github.com/tolitius/cprop
|
||||
crispin/crispin,https://github.com/dunaj-project/crispin
|
||||
dev.nubank/docopt,https://github.com/nubank/docopt.clj
|
||||
djblue/portal,https://github.com/djblue/portal
|
||||
doric/doric,https://github.com/joegallo/doric
|
||||
douglass/clj-psql,https://github.com/DarinDouglass/clj-psql
|
||||
edn-query-language/eql,https://github.com/edn-query-language/eql
|
||||
environ/environ,https://github.com/weavejester/environ
|
||||
exoscale/coax,https://github.com/exoscale/coax
|
||||
exoscale/interceptor,https://github.com/exoscale/interceptor
|
||||
expound/expound,https://github.com/bhb/expound
|
||||
failjure/failjure,https://github.com/adambard/failjure
|
||||
ffclj/ffclj,https://github.com/luissantos/ffclj
|
||||
gaka/gaka,https://github.com/cdaddr/gaka
|
||||
hato/hato,https://github.com/gnarroway/hato
|
||||
henryw374/cljc.java-time,https://github.com/henryw374/cljc.java-time
|
||||
hiccup/hiccup,http://github.com/weavejester/hiccup
|
||||
honeysql/honeysql,https://github.com/seancorfield/honeysql
|
||||
http-kit/http-kit,https://github.com/http-kit/http-kit
|
||||
integrant/integrant,https://github.com/weavejester/integrant
|
||||
io.aviso/pretty,https://github.com/AvisoNovate/pretty
|
||||
io.github.cognitect-labs/test-runner,https://github.com/cognitect-labs/test-runner
|
||||
io.github.swirrl/dogstatsd,https://github.com/swirrl/dogstatsd
|
||||
io.github.technomancy/limit-break,https://github.com/technomancy/limit-break
|
||||
io.helins/binf,https://github.com/helins/binf.cljc
|
||||
io.lambdaforge/datalog-parser,https://github.com/lambdaforge/datalog-parser
|
||||
io.replikativ/hasch,https://github.com/replikativ/hasch
|
||||
java-http-clj/java-http-clj,http://www.github.com/schmee/java-http-clj
|
||||
lambdaisland/regal,https://github.com/lambdaisland/regal
|
||||
listora/again,https://github.com/liwp/again
|
||||
markdown-clj/markdown-clj,https://github.com/yogthos/markdown-clj
|
||||
meander/epsilon,https://github.com/noprompt/meander
|
||||
medley/medley,https://github.com/weavejester/medley
|
||||
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
|
||||
mvxcvi/arrangement,https://github.com/greglook/clj-arrangement
|
||||
net.cgrand/xforms,https://github.com/cgrand/xforms
|
||||
orchestra/orchestra,https://github.com/jeaye/orchestra
|
||||
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/digest,https://github.com/clj-commons/clj-digest
|
||||
org.clojars.askonomm/ruuter,https://github.com/askonomm/ruuter
|
||||
org.clojars.lispyclouds/contajners,https://github.com/lispyclouds/contajners
|
||||
org.clojure/algo.monads,https://github.com/clojure/algo.monads
|
||||
org.clojure/core.match,https://github.com/clojure/core.match
|
||||
org.clojure/data.csv,https://github.com/clojure/data.csv
|
||||
org.clojure/data.generators,https://github.com/clojure/data.generators
|
||||
org.clojure/data.json,https://github.com/clojure/data.json
|
||||
org.clojure/data.zip,https://github.com/clojure/data.zip
|
||||
org.clojure/math.combinatorics,https://github.com/clojure/math.combinatorics
|
||||
org.clojure/math.numeric-tower,https://github.com/clojure/math.numeric-tower
|
||||
org.clojure/test.check,https://github.com/clojure/test.check
|
||||
org.clojure/tools.gitlibs,https://github.com/clojure/tools.gitlibs
|
||||
org.clojure/tools.namespace,https://github.com/clojure/tools.namespace
|
||||
postmortem/postmortem,https://github.com/athos/Postmortem
|
||||
prismatic/schema,https://github.com/plumatic/schema
|
||||
progrock/progrock,https://github.com/weavejester/progrock
|
||||
reifyhealth/specmonstah,https://github.com/reifyhealth/specmonstah
|
||||
rewrite-clj/rewrite-clj,https://github.com/clj-commons/rewrite-clj
|
||||
rm-hull/jasentaa,https://github.com/rm-hull/jasentaa
|
||||
selmer/selmer,https://github.com/yogthos/Selmer
|
||||
slingshot/slingshot,https://github.com/scgilardi/slingshot
|
||||
table/table,https://github.com/cldwalker/table
|
||||
testdoc/testdoc,https://github.com/liquidz/testdoc
|
||||
version-clj/version-clj,https://github.com/xsc/version-clj
|
||||
|
400
doc/news.md
400
doc/news.md
|
|
@ -5,406 +5,6 @@ you have anything to add. Also see
|
|||
[#babashka](https://twitter.com/hashtag/babashka?src=hashtag_click&f=live) on
|
||||
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))
|
||||
|
||||
### 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
|
||||
- [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
|
||||
- Win a babashka t-shirt by participating in [this](https://twitter.com/borkdude/status/1547847843381030912) contest!
|
||||
- [AWS Lambda, now with first class parentheses](https://www.juxt.pro/blog/nbb-lambda) by Ray McDermott (about nbb)
|
||||
- [bb-github-app](https://github.com/brandonstubbs/bb-github-app): An example Babashka Script authenticating as a Github App and interacting with the Checks API
|
||||
- [Ruuter](https://github.com/askonomm/ruuter#setting-up-with-babashka) is a routing library which works very well with bb
|
||||
- [Blambda!](https://jmglov.net/blog/2022-07-03-blambda.html) by Josh Glover
|
||||
- Files with the `.bb` extension are now correctly highlighted as Clojure code on Github! See [this](https://twitter.com/borkdude/status/1543937735429431298) tweet.
|
||||
- Encode and decode files as kroki url diagrams, a [gist](https://gist.github.com/henryw374/070845dbd8cfb4672a3c0d06cf8b00e4) by Henry Widd
|
||||
- Customized bb builds with clj-nix: [tweet](https://twitter.com/jlesquembre/status/1543686641461694470)
|
||||
- Expose Clojure functions in the CLI with babashka and nix: [tweet](https://twitter.com/jlesquembre/status/1546777332471455745)
|
||||
- [Meander](https://github.com/noprompt/meander) is now compatible with bb: [tweet](https://twitter.com/borkdude/status/1542881167338250242)
|
||||
- [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)
|
||||
|
||||
- Releases: [0.8.156](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [AWS wiki page](https://github.com/babashka/babashka/wiki/AWS)
|
||||
- [blambda](https://github.com/jmglov/blambda): Blambda! is a custom runtime for AWS Lambda that lets you write functions using Babashka
|
||||
- [Babashka CLI](https://blog.michielborkent.nl/babashka-cli.html): turn Clojure functions into CLIs!
|
||||
- [Http-server](https://github.com/babashka/http-server#babashka): Serve static assets
|
||||
- [Deps-bundler](https://github.com/MrGung/deps-bundler): Bundle dependencies on
|
||||
a computer that has access to maven and clojars (PC-A) and bring these over to
|
||||
a computer with limited access (PC-L).
|
||||
- [Prismatic/schema](https://github.com/plumatic/schema/blob/master/CHANGELOG.md#130-2022-06-10) and babashka are now compatible
|
||||
- [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
|
||||
|
||||
## [2022-05](https://twitter.com/search?q=%28%23babashka%29%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).
|
||||
- [Etaoin](https://github.com/clj-commons/etaoin) moved to clj-commons and now works with babashka as well.
|
||||
- [Nix docs for babashka](https://github.com/babashka/babashka/blob/master/doc/nix.md)
|
||||
- [Fly.io docs for babashka](https://github.com/babashka/babashka/tree/master/doc/fly_io)
|
||||
- [Babashka survey results](https://blog.michielborkent.nl/babashka-survey-q1-2022.html)
|
||||
- [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
|
||||
|
||||
## [2022-04](https://twitter.com/search?q=%28%23babashka%29%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).
|
||||
- [Babashka and Clojure](https://youtu.be/ZvOs5Ele6VE) by Rahul Dé at North Virginia Linux Users Group
|
||||
- [Setup-Clojure](https://github.com/DeLaGuardo/setup-clojure/releases/tag/5.0) Github action is now able to install babashka!
|
||||
- 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)
|
||||
|
||||
## [2022-03](https://twitter.com/search?q=%28%23babashka%29%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).
|
||||
- [Create a password manager with Clojure using Babashka, sqlite, honeysql and stash](https://youtu.be/jm0RXmyjRJ8) by Daniel Amber
|
||||
- [Detecting inconsistent aliases in a clojure codebase](https://www.youtube.com/watch?v=bf8KLKkCH2g) by Oxalorg
|
||||
- [Clj-konmari](https://github.com/oxalorg/clj-konmari/) by Oxalorg
|
||||
- [Logseq-query](https://github.com/cldwalker/logseq-query) by Gabriel Horner [(announcement tweet with video)](https://twitter.com/cldwalker/status/1506991213030871041)
|
||||
- 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
|
||||
|
||||
## [2022-02](https://twitter.com/search?q=%28%23babashka%29%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).
|
||||
- [Spire is available as a babashka pod](https://twitter.com/epic_castle/status/1496784352256008194)
|
||||
- Babashka Clojure template on [Repl.it](https://replit.com/@eccentric-j/Babashka-Clojure-Template?v=1#replit.nix) by Eccentric J
|
||||
- Create a self-contained executable with [caxa](https://github.com/babashka/babashka/wiki/Self-contained-executable)
|
||||
- Cli-matic is now compatible due to this [PR](https://github.com/l3nz/cli-matic/pull/145)
|
||||
- [I, too, Wrote Myself a Static Site Generator](https://dawranliou.com/blog/i-too-wrote-myself-a-static-site-generator/) by Daw-Ran Liou
|
||||
- [Staplegun](https://github.com/escherize/staplegun): Single file clipboard-manager
|
||||
- [Bbb](https://github.com/nikvdp/bbb): make executable CLI tools from bb scripts
|
||||
- [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)
|
||||
|
||||
- Releases: [0.7.4](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Babashka dev builds](https://github.com/babashka/babashka-dev-builds)
|
||||
- [Writing Clojure-living-cookbooks](https://www.loop-code-recur.io/live-clojure-cookbooks/) by Cyprien Pannier
|
||||
- [HTMX Todo App](https://github.com/prestancedesign/babashka-htmx-todoapp)
|
||||
- [Better linting for `bb.edn`](https://twitter.com/borkdude/status/1484100071134220291)
|
||||
- [Unwordle](https://github.com/mknoszlig/unwordle): solver for wordle puzzles
|
||||
- [Using babashka with PHP](https://blog.michielborkent.nl/using-babashka-with-php.html) by Michiel Borkent
|
||||
|
||||
## 2021-12
|
||||
|
||||
- Releases: [0.6.8 - 0.7.3](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Scripting with Babashka on Alfred](https://blog.wsscode.com/babashka-and-alfred/) by Wilker Lucio
|
||||
- [babashka/spec.alpha](https://github.com/babashka/spec.alpha): a fork of spec.alpha that works with babashka.
|
||||
- Several people are doing [Advent of Code puzzles with babashka](https://twitter.com/search?q=%23babashka%20%20%23AdventOfCode&src=typed_query&f=live)
|
||||
- Compatibility with a [fork of tools.namespace](https://github.com/babashka/tools.namespace). This allows
|
||||
running the Cognitect [test-runner](https://github.com/cognitect-labs/test-runner) (Cognitest) from source.
|
||||
- [bb-components](https://github.com/vedang/bb-scripts#bb-components): A script to find all the components that you should deploy your code to.
|
||||
- [Babashka workshop at JavaLand](https://github.com/ijug-ev/JavaLand/tree/main/Community-Aktivit%C3%A4ten#bash-war-gestern-shell-scripting-mit-babashka-clojure-ug-d%C3%BCsseldorf-christian-meter-rheinjug-jens-bendisposto)
|
||||
- Install babashka [dev builds](https://twitter.com/borkdude/status/1475234968146227203)
|
||||
- [Combine babashka and PHP](https://gist.github.com/borkdude/843548cba14ae9d283191e31bc483959)
|
||||
- [System wide babashka tasks](https://twitter.com/borkdude/status/1476656022282551300)
|
||||
- [Run an http file server as a babashka task](https://twitter.com/borkdude/status/1476870516233445377)
|
||||
|
||||
## 2021-11
|
||||
|
||||
- Releases: [0.6.5 - 0.6.7](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- [Contajners](https://github.com/lispyclouds/contajners): An idiomatic,
|
||||
data-driven, REPL friendly clojure client for OCI container engines.
|
||||
- [deps-modules](https://github.com/exoscale/deps-modules#babashka): a clojure "tool" that attempts to solve one of the "multi module" project problems with tools.deps in a minimalistic way.
|
||||
- [Moldable Emacs: a Clojure Playground with Babashka](https://ag91.github.io/blog/2021/11/05/moldable-emacs-a-clojure-playground-with-babashka/)
|
||||
- [aws pod 0.1.0](https://twitter.com/borkdude/status/1459117378441261056)
|
||||
- [tools.bbuild](https://github.com/babashka/tools.bbuild): a fork of tools.build that runs with babashka and [tools-deps-native](https://github.com/babashka/tools-deps-native)
|
||||
- [Making markdown-clj babashka compatible](https://blog.michielborkent.nl/markdown-clj-babashka-compatible.html) by Michiel Borkent
|
||||
- [radiale](https://github.com/xlfe/radiale): radiale: home automation project written using #babashka and Python
|
||||
- [Writing a Clojure shell script with Babashka](https://www.youtube.com/watch?v=D-_Mz7rz1po), a video by Max Weber
|
||||
- [makejack](https://github.com/hugoduncan/makejack): A clojure CLI build tool, and build library which can run with babashka.
|
||||
- [I wrote myself a static site generator](https://freeston.me/posts/2021-11-29-new-site-generator/) (in babashka) by Dominic Freeston.
|
||||
- [bipe](https://gist.github.com/borkdude/82dcdd36a1e61ef36f19221876e7b1b6): vipe for babashka
|
||||
|
||||
|
||||
## 2021-10
|
||||
- Releases: [0.6.2-0.6.4](https://github.com/babashka/babashka/blob/master/CHANGELOG.md).
|
||||
- Babashka on the [Thoughtworks Technology Radar](https://www.thoughtworks.com/radar/platforms/babashka)
|
||||
- [ruuter](https://github.com/askonomm/ruuter#setting-up-with-babashka) is a
|
||||
routing library compatible with babashka.
|
||||
- A list of [companies](https://github.com/babashka/babashka/blob/master/doc/companies.md) using babashka
|
||||
- Ilshat Sultanov shares his [babashka tasks](https://twitter.com/just_sultanov/status/1446118161258987534)
|
||||
- [Slack the music](https://github.com/javahippie/slack-the-music), a babashka script to update your slack status with your current Apple Music track by Tim Zöller.
|
||||
- [Finding my inner Wes Anderson](https://javahippie.net/clojure/2021/10/18/finding-my-inner-wes-anderson.html) by Tim Zöller.
|
||||
- [Run a local babashka script in a remote server](https://twitter.com/borkdude/status/1451110414062870528)
|
||||
- [Replacing my Octopress blog with 200 lines of Babashka](https://blog.michielborkent.nl/migrating-octopress-to-babashka.html) by Michiel Borkent
|
||||
- The babashka wiki now has a [GNU Emacs](https://github.com/babashka/babashka/wiki/GNU-Emacs) section
|
||||
- Invoke babashka tasks in a [monorepo](https://github.com/babashka/babashka/discussions/1044#discussioncomment-1544956)
|
||||
- [Speeding up builds with fs/modified-since](https://blog.michielborkent.nl/speeding-up-builds-fs-modified-since.html) by Michiel Borkent
|
||||
|
||||
## 2021-09
|
||||
|
||||
- New babashka 0.6.0 released. Highlight: support for `java.net.http` which
|
||||
enables running [java-http-clj](https://github.com/schmee/java-http-clj) from
|
||||
source. The raw interop is the first part of a multi-stage plan to move all
|
||||
http related scripting towards `java.net.http` in favor of the other two
|
||||
solutions currently available in `bb`: `babashka.curl` and
|
||||
`org.httpkit.client`.
|
||||
- [rss-saver](https://github.com/adam-james-v/rss-saver): Simple Clojure (Babashka) script that saves articles from world.hey.com RSS feeds.
|
||||
- [babashka-docker-action-example](https://github.com/borkdude/babashka-docker-action-example)
|
||||
- [script](https://gist.github.com/rutenkolk/dbd970d03a0d012b671db38434ccbfa7) to upgrade zig lang to the latest dev release
|
||||
- [Cursive](https://twitter.com/CursiveIDE/status/1439022267187433472) adds support for babashka in 1.11.0
|
||||
- How to filter tail output with babashka on [StackOverflow](https://stackoverflow.com/questions/69241046/how-to-filter-output-of-tail-with-babashka/69241911?stw=2#69241911)
|
||||
- [Awesome Babashka: Parse & produce HTML and SQLite](https://blog.jakubholy.net/2021/awesome-babashka-dash/) by Jakub Holy
|
||||
- [Neil](https://github.com/babashka/neil): an installable babashka script to add common aliases and features to deps.edn-based projects.
|
||||
|
||||
## 2021-08
|
||||
|
||||
- New babashka 0.5.1 released. Highlight: new `print-deps` command for printing
|
||||
a `deps.edn` map and classpath which includes all built-in deps. This can be
|
||||
used for editor tooling like Cursive and clojure-lsp, but also for migrating a
|
||||
babashka project to a Graal native-image project.
|
||||
- Babashka receives long term funding from [Clojurists Together](https://www.clojuriststogether.org/news/long-term-funding-selections/). Thanks!
|
||||
- Babashka is 2 years old this month: the [first commit](https://github.com/babashka/babashka/commit/6dee50b0face0b890a7f628a63b21d5d706a48ee) was on 9 August 2019!
|
||||
- [nbb](https://github.com/borkdude/nbb): babashka's Node.js cousin
|
||||
- [Cursive](https://twitter.com/CursiveIDE/status/1422540023207915520) adds
|
||||
support for babashka in the latest EAP
|
||||
- [clojure-lsp](https://twitter.com/ericdallo/status/1422559744712138753) adds support for babashka scripts
|
||||
- [bb guestbook](https://github.com/SVMBrown/bb-guestbook) by Scot Brown.
|
||||
- [bb htmx todo app](https://github.com/prestancedesign/babashka-htmx-todoapp) by Michael Sahili.
|
||||
- [bb aws lambda runtime](https://github.com/tatut/bb-lambda) by Tatu Tarvainen.
|
||||
|
||||
## 2021-07
|
||||
|
||||
- New babashka 0.5.0 released. Highlights: `clojure.tools.logging` + `taoensso.timbre` added, source compatibility with `clojure.data.json`.
|
||||
- [Babashka tasks](https://youtu.be/u5ECoR7KT1Y), talk by Michiel Borkent
|
||||
- [Rewriting a clojure file with rewrite-clj and babashka](https://youtu.be/b7NPKsm8gkc), video by Oxalorg
|
||||
- [Babashka tasks for PostgreSQL](https://github.com/babashka/babashka/discussions/929) by Stel Abrego
|
||||
- [String interpolation](https://twitter.com/yogthos/status/1415324124361154561) with Selmer in bb
|
||||
- [Jirazzz](https://github.com/rwstauner/jirazzz): a babashka JIRA client by Randy Stauner
|
||||
- [Babashka + scittle guestbook](https://github.com/kloimhardt/babashka-scittle-guestbook) by Kloimhardt
|
||||
- [Paillier cryptosystem](https://github.com/babashka/babashka/discussions/948) by litteli
|
||||
- [csv-to-yaml.clj](https://github.com/babashka/babashka/discussions/939) by Cora
|
||||
|
||||
## 2021-06
|
||||
|
||||
- New babashka 0.4.4 - 0.4.5 released.
|
||||
|
|
|
|||
87
doc/nix.md
87
doc/nix.md
|
|
@ -1,87 +0,0 @@
|
|||
# Using Babashka with Nix
|
||||
|
||||
Babashka is [packaged](https://search.nixos.org/packages?type=packages&query=babashka) in nixpkgs and can be easily used from the Nix package manager.
|
||||
|
||||
The following assumes a recent installation of nix and uses the unstable [nix cli](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix.html) and [Flakes](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html).
|
||||
|
||||
To enable the unstable cli and flakes add the following to `/etc/nix/nix.conf`:
|
||||
|
||||
```
|
||||
extra-experimental-features flakes nix-command
|
||||
```
|
||||
|
||||
## Imperative install on Nix
|
||||
|
||||
To imperatively install nix for the current user, run `nix profile install babashka`.
|
||||
|
||||
## Declarative global install on NixOS
|
||||
|
||||
To install babashka for all users on a NixOS system, place it in `environment.systemPackages` in your `configuration.nix`:
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
babashka
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
Then run `nixos-rebuild switch`, to activate the new configuration.
|
||||
|
||||
## Declarative per-user install with home-manager
|
||||
|
||||
You can install babashka for a specific user using [home-manager](https://github.com/nix-community/home-manager). Add the following to your `~/.config/nixpkgs/home.nix`:
|
||||
|
||||
```nix
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
babashka
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
Then run `home-manager switch`, to activate the new configuration.
|
||||
|
||||
## Per project install with direnv
|
||||
|
||||
To make babashka available on a per-project basis, you can use [direnv](https://direnv.net/).
|
||||
|
||||
Create a file `.envrc` in the project directory with the following contents:
|
||||
|
||||
```
|
||||
use flake
|
||||
```
|
||||
|
||||
Create a file `flake.nix` in the project directory with the following contents:
|
||||
|
||||
```nix
|
||||
{
|
||||
outputs = {nixpkgs, ...}: let
|
||||
supportedSystems = ["x86_64-linux" "x86_64-darwin"];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
nixpkgsFor = system: import nixpkgs {inherit system;};
|
||||
in {
|
||||
devShell = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor system;
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
babashka
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
After running `direnv allow`, babashka should be available on the `$PATH`, when you are inside the project directory.
|
||||
|
||||
## 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.
|
||||
|
||||
|
||||
You can download that example, and then build the application using `nix build` or run it using `nix run`.
|
||||
268
doc/projects.md
268
doc/projects.md
|
|
@ -4,9 +4,6 @@ The following libraries and projects are known to work with babashka.
|
|||
|
||||
- [Projects](#projects)
|
||||
- [Libraries](#libraries)
|
||||
- [tools.namespace](#toolsnamespace)
|
||||
- [test-runner](#test-runner)
|
||||
- [spec.alpha](#specalpha)
|
||||
- [clj-http-lite](#clj-http-lite)
|
||||
- [spartan.spec](#spartanspec)
|
||||
- [missing.test.assertions](#missingtestassertions)
|
||||
|
|
@ -47,26 +44,6 @@ The following libraries and projects are known to work with babashka.
|
|||
- [hasch](#hasch)
|
||||
- [crispin](#crispin)
|
||||
- [ffclj](#ffclj)
|
||||
- [multigrep](#multigrep)
|
||||
- [java-http-clj](#java-http-clj)
|
||||
- [component](#component)
|
||||
- [minimallist](#minimallist)
|
||||
- [ruuter](#ruuter)
|
||||
- [clj-commons.digest](#clj-commonsdigest)
|
||||
- [contajners](#contajners)
|
||||
- [dependency](#dependency)
|
||||
- [specmonstah](#specmonstah)
|
||||
- [markdown-clj](#markdown-clj)
|
||||
- [algo.monads](#algomonads)
|
||||
- [datalog-parser](#datalog-parser)
|
||||
- [at-at](#at-at)
|
||||
- [aysylu/loom](#aysyluloom)
|
||||
- [Clarktown](#clarktown)
|
||||
- [Malli](#malli)
|
||||
- [Meander](#meander)
|
||||
- [Schema](#schema)
|
||||
- [Sluj](#sluj)
|
||||
- [malli-cli](#malli-cli)
|
||||
- [Pods](#pods)
|
||||
- [Projects](#projects-1)
|
||||
- [babashka-test-action](#babashka-test-action)
|
||||
|
|
@ -89,47 +66,18 @@ The following libraries and projects are known to work with babashka.
|
|||
- [sha-words](#sha-words)
|
||||
- [adam-james-v/scripts](#adam-james-vscripts)
|
||||
- [oidc-client](#oidc-client)
|
||||
- [jirazzz](#jirazzz)
|
||||
- [Babashka + scittle guestbook](#babashka--scittle-guestbook)
|
||||
- [bb htmx todo app](#bb-htmx-todo-app)
|
||||
- [bb aws lambda runtime](#bb-aws-lambda-runtime)
|
||||
- [bb-github-app](#bb-github-app)
|
||||
|
||||
Also keep an eye on the [news](news.md) page for new projects, gists and other
|
||||
developments around babashka.
|
||||
|
||||
## Libraries
|
||||
|
||||
For a full list of libraries, see [libraries.csv](./libraries.csv). To add a
|
||||
library, see [these instructions](./dev.md#tests-for-libraries).
|
||||
### [clj-http-lite](https://github.com/babashka/clj-http-lite)
|
||||
|
||||
### [tools.namespace](https://github.com/babashka/tools.namespace)
|
||||
|
||||
A fork of `tools.namespace`. This is used by other libraries and enables them to
|
||||
be supported by babashka.
|
||||
|
||||
### [test-runner](https://github.com/cognitect-labs/test-runner)
|
||||
|
||||
This library works with the
|
||||
[tools.namespace](https://github.com/babashka/tools.namespace) fork. See its
|
||||
readme for an example task for running tests.
|
||||
|
||||
### [spec.alpha](https://github.com/babashka/spec.alpha)
|
||||
|
||||
A fork of `clojure.spec.alpha` that includes support for generation and
|
||||
instrumentation! Its readme also contains instructions on how to use
|
||||
`clojure.core.specs.alpha`.
|
||||
|
||||
<!-- ### [tools.bbuild](https://github.com/babashka/tools.bbuild) -->
|
||||
|
||||
<!-- A fork of `tools.build`. -->
|
||||
|
||||
### [clj-http-lite](https://github.com/clj-commons/clj-http-lite)
|
||||
|
||||
Example:
|
||||
A fork of a fork of `clj-http-lite`. Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {org.clj-commons/clj-http-lite {:mvn/version "0.4.392"}}}' -Spath)"
|
||||
$ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clj-http-lite {:git/url "https://github.com/babashka/clj-http-lite" :sha "f44ebe45446f0f44f2b73761d102af3da6d0a13e"}}}' -Spath)"
|
||||
|
||||
$ bb "(require '[clj-http.lite.client :as client]) (:status (client/get \"https://www.clojure.org\"))"
|
||||
200
|
||||
|
|
@ -137,8 +85,7 @@ $ bb "(require '[clj-http.lite.client :as client]) (:status (client/get \"https:
|
|||
|
||||
### [spartan.spec](https://github.com/borkdude/spartan.spec/)
|
||||
|
||||
An babashka-compatible implementation of `clojure.spec.alpha`. See
|
||||
[spec.alpha](#specalpha) for a more complete implementation.
|
||||
An babashka-compatible implementation of `clojure.spec.alpha`.
|
||||
|
||||
### [missing.test.assertions](https://github.com/borkdude/missing.test.assertions)
|
||||
|
||||
|
|
@ -159,10 +106,16 @@ Ran 1 tests containing 0 assertions.
|
|||
|
||||
### [medley](https://github.com/weavejester/medley/)
|
||||
|
||||
Requires `bb` >= v0.0.71. Latest coordinates checked with with bb:
|
||||
|
||||
``` clojure
|
||||
{:git/url "https://github.com/weavejester/medley" :sha "a4e5fb5383f5c0d83cb2d005181a35b76d8a136d"}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {medley/medley {:mvn/version "1.3.0"}}}')
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {medley {:git/url "https://github.com/weavejester/medley" :sha "a4e5fb5383f5c0d83cb2d005181a35b76d8a136d"}}}')
|
||||
|
||||
$ bb -e "(require '[medley.core :as m]) (m/index-by :id [{:id 1} {:id 2}])"
|
||||
{1 {:id 1}, 2 {:id 2}}
|
||||
|
|
@ -209,10 +162,16 @@ export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {clojure-csv {:mvn/version "
|
|||
|
||||
### [regal](https://github.com/lambdaisland/regal)
|
||||
|
||||
Requires `bb` >= v0.0.71. Latest coordinates checked with with bb:
|
||||
|
||||
``` clojure
|
||||
{:git/url "https://github.com/lambdaisland/regal" :sha "d4e25e186f7b9705ebb3df6b21c90714d278efb7"}
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
``` shell
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {lambdaisland/regal {:mvn/version "0.0.143"}}}')
|
||||
$ export BABASHKA_CLASSPATH=$(clojure -Spath -Sdeps '{:deps {regal {:git/url "https://github.com/lambdaisland/regal" :sha "d4e25e186f7b9705ebb3df6b21c90714d278efb7"}}}')
|
||||
|
||||
$ bb -e "(require '[lambdaisland.regal :as regal]) (regal/regex [:* \"ab\"])"
|
||||
#"(?:\Qab\E)*"
|
||||
|
|
@ -220,7 +179,7 @@ $ bb -e "(require '[lambdaisland.regal :as regal]) (regal/regex [:* \"ab\"])"
|
|||
|
||||
### [cprop](https://github.com/tolitius/cprop/)
|
||||
|
||||
A clojure configuration library. Latest test version: `"0.1.16"`.
|
||||
A clojure configuration libary. Latest test version: `"0.1.16"`.
|
||||
|
||||
### [comb](https://github.com/weavejester/comb)
|
||||
|
||||
|
|
@ -645,7 +604,7 @@ babashka. This may be fixed later if this turns out to be really useful.
|
|||
|
||||
### [crispin](https://github.com/dunaj-project/crispin)
|
||||
|
||||
Populate a configuration map from multiple sources (environment variables,
|
||||
Populate a configuration map from multiple sources (environment variables,
|
||||
system variables, config files, etc.)
|
||||
|
||||
Example:
|
||||
|
|
@ -674,170 +633,6 @@ FOO=1 script.clj
|
|||
|
||||
A wrapper around executing `ffmpeg` and `ffprobe`. Supports progress reporting via core.async channels.
|
||||
|
||||
### [multigrep](https://github.com/clj-commons/multigrep)
|
||||
|
||||
Regex-based file grepping and/or text substitution.
|
||||
|
||||
Example:
|
||||
- find the words that are exactly four letters long in some strings:
|
||||
```clj
|
||||
(ns multigrep-demo
|
||||
(:require [babashka.deps :as deps]
|
||||
[clojure.pprint :refer [pprint]])
|
||||
(:import (java.io StringReader)))
|
||||
|
||||
(deps/add-deps '{:deps {clj-commons/multigrep {:mvn/version "0.5.0"}}})
|
||||
|
||||
(require '[multigrep.core :as grep])
|
||||
|
||||
; the StringReaders could be anything that clojure.java.io/reader will accept (files, URLs, etc.)
|
||||
(let [sentence1 (StringReader. "the quick brown fox jumps over the lazy dog")
|
||||
sentence2 (StringReader. "Lorem ipsum dolor sit amet")]
|
||||
(pprint (grep/grep #"\b[a-z]{4}\b" [sentence1 sentence2])))
|
||||
```
|
||||
|
||||
outputs:
|
||||
```
|
||||
({:file
|
||||
#object[java.io.StringReader...],
|
||||
:line "the quick brown fox jumps over the lazy dog",
|
||||
:line-number 1,
|
||||
:regex #"\b[a-z]{4}\b",
|
||||
:re-seq ("over" "lazy")}
|
||||
{:file
|
||||
#object[java.io.StringReader...],
|
||||
:line "Lorem ipsum dolor sit amet",
|
||||
:line-number 1,
|
||||
:regex #"\b[a-z]{4}\b",
|
||||
:re-seq ("amet")})
|
||||
```
|
||||
|
||||
### [java-http-clj](https://github.com/schmee/java-http-clj)
|
||||
|
||||
Http client based on `java.net.http`.
|
||||
|
||||
### [component](https://github.com/stuartsierra/component)
|
||||
|
||||
A tiny Clojure framework for managing the lifecycle and dependencies of software components which have runtime state.
|
||||
|
||||
### [minimallist](https://github.com/green-coder/minimallist)
|
||||
|
||||
A minimalist data-driven data model library, inspired by Clojure Spec and Malli.
|
||||
|
||||
Example partially borrowed from [minimallist's cljdoc](https://cljdoc.org/d/minimallist/minimallist/CURRENT/doc/usage-in-babashka)
|
||||
|
||||
```clj
|
||||
(require '[babashka.deps :refer [add-deps]])
|
||||
|
||||
|
||||
(add-deps '{:deps {minimallist/minimallist {:git/url "https://github.com/green-coder/minimallist"
|
||||
:sha "b373bb18b8868526243735c760bdc67a88dd1e9a"}}})
|
||||
|
||||
(require '[minimallist.core :as m])
|
||||
(require '[minimallist.helper :as h])
|
||||
|
||||
(def contact (h/map [:name (h/fn string?)]
|
||||
[:phone (h/fn string?)]))
|
||||
(m/valid? contact {:name "Lucy" :phone "5551212"}) ;=> true
|
||||
(m/valid? contact {:name "Lucy" :phone 5551212}) ;=> false
|
||||
|
||||
(m/describe contact {:name "Lucy" :phone "5551212"}) ;=> {:valid? true, :entries {...}}
|
||||
(m/describe contact {:name "Lucy" :phone 5551212}) ;=> {:valid? false, :entries {... :phone {:valid? false...}}}
|
||||
|
||||
;; Does not work for now.
|
||||
;(require '[clojure.test.check.generators :as tcg])
|
||||
;(require '[minimallist.generator :as mg])
|
||||
;(tcg/sample (mg/gen (h/fn int?)))
|
||||
```
|
||||
|
||||
### [ruuter](https://github.com/askonomm/ruuter)
|
||||
|
||||
A zero-dependency router where each route is a map. Works with the httpkit server built into babashka.
|
||||
|
||||
### [clj-commons.digest](https://github.com/clj-commons/digest)
|
||||
|
||||
A message digest library, providing functions for MD5, SHA-1, SHA-256, etc.
|
||||
|
||||
### [contajners](https://github.com/lispyclouds/contajners)
|
||||
|
||||
An idiomatic, data-driven, REPL friendly clojure client for OCI container engines.
|
||||
|
||||
Example:
|
||||
|
||||
``` clojure
|
||||
#!/usr/bin/env bb
|
||||
|
||||
(require '[babashka.deps :as deps])
|
||||
|
||||
(deps/add-deps '{:deps {org.clojars.lispyclouds/contajners {:mvn/version "0.0.6"}}})
|
||||
|
||||
(require '[contajners.core :as c])
|
||||
|
||||
(def images-docker (c/client {:engine :docker
|
||||
:category :images
|
||||
:version "v1.41"
|
||||
:conn {:uri "unix:///var/run/docker.sock"}}))
|
||||
|
||||
; Pull an image
|
||||
(c/invoke images-docker {:op :ImageCreate
|
||||
:params {:fromImage "busybox:musl"}})
|
||||
|
||||
; list all images
|
||||
(c/invoke images-docker {:op :ImageList})
|
||||
```
|
||||
|
||||
### [dependency](https://github.com/stuartsierra/dependency)
|
||||
|
||||
Represent dependency graphs as a directed acylic graph.
|
||||
|
||||
### [specmonstah](https://github.com/reifyhealth/specmonstah)
|
||||
|
||||
Write concise, maintainable test fixtures with clojure.spec.alpha.
|
||||
|
||||
### [markdown-clj](https://github.com/yogthos/markdown-clj)
|
||||
|
||||
Markdown parser that translates markdown to html.
|
||||
|
||||
### [algo.monads](https://github.com/clojure/algo.monads)
|
||||
|
||||
Macros for defining monads, and definition of the most common monads.
|
||||
|
||||
### [datalog-parser](https://github.com/lambdaforge/datalog-parser)
|
||||
|
||||
Datalog parser that is compliant with datomic, datascript and datahike.
|
||||
|
||||
### [at-at](https://github.com/overtone/at-at)
|
||||
|
||||
Ahead-of-time function scheduler. Compatible with babashka 0.7.7+.
|
||||
|
||||
### [aysylu/loom](https://github.com/aysylu/loom)
|
||||
|
||||
Graph library for Clojure. Compatible with babashka 0.7.8+.
|
||||
|
||||
### [Clarktown](https://github.com/askonomm/clarktown)
|
||||
|
||||
An extensible and modular zero-dependency, pure-Clojure Markdown parser.
|
||||
|
||||
### [Malli](https://github.com/metosin/malli#babashka)
|
||||
|
||||
Data-Driven Schemas for Clojure/Script
|
||||
|
||||
### [Meander](https://github.com/noprompt/meander)
|
||||
|
||||
Tools for transparent data transformation
|
||||
|
||||
### [Schema](https://github.com/plumatic/schema)
|
||||
|
||||
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
|
||||
|
||||
[Babashka pods](https://github.com/babashka/babashka.pods) are programs that can
|
||||
|
|
@ -905,7 +700,7 @@ A babashka script to obtain covid-19 related information.
|
|||
|
||||
### [bb-spotify](https://github.com/kolharsam/bb-spotify)
|
||||
|
||||
Control your spotify player using babashka.
|
||||
Contol your spotify player using babashka.
|
||||
|
||||
### [lambdaisland/open-source](https://github.com/lambdaisland/open-source)
|
||||
|
||||
|
|
@ -949,24 +744,3 @@ A collection of useful scripts. Mainly written with Clojure/babashka
|
|||
Tired of being forced to use the browser every time you need to refresh an OIDC token to authenticate with a backend service? Finally there is a CLI tool for that - the babashka and Docker powered oidc_client.clj.
|
||||
|
||||
Upon first invocation it opens up a browser for the OIDC provider login, thereafter it caches the refresh token and uses it as long as it remains valid.
|
||||
|
||||
### [jirazzz](https://github.com/rwstauner/jirazzz)
|
||||
|
||||
A babashka JIRA client by Randy Stauner
|
||||
|
||||
### [Babashka + scittle guestbook](https://github.com/kloimhardt/babashka-scittle-guestbook)
|
||||
|
||||
Luminus guestbook example for Babashka + Scittle.
|
||||
|
||||
### [bb htmx todo app](https://github.com/prestancedesign/babashka-htmx-todoapp)
|
||||
|
||||
Quick example of a todo list SPA using Babashka and htmx.
|
||||
|
||||
### [bb aws lambda runtime](https://github.com/tatut/bb-lambda)
|
||||
|
||||
AWS Lambda custom runtime for Babashka scripts.
|
||||
|
||||
### [bb-github-app](https://github.com/brandonstubbs/bb-github-app)
|
||||
|
||||
An example Babashka script that can authenticate as a Github Application,
|
||||
this example focuses on the checks api.
|
||||
|
|
|
|||
|
|
@ -36,11 +36,6 @@
|
|||
- [Check stdin for data](#check-stdin-for-data)
|
||||
- [Using org.clojure/data.xml](#using-orgclojuredataxml)
|
||||
- [Simple logger](#simple-logger)
|
||||
- [Using GZip streams (memo utility)](#using-gzip-streams-to-make-a-note-utility)
|
||||
- [Pretty-printing mySQL results](#pretty-printing-mysql-results)
|
||||
- [Single page application with Babashka + htmx](#single-page-application-with-babashka--htmx)
|
||||
- [Wikipedia translation](#wikipedia-translation)
|
||||
|
||||
|
||||
Here's a gallery of useful examples. Do you have a useful example? PR welcome!
|
||||
|
||||
|
|
@ -392,7 +387,7 @@ Example usage:
|
|||
$ examples/http-server.clj
|
||||
```
|
||||
|
||||
See [http-server.clj](http-server.clj).
|
||||
See [file-server.clj](file-server.clj).
|
||||
|
||||
## Torrent viewer
|
||||
|
||||
|
|
@ -527,44 +522,3 @@ $ bb examples/xml-example.clj
|
|||
$ bb "(require 'logger) (logger/log \"the logger says hi\")"
|
||||
<expr>:1:19 the logger says hi
|
||||
```
|
||||
|
||||
## Using GZip streams to make a note utility
|
||||
|
||||
[memo.clj](memo.clj) creates zip files in /tmp for stashing notes (possibly the most inefficient KV store ever)
|
||||
|
||||
```shell
|
||||
$ echo "8675309" | memo.clj put jenny
|
||||
ok
|
||||
$ memo.clj get jenny
|
||||
8675309
|
||||
```
|
||||
|
||||
## Pretty-printing mySQL results
|
||||
|
||||
[db_who.clj](db_who.clj) will query mysql for all the connected sessions and pretty-print the user and what program they're using.
|
||||
|
||||
```
|
||||
$ bb db_who.clj
|
||||
| user | program_name |
|
||||
|------------------+----------------|
|
||||
| root@localhost | mysql |
|
||||
| fred@192.168.1.2 | workbench |
|
||||
| jane@192.168.1.3 | Toad for mySQL |
|
||||
```
|
||||
## Single page application with Babashka + htmx
|
||||
|
||||
Example of a todo list SPA using Babashka and htmx
|
||||
See [htmx_todoapp.clj](htmx_todoapp.clj)
|
||||
|
||||
Contributed by [@prestancedesign](https://github.com/prestancedesign).
|
||||
|
||||
## Wikipedia translation
|
||||
|
||||
[wiki-translate.clj](wiki-translate.clj) uses Wikipedia to translate words from English to Dutch (other languages are available).
|
||||
|
||||
``` shell
|
||||
$ bb wiki-translate.clj window
|
||||
"Venster (muur) – Dutch"
|
||||
```
|
||||
|
||||
Shared by Janne Himanka on Clojurians Slack
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
(ns db-who
|
||||
(:require [clojure.java.shell :as shell]
|
||||
[clojure.string :as str]
|
||||
[clojure.pprint :as pp]))
|
||||
(defn tsv->maps [tsv]
|
||||
(let [lines (str/split-lines tsv)
|
||||
[headers & rows] (map #(str/split % #"\t") lines)]
|
||||
(map #(zipmap headers %) rows)))
|
||||
|
||||
(-> (shell/sh "mysql" "--column-names" "-e" "select user, program_name from sys.session;")
|
||||
:out tsv->maps pp/print-table)
|
||||
|
|
@ -1,240 +0,0 @@
|
|||
#!/usr/bin/env bb
|
||||
;; Source: https://github.com/prestancedesign/babashka-htmx-todoapp
|
||||
|
||||
(require '[org.httpkit.server :as srv]
|
||||
'[clojure.java.browse :as browse]
|
||||
'[clojure.core.match :refer [match]]
|
||||
'[clojure.pprint :refer [cl-format]]
|
||||
'[clojure.string :as str]
|
||||
'[hiccup.core :as h])
|
||||
|
||||
(import '[java.net URLDecoder])
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Config
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def port 3000)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Mimic DB (in-memory)
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def todos (atom (sorted-map 1 {:id 1 :name "Taste htmx with Babashka" :done true}
|
||||
2 {:id 2 :name "Buy a unicorn" :done false})))
|
||||
|
||||
(def todos-id (atom (count @todos)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; "DB" queries
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn add-todo! [name]
|
||||
(let [id (swap! todos-id inc)]
|
||||
(swap! todos assoc id {:id id :name name :done false})))
|
||||
|
||||
(defn toggle-todo! [id]
|
||||
(swap! todos update-in [(Integer. id) :done] not))
|
||||
|
||||
(defn remove-todo! [id]
|
||||
(swap! todos dissoc (Integer. id)))
|
||||
|
||||
(defn filtered-todo [filter-name todos]
|
||||
(case filter-name
|
||||
"active" (remove #(:done (val %)) todos)
|
||||
"completed" (filter #(:done (val %)) todos)
|
||||
"all" todos
|
||||
todos))
|
||||
|
||||
(defn get-items-left []
|
||||
(count (remove #(:done (val %)) @todos)))
|
||||
|
||||
(defn todos-completed []
|
||||
(count (filter #(:done (val %)) @todos)))
|
||||
|
||||
(defn remove-all-completed-todo []
|
||||
(reset! todos (into {} (remove #(:done (val %)) @todos))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Template and components
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn todo-item [{:keys [id name done]}]
|
||||
[:li {:id (str "todo-" id)
|
||||
:class (when done "completed")}
|
||||
[:div.view
|
||||
[:input.toggle {:hx-patch (str "/todos/" id)
|
||||
:type "checkbox"
|
||||
:checked done
|
||||
:hx-target (str "#todo-" id)
|
||||
:hx-swap "outerHTML"}]
|
||||
[:label {:hx-get (str "/todos/edit/" id)
|
||||
:hx-target (str "#todo-" id)
|
||||
:hx-swap "outerHTML"} name]
|
||||
[:button.destroy {:hx-delete (str "/todos/" id)
|
||||
:_ (str "on htmx:afterOnLoad remove #todo-" id)}]]])
|
||||
|
||||
(defn todo-list [todos]
|
||||
(for [todo todos]
|
||||
(todo-item (val todo))))
|
||||
|
||||
(defn todo-edit [id name]
|
||||
[:form {:hx-post (str "/todos/update/" id)}
|
||||
[:input.edit {:type "text"
|
||||
:name "name"
|
||||
:value name}]])
|
||||
|
||||
(defn item-count []
|
||||
(let [items-left (get-items-left)]
|
||||
[:span#todo-count.todo-count {:hx-swap-oob "true"}
|
||||
[:strong items-left] (cl-format nil " item~p " items-left) "left"]))
|
||||
|
||||
(defn todo-filters [filter]
|
||||
[:ul#filters.filters {:hx-swap-oob "true"}
|
||||
[:li [:a {:hx-get "/?filter=all"
|
||||
:hx-push-url "true"
|
||||
:hx-target "#todo-list"
|
||||
:class (when (= filter "all") "selected")} "All"]]
|
||||
[:li [:a {:hx-get "/?filter=active"
|
||||
:hx-push-url "true"
|
||||
:hx-target "#todo-list"
|
||||
:class (when (= filter "active") "selected")} "Active"]]
|
||||
[:li [:a {:hx-get "/?filter=completed"
|
||||
:hx-push-url "true"
|
||||
:hx-target "#todo-list"
|
||||
:class (when (= filter "completed") "selected")} "Completed"]]])
|
||||
|
||||
(defn clear-completed-button []
|
||||
[:button#clear-completed.clear-completed
|
||||
{:hx-delete "/todos"
|
||||
:hx-target "#todo-list"
|
||||
:hx-swap-oob "true"
|
||||
:hx-push-url "/"
|
||||
:class (when-not (pos? (todos-completed)) "hidden")}
|
||||
"Clear completed"])
|
||||
|
||||
(defn template [filter]
|
||||
(str
|
||||
"<!DOCTYPE html>"
|
||||
(h/html
|
||||
[:head
|
||||
[:meta {:charset "UTF-8"}]
|
||||
[:title "Htmx + Babashka"]
|
||||
[:link {:href "https://unpkg.com/todomvc-app-css@2.4.1/index.css" :rel "stylesheet"}]
|
||||
[:script {:src "https://unpkg.com/htmx.org@1.5.0/dist/htmx.min.js" :defer true}]
|
||||
[:script {:src "https://unpkg.com/hyperscript.org@0.8.1/dist/_hyperscript.min.js" :defer true}]]
|
||||
[:body
|
||||
[:section.todoapp
|
||||
[:header.header
|
||||
[:h1 "todos"]
|
||||
[:form
|
||||
{:hx-post "/todos"
|
||||
:hx-target "#todo-list"
|
||||
:hx-swap "beforeend"
|
||||
:_ "on htmx:afterOnLoad set #txtTodo.value to ''"}
|
||||
[:input#txtTodo.new-todo
|
||||
{:name "todo"
|
||||
:placeholder "What needs to be done?"
|
||||
:autofocus ""}]]]
|
||||
[:section.main
|
||||
[:input#toggle-all.toggle-all {:type "checkbox"}]
|
||||
[:label {:for "toggle-all"} "Mark all as complete"]]
|
||||
[:ul#todo-list.todo-list
|
||||
(todo-list (filtered-todo filter @todos))]
|
||||
[:footer.footer
|
||||
(item-count)
|
||||
(todo-filters filter)
|
||||
(clear-completed-button)]]
|
||||
[:footer.info
|
||||
[:p "Click to edit a todo"]
|
||||
[:p "Created by "
|
||||
[:a {:href "https://twitter.com/PrestanceDesign"} "Michaël Sλlihi"]]
|
||||
[:p "Part of "
|
||||
[:a {:href "http://todomvc.com"} "TodoMVC"]]]])))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Helpers
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn parse-body [body]
|
||||
(-> body
|
||||
slurp
|
||||
(str/split #"=")
|
||||
second
|
||||
URLDecoder/decode))
|
||||
|
||||
(defn parse-query-string [query-string]
|
||||
(when query-string
|
||||
(-> query-string
|
||||
(str/split #"=")
|
||||
second)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Handlers
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn app-index [{:keys [query-string headers]}]
|
||||
(let [filter (parse-query-string query-string)
|
||||
ajax-request? (get headers "hx-request")]
|
||||
(if (and filter ajax-request?)
|
||||
(h/html (todo-list (filtered-todo filter @todos))
|
||||
(todo-filters filter))
|
||||
(template filter))))
|
||||
|
||||
(defn add-item [{body :body}]
|
||||
(let [name (parse-body body)
|
||||
todo (add-todo! name)]
|
||||
(h/html (todo-item (val (last todo)))
|
||||
(item-count))))
|
||||
|
||||
(defn edit-item [id]
|
||||
(let [{:keys [id name]} (get @todos (Integer. id))]
|
||||
(h/html (todo-edit id name))))
|
||||
|
||||
(defn update-item [{body :body} id]
|
||||
(let [name (parse-body body)
|
||||
todo (swap! todos assoc-in [(Integer. id) :name] name)]
|
||||
(h/html (todo-item (get todo (Integer. id))))))
|
||||
|
||||
(defn patch-item [id]
|
||||
(let [todo (toggle-todo! id)]
|
||||
(h/html (todo-item (get todo (Integer. id)))
|
||||
(item-count)
|
||||
(clear-completed-button))))
|
||||
|
||||
(defn delete-item [id]
|
||||
(remove-todo! id)
|
||||
(h/html (item-count)))
|
||||
|
||||
(defn clear-completed []
|
||||
(remove-all-completed-todo)
|
||||
(h/html (todo-list @todos)
|
||||
(item-count)
|
||||
(clear-completed-button)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Routes
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn routes [{:keys [request-method uri] :as req}]
|
||||
(let [path (vec (rest (str/split uri #"/")))]
|
||||
(match [request-method path]
|
||||
[:get []] {:body (app-index req)}
|
||||
[:get ["todos" "edit" id]] {:body (edit-item id)}
|
||||
[:post ["todos"]] {:body (add-item req)}
|
||||
[:post ["todos" "update" id]] {:body (update-item req id)}
|
||||
[:patch ["todos" id]] {:body (patch-item id)}
|
||||
[:delete ["todos" id]] {:body (delete-item id)}
|
||||
[:delete ["todos"]] {:body (clear-completed)}
|
||||
:else {:status 404 :body "Error 404: Page not found"})))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Server
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(let [url (str "http://localhost:" port "/")]
|
||||
(srv/run-server #'routes {:port port})
|
||||
(println "serving" url)
|
||||
(browse/browse-url url)
|
||||
@(promise)))
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
#_" -*- mode: clojure; -*-"
|
||||
;; Source: https://gist.github.com/holyjak/36c6284c047ffb7573e8a34399de27d8
|
||||
|
||||
;; Based on https://github.com/babashka/babashka/blob/master/examples/image-viewer.clj
|
||||
;; Based on https://github.com/babashka/babashka/blob/master/examples/image_viewer.clj
|
||||
(ns http-server
|
||||
(:require [babashka.fs :as fs]
|
||||
[clojure.java.browse :as browse]
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(defn stash [file-name]
|
||||
(with-open [os (java.util.zip.GZIPOutputStream. (io/output-stream (str "/tmp/" file-name ".zip")))]
|
||||
(.write os (.getBytes (slurp *in*)))
|
||||
(.finish os))
|
||||
'ok)
|
||||
|
||||
(defn unstash [file-name]
|
||||
(print (slurp (java.util.zip.GZIPInputStream. (io/input-stream (str "/tmp/" file-name ".zip"))))))
|
||||
|
||||
(let [[action stash-name] *command-line-args*]
|
||||
(case action
|
||||
"put" (stash stash-name)
|
||||
"get" (unstash stash-name)
|
||||
(println "Invalid op:" action)))
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
(ns normalize-keywords
|
||||
(:require [babashka.pods :as pods]
|
||||
[clojure.java.io :as io]
|
||||
[rewrite-clj.node :as node]
|
||||
[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])
|
||||
|
||||
(def code (first *command-line-args*))
|
||||
|
||||
(defn findings [file-path]
|
||||
(->> (clj-kondo/run! {:lint [file-path]
|
||||
:config {:output {:analysis {:keywords true}}}})
|
||||
(def findings
|
||||
(->> (with-in-str code
|
||||
(clj-kondo/run! {:lint [code]
|
||||
:config {:output {:analysis {:keywords true}}}}))
|
||||
:analysis
|
||||
:keywords
|
||||
(filter (some-fn :alias :auto-resolved))))
|
||||
|
|
@ -33,11 +33,6 @@
|
|||
zloc (z/replace zloc (node/coerce k))]
|
||||
(recur zloc (next findings)))
|
||||
(recur (z/next zloc) findings)))
|
||||
(str (z/root zloc)))))
|
||||
(println (str (z/root zloc))))))
|
||||
|
||||
(doseq [f (file-seq (io/file code))
|
||||
: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'))))
|
||||
(remove-locs (z/of-file code) findings)
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
#!/usr/bin/env bb
|
||||
;; by Janne Himanka shared on Clojurians Slack
|
||||
(require '[babashka.curl :as curl])
|
||||
|
||||
(let [url (str "https://en.wikipedia.org/wiki/" (first *command-line-args*))
|
||||
page (:body (curl/get url))]
|
||||
(cond
|
||||
(re-find #"Disambiguation" page)
|
||||
(doseq [item (map last (re-seq #"<li><a href...wiki/([^\"]+)" page))]
|
||||
(println item))
|
||||
:else (last (re-find #"nl.wikipedia.org/.+?title..([^\"]+)" page))))
|
||||
109
feature-core-async/babashka/impl/async.clj
Normal file
109
feature-core-async/babashka/impl/async.clj
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
(ns babashka.impl.async
|
||||
{:no-doc true}
|
||||
(:require [clojure.core.async :as async]
|
||||
[clojure.core.async.impl.protocols :as protocols]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def ^java.util.concurrent.Executor executor @#'async/thread-macro-executor)
|
||||
|
||||
(defn thread-call
|
||||
"Executes f in another thread, returning immediately to the calling
|
||||
thread. Returns a channel which will receive the result of calling
|
||||
f when completed, then close."
|
||||
[f]
|
||||
(let [c (async/chan 1)]
|
||||
(let [binds (vars/get-thread-binding-frame)]
|
||||
(.execute executor
|
||||
(fn []
|
||||
(vars/reset-thread-binding-frame binds)
|
||||
(try
|
||||
(let [ret (f)]
|
||||
(when-not (nil? ret)
|
||||
(async/>!! c ret)))
|
||||
(finally
|
||||
(async/close! c))))))
|
||||
c))
|
||||
|
||||
(defn thread
|
||||
[_ _ & body]
|
||||
`(~'clojure.core.async/thread-call (fn [] ~@body)))
|
||||
|
||||
(defn alt!!
|
||||
"Like alt!, except as if by alts!!, will block until completed, and
|
||||
not intended for use in (go ...) blocks."
|
||||
[_ _ & clauses]
|
||||
(async/do-alt 'clojure.core.async/alts!! clauses))
|
||||
|
||||
(defn go-loop
|
||||
[_ _ bindings & body]
|
||||
(list 'clojure.core.async/thread (list* 'loop bindings body)))
|
||||
|
||||
(def async-namespace
|
||||
{'<!! async/<!!
|
||||
'>!! async/>!!
|
||||
'admix async/admix
|
||||
'alts! async/alts!
|
||||
'alts!! async/alts!!
|
||||
'alt!! (with-meta alt!! {:sci/macro true})
|
||||
'buffer async/buffer
|
||||
'chan async/chan
|
||||
'close! async/close!
|
||||
'do-alt async/do-alt
|
||||
'do-alts async/do-alts
|
||||
'dropping-buffer async/dropping-buffer
|
||||
'filter< async/filter<
|
||||
'filter> async/filter>
|
||||
'into async/into
|
||||
'map async/map
|
||||
'map< async/map<
|
||||
'map> async/map>
|
||||
'mapcat< async/mapcat<
|
||||
'mapcat> async/mapcat>
|
||||
'merge async/merge
|
||||
'mix async/mix
|
||||
'mult async/mult
|
||||
'offer! async/offer!
|
||||
'onto-chan async/onto-chan
|
||||
'partition async/partition
|
||||
'partition-by async/partition-by
|
||||
'pipe async/pipe
|
||||
'pipeline async/pipeline
|
||||
'pipeline-async async/pipeline-async
|
||||
'pipeline-blocking async/pipeline-blocking
|
||||
'poll! async/poll!
|
||||
'promise-chan async/promise-chan
|
||||
'pub async/pub
|
||||
'put! async/put!
|
||||
'reduce async/reduce
|
||||
'remove< async/remove<
|
||||
'remove> async/remove>
|
||||
'sliding-buffer async/sliding-buffer
|
||||
'solo-mode async/solo-mode
|
||||
'split async/split
|
||||
'sub async/sub
|
||||
'take async/take
|
||||
'take! async/take!
|
||||
'tap async/tap
|
||||
'thread (with-meta thread {:sci/macro true})
|
||||
'thread-call thread-call
|
||||
'timeout async/timeout
|
||||
'to-chan async/to-chan
|
||||
'toggle async/toggle
|
||||
'transduce async/transduce
|
||||
'unblocking-buffer? async/unblocking-buffer?
|
||||
'unique async/unique
|
||||
'unmix async/unmix
|
||||
'unmix-all async/unmix-all
|
||||
'unsub async/unsub
|
||||
'unsub-all async/unsub-all
|
||||
'untap async/untap
|
||||
'untap-all async/untap-all
|
||||
;; polyfill
|
||||
'go (with-meta thread {:sci/macro true})
|
||||
'<! async/<!!
|
||||
'>! async/>!!
|
||||
'alt! (with-meta alt!! {:sci/macro true})
|
||||
'go-loop (with-meta go-loop {:sci/macro true})})
|
||||
|
||||
(def async-protocols-namespace
|
||||
{'ReadPort protocols/ReadPort})
|
||||
|
|
@ -1,10 +1,7 @@
|
|||
(ns babashka.impl.csv
|
||||
{:no-doc true}
|
||||
(:require [clojure.data.csv :as csv]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def cns (sci/create-ns 'clojure.data.csv nil))
|
||||
(:require [clojure.data.csv :as csv]))
|
||||
|
||||
(def csv-namespace
|
||||
{'read-csv (sci/copy-var csv/read-csv cns)
|
||||
'write-csv (sci/copy-var csv/write-csv cns)})
|
||||
{'read-csv csv/read-csv
|
||||
'write-csv csv/write-csv})
|
||||
|
|
|
|||
|
|
@ -1,26 +1,12 @@
|
|||
(ns babashka.impl.datascript
|
||||
{:no-doc true}
|
||||
(:require [datascript.core :as d]
|
||||
[datascript.db :as db]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def datascript-ns (sci/create-ns 'datascript.core nil))
|
||||
(def datascript-db-ns (sci/create-ns 'datascript.db nil))
|
||||
(def datascript-ns (vars/->SciNamespace 'datascript.core nil))
|
||||
|
||||
(def datascript-namespace
|
||||
{'create-conn (copy-var d/create-conn datascript-ns)
|
||||
'transact! (copy-var d/transact! datascript-ns)
|
||||
'q (copy-var d/q datascript-ns)
|
||||
'empty-db (copy-var d/empty-db datascript-ns)
|
||||
'db-with (copy-var d/db-with datascript-ns)
|
||||
'filter (copy-var d/filter datascript-ns)
|
||||
'init-db (copy-var d/init-db datascript-ns)
|
||||
'datom (copy-var d/datom datascript-ns)
|
||||
'pull (copy-var d/pull datascript-ns)
|
||||
'pull-many (copy-var d/pull-many datascript-ns)})
|
||||
|
||||
(def datascript-db-namespace
|
||||
{'db-from-reader (copy-var db/db-from-reader datascript-db-ns)
|
||||
'datom-from-reader (copy-var db/datom-from-reader datascript-db-ns)
|
||||
'datom-added (copy-var db/datom-added datascript-db-ns)
|
||||
'datom-tx (copy-var db/datom-tx datascript-db-ns)})
|
||||
'q (copy-var d/q datascript-ns)})
|
||||
|
|
|
|||
|
|
@ -52,11 +52,10 @@
|
|||
util/raw-string)
|
||||
|
||||
(def hiccup-namespace
|
||||
{'html (copy-var html-1 hns {:name 'html})})
|
||||
{'html (copy-var html-1 hns)})
|
||||
|
||||
(def hiccup2-namespace
|
||||
{'html (copy-var html-2 hns2 {:name 'html})
|
||||
'raw (copy-var util/raw-string hns2 {:name 'raw})})
|
||||
{'html (copy-var html-2 hns2)})
|
||||
|
||||
(def html-mode (copy-var util/*html-mode* uns))
|
||||
(def escape-strings? (copy-var util/*escape-strings?* uns))
|
||||
|
|
@ -64,8 +63,7 @@
|
|||
(def hiccup-util-namespace
|
||||
{'*html-mode* html-mode
|
||||
'*escape-strings?* escape-strings?
|
||||
'raw-string (copy-var util/raw-string uns)
|
||||
'to-uri (copy-var util/to-uri uns)})
|
||||
'raw-string (copy-var util/raw-string uns)})
|
||||
|
||||
(defn render-html [& contents]
|
||||
(binding [util/*html-mode* @html-mode
|
||||
|
|
|
|||
|
|
@ -72,10 +72,8 @@
|
|||
'acl (copy-var acl cns)
|
||||
'unlock (copy-var unlock cns)
|
||||
'default-client (copy-var client/default-client cns)
|
||||
'*default-client* default-client
|
||||
'query-string (copy-var client/query-string cns)
|
||||
'url-encode (copy-var client/url-encode cns)})
|
||||
'*default-client* default-client})
|
||||
|
||||
(def sni-client-namespace
|
||||
{'ssl-configurer (copy-var sni-client/ssl-configurer sns)
|
||||
'default-client (sci/new-var 'default-client sni-client {:ns sns})})
|
||||
'default-client (sci/new-var 'sni-client sni-client {:ns sns})})
|
||||
|
|
|
|||
|
|
@ -8,15 +8,10 @@
|
|||
{:obj sns
|
||||
'server-stop! (copy-var server/server-stop! sns)
|
||||
'server-port (copy-var server/server-port sns)
|
||||
'server-status (copy-var server/server-status sns)
|
||||
'run-server (copy-var server/run-server sns)
|
||||
'sec-websocket-accept (copy-var server/sec-websocket-accept sns)
|
||||
'websocket-handshake-check (copy-var server/websocket-handshake-check sns)
|
||||
'send-checked-websocket-handshake! (copy-var server/send-checked-websocket-handshake! sns)
|
||||
'send-websocket-handshake! (copy-var server/send-websocket-handshake! sns)
|
||||
'as-channel (copy-var server/as-channel 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)}
|
||||
)
|
||||
'send! (copy-var server/send! sns)})
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
(ns babashka.impl.jdbc
|
||||
{:no-doc true}
|
||||
(:require
|
||||
[next.jdbc :as njdbc]
|
||||
[next.jdbc.result-set :as rs]
|
||||
[next.jdbc.sql :as sql]
|
||||
[sci.core :as sci]))
|
||||
(:require [next.jdbc :as njdbc]
|
||||
[next.jdbc.sql :as sql]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def next-ns (sci/create-ns 'next.jdbc nil))
|
||||
(def next-ns (vars/->SciNamespace 'next.jdbc nil))
|
||||
|
||||
(defn with-transaction
|
||||
"Given a transactable object, gets a connection and binds it to `sym`,
|
||||
|
|
@ -19,30 +18,20 @@
|
|||
* `:rollback-only` -- `true` / `false`."
|
||||
[_ _ [sym transactable opts] & body]
|
||||
(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
|
||||
{'get-datasource (sci/copy-var njdbc/get-datasource next-ns)
|
||||
'execute! (sci/copy-var njdbc/execute! next-ns)
|
||||
'execute-one! (sci/copy-var njdbc/execute-one! next-ns)
|
||||
'get-connection (sci/copy-var njdbc/get-connection next-ns)
|
||||
'plan (sci/copy-var njdbc/plan next-ns)
|
||||
'prepare (sci/copy-var njdbc/prepare next-ns)
|
||||
'transact (sci/copy-var njdbc/transact next-ns)
|
||||
'with-transaction (sci/copy-var with-transaction next-ns)})
|
||||
{'get-datasource (copy-var njdbc/get-datasource next-ns)
|
||||
'execute! (copy-var njdbc/execute! next-ns)
|
||||
'execute-one! (copy-var njdbc/execute-one! next-ns)
|
||||
'get-connection (copy-var njdbc/get-connection next-ns)
|
||||
'plan (copy-var njdbc/plan next-ns)
|
||||
'prepare (copy-var njdbc/prepare next-ns)
|
||||
'transact (copy-var njdbc/transact next-ns)
|
||||
'with-transaction (with-meta with-transaction
|
||||
{:sci/macro true})})
|
||||
|
||||
(def sns (sci/create-ns 'next.jdbc.sql nil))
|
||||
(def sns (vars/->SciNamespace 'next.jdbc.sql nil))
|
||||
|
||||
(def next-sql-namespace
|
||||
{'insert-multi! (sci/copy-var sql/insert-multi! sns)})
|
||||
|
||||
(def rsns (sci/create-ns 'next.jdbc.result-set nil))
|
||||
|
||||
(def result-set-namespace
|
||||
{'as-maps (sci/copy-var rs/as-maps rsns)
|
||||
'as-unqualified-maps (sci/copy-var rs/as-unqualified-maps rsns)
|
||||
'as-modified-maps (sci/copy-var rs/as-modified-maps rsns)
|
||||
'as-unqualified-modified-maps (sci/copy-var rs/as-unqualified-modified-maps rsns)
|
||||
'as-lower-maps (sci/copy-var rs/as-lower-maps rsns)
|
||||
'as-unqualified-lower-maps (sci/copy-var rs/as-unqualified-lower-maps rsns)
|
||||
'as-maps-adapter (sci/copy-var rs/as-maps-adapter rsns)})
|
||||
{'insert-multi! (copy-var sql/insert-multi! sns)})
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
(def tns (sci/create-ns 'lanterna.terminal nil))
|
||||
(def sns (sci/create-ns 'lanterna.screen nil))
|
||||
(def cns (sci/create-ns 'lanterna.constants nil))
|
||||
(def cns (sci/create-ns 'lanterna.screen nil))
|
||||
|
||||
(def lanterna-terminal-namespace
|
||||
{'add-resize-listener (copy-var lanterna.terminal/add-resize-listener tns)
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
(ns babashka.impl.priority-map
|
||||
(:require [clojure.data.priority-map :as pm]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def pmns (sci/create-ns 'clojure.data.priority-map))
|
||||
|
||||
(def priority-map-namespace
|
||||
{'priority-map (sci/copy-var pm/priority-map pmns)
|
||||
'priority-map-keyfn (sci/copy-var pm/priority-map-keyfn pmns)
|
||||
'subseq (sci/copy-var pm/subseq pmns)
|
||||
'rsubseq (sci/copy-var pm/rsubseq pmns)})
|
||||
67
feature-rewrite-clj/babashka/impl/rewrite_clj.clj
Normal file
67
feature-rewrite-clj/babashka/impl/rewrite_clj.clj
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
(ns babashka.impl.rewrite-clj
|
||||
{:no-doc true}
|
||||
(:require [rewrite-clj.node]
|
||||
[rewrite-clj.paredit]
|
||||
[rewrite-clj.parser]
|
||||
[rewrite-clj.zip]
|
||||
[rewrite-clj.zip.subedit]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def nns (sci/create-ns 'rewrite-clj.node nil))
|
||||
(def pens (sci/create-ns 'rewrite-clj.paredit nil))
|
||||
(def pns (sci/create-ns 'rewrite-clj.parser nil))
|
||||
(def zns (sci/create-ns 'rewrite-clj.zip nil))
|
||||
(def zsns (sci/create-ns 'rewrite-clj.zip.subedit nil))
|
||||
|
||||
#_(defmacro copy-var
|
||||
"Copies contents from var `sym` to a new sci var. The value `ns` is an
|
||||
object created with `sci.core/create-ns`."
|
||||
([sym ns]
|
||||
`(let [ns# ~ns
|
||||
var# (var ~sym)
|
||||
val# (deref var#)
|
||||
m# (-> var# meta)
|
||||
ns-name# (vars/getName ns#)
|
||||
name# (:name m#)
|
||||
name-sym# (symbol (str ns-name#) (str name#))
|
||||
new-m# {:doc (:doc m#)
|
||||
:name name#
|
||||
:arglists (:arglists m#)
|
||||
:ns ns#}]
|
||||
(cond (:dynamic m#)
|
||||
(new-dynamic-var name# val# new-m#)
|
||||
(:macro m#)
|
||||
(new-macro-var name# val# new-m#)
|
||||
:else (new-var name# val# new-m#)))))
|
||||
|
||||
(defn make-ns [ns sci-ns]
|
||||
(reduce (fn [ns-map [var-name var]]
|
||||
(let [m (meta var)
|
||||
no-doc (:no-doc m)
|
||||
doc (:doc m)
|
||||
arglists (:arglists m)]
|
||||
(if no-doc ns-map
|
||||
(assoc ns-map var-name
|
||||
(sci/new-var (symbol var-name) @var
|
||||
(cond-> {:ns sci-ns
|
||||
:name (:name m)}
|
||||
(:macro m) (assoc :macro true)
|
||||
doc (assoc :doc doc)
|
||||
arglists (assoc :arglists arglists)))))))
|
||||
{}
|
||||
(ns-publics ns)))
|
||||
|
||||
(def node-namespace
|
||||
(make-ns 'rewrite-clj.node nns))
|
||||
|
||||
(def parser-namespace
|
||||
(make-ns 'rewrite-clj.parser pns))
|
||||
|
||||
(def paredit-namespace
|
||||
(make-ns 'rewrite-clj.paredit pens))
|
||||
|
||||
(def zip-namespace
|
||||
(make-ns 'rewrite-clj.zip zns))
|
||||
|
||||
(def subedit-namespace
|
||||
(make-ns 'rewrite-clj.zip.subedit zsns))
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
(ns babashka.impl.rrb-vector
|
||||
(:require [clojure.core.rrb-vector :as rrb]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def rrbns (sci/create-ns 'clojure.core.rrb-vector))
|
||||
|
||||
(def rrb-vector-namespace {'catvec (sci/copy-var rrb/catvec rrbns)})
|
||||
|
|
@ -4,7 +4,6 @@
|
|||
[babashka.impl.common :refer [ctx]]
|
||||
[sci.core :as sci]
|
||||
[selmer.filters :as filters]
|
||||
[selmer.filter-parser :as fp]
|
||||
[selmer.parser]
|
||||
[selmer.tags :as tags]
|
||||
[selmer.util :as util]
|
||||
|
|
@ -61,7 +60,7 @@
|
|||
(selmer.parser/render-template template context-map)))
|
||||
|
||||
(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]
|
||||
(if (instance? clojure.lang.IDeref x) @x x))
|
||||
|
|
@ -84,31 +83,12 @@
|
|||
(apply merge)
|
||||
(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
|
||||
(-> selmer-parser-ns
|
||||
(assoc 'render-file (sci/copy-var render-file spns)
|
||||
'render (sci/copy-var render spns)
|
||||
'render-template (sci/copy-var render-template 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))))
|
||||
|
||||
(def stns (sci/create-ns 'selmer.tags nil))
|
||||
|
|
@ -125,9 +105,7 @@
|
|||
|
||||
(def selmer-filters-namespace
|
||||
{'add-filter! (sci/copy-var filters/add-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)})
|
||||
'remove-filter! (sci/copy-var filters/remove-filter! sfns)})
|
||||
|
||||
(defn turn-off-escaping! []
|
||||
(sci/alter-var-root escape-variables (constantly false)))
|
||||
|
|
|
|||
|
|
@ -4,11 +4,12 @@
|
|||
[babashka.impl.clojure.spec.gen.alpha :as gen]
|
||||
[babashka.impl.clojure.spec.test.alpha :as test]
|
||||
[clojure.core :as c]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
[sci.core :as sci :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def sns (sci/create-ns 'clojure.spec.alpha nil))
|
||||
(def tns (sci/create-ns 'clojure.spec.test.alpha nil))
|
||||
(def gns (sci/create-ns 'clojure.spec.gen.alpha nil))
|
||||
(def sns (vars/->SciNamespace 'clojure.spec.alpha nil))
|
||||
(def tns (vars/->SciNamespace 'clojure.spec.test.alpha nil))
|
||||
(def gns (vars/->SciNamespace 'clojure.spec.gen.alpha nil))
|
||||
|
||||
(defn- ns-qualify
|
||||
"Qualify symbol s by resolving it or using the current *ns*."
|
||||
|
|
|
|||
|
|
@ -174,26 +174,4 @@
|
|||
(println (str "'" k) (format "(sci/copy-var tc/%s p-ns)" k)))
|
||||
|
||||
(def test-check-namespace
|
||||
{'quick-check (sci/copy-var tc/quick-check tc-ns)})
|
||||
|
||||
#_(require '[clojure.test.check.clojure-test :as tct])
|
||||
|
||||
#_(def tct-ns (sci/create-ns 'clojure.test.check nil))
|
||||
|
||||
#_(doseq [k (sort (keys (ns-publics 'clojure.test.check.clojure-test)))]
|
||||
(println (str "'" k) (format "(sci/copy-var tct/%s tct-ns)" k)))
|
||||
|
||||
#_(def test-check-clojure-test-namespace
|
||||
{'*default-opts* (sci/copy-var tct/*default-opts* tct-ns)
|
||||
'*default-test-count* (sci/copy-var tct/*default-test-count* tct-ns)
|
||||
'*report-completion* (sci/copy-var tct/*report-completion* tct-ns)
|
||||
'*report-shrinking* (sci/copy-var tct/*report-shrinking* tct-ns)
|
||||
'*report-trials* (sci/copy-var tct/*report-trials* tct-ns)
|
||||
'*trial-report-period* (sci/copy-var tct/*trial-report-period* tct-ns)
|
||||
'assert-check (sci/copy-var tct/assert-check tct-ns)
|
||||
'default-reporter-fn (sci/copy-var tct/default-reporter-fn tct-ns)
|
||||
'defspec (sci/copy-var tct/defspec tct-ns)
|
||||
'process-options (sci/copy-var tct/process-options tct-ns)
|
||||
'trial-report-dots (sci/copy-var tct/trial-report-dots tct-ns)
|
||||
'trial-report-periodic (sci/copy-var tct/trial-report-periodic tct-ns)
|
||||
'with-test-out* (sci/copy-var tct/with-test-out* tct-ns)})
|
||||
{'quick-check (sci/copy-var tc/quick-check p-ns)})
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
(ns babashka.impl.transit
|
||||
(:require
|
||||
[cognitect.transit :as transit]
|
||||
[sci.core :as sci :refer [copy-var]]))
|
||||
(:require [cognitect.transit :as transit]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def tns (sci/create-ns 'cognitect.transit nil))
|
||||
|
||||
(def tns (vars/->SciNamespace 'cognitect.transit nil))
|
||||
|
||||
(def transit-namespace
|
||||
{'write (copy-var transit/write tns)
|
||||
|
|
@ -15,5 +16,4 @@
|
|||
'reader (copy-var transit/reader tns)
|
||||
'read-handler (copy-var transit/read-handler tns)
|
||||
'read-handler-map (copy-var transit/read-handler-map tns)
|
||||
'default-write-handlers (copy-var transit/default-write-handlers tns)
|
||||
'tagged-value (copy-var transit/tagged-value tns)})
|
||||
|
|
|
|||
|
|
@ -1,52 +1,13 @@
|
|||
(ns babashka.impl.xml
|
||||
{:no-doc true}
|
||||
(:require [babashka.impl.common :refer [ctx]]
|
||||
[clojure.data.xml :as xml]
|
||||
[clojure.data.xml.event :as event]
|
||||
[clojure.data.xml.tree :as tree]
|
||||
[sci.core :as sci :refer [copy-var]]
|
||||
[sci.impl.vars]))
|
||||
(:require [clojure.data.xml :as xml]
|
||||
[sci.impl.namespaces :refer [copy-var]]
|
||||
[sci.impl.vars :as vars]))
|
||||
|
||||
(def xns (sci/create-ns 'clojure.data.xml nil))
|
||||
(def xens (sci/create-ns 'clojure.data.xml.event nil))
|
||||
(def xtns (sci/create-ns 'clojure.data.xml.tree nil))
|
||||
|
||||
(defn- clj-ns-name [ns]
|
||||
(cond (instance? sci.lang.Namespace ns) (str ns)
|
||||
(keyword? ns) (name ns)
|
||||
:else (str ns)))
|
||||
|
||||
(defn alias-uri
|
||||
"Define a Clojure namespace aliases for xmlns uris.
|
||||
This sets up the current namespace for reading qnames denoted with
|
||||
Clojure's ::alias/keywords reader feature.
|
||||
|
||||
## Example
|
||||
(alias-uri :D \"DAV:\")
|
||||
; similar in effect to
|
||||
;; (require '[xmlns.DAV%3A :as D])
|
||||
; but required namespace is auto-created
|
||||
; henceforth, shorthand keywords can be used
|
||||
{:tag ::D/propfind}
|
||||
; ::D/propfind will be expanded to :xmlns.DAV%3A/propfind
|
||||
; in the current namespace by the reader
|
||||
## Clojurescript support
|
||||
Currently, namespaces can't be auto-created in Clojurescript.
|
||||
Dummy files for aliased uris have to exist. Have a look at `uri-file` and `print-uri-file-command!` to create those."
|
||||
{:arglists '([& {:as alias-nss}])}
|
||||
[& ans]
|
||||
(loop [[a n & rst :as ans] ans]
|
||||
(when (seq ans)
|
||||
#_(assert (<= (count ans)) (pr-str ans))
|
||||
(let [xn (xml/uri-symbol n)
|
||||
al (symbol (clj-ns-name a))]
|
||||
(sci/eval-form (ctx) `(create-ns (quote ~xn)))
|
||||
(sci/eval-form (ctx) `(alias (quote ~al) (quote ~xn)))
|
||||
(recur rst)))))
|
||||
(def xns (vars/->SciNamespace 'clojure.data.xml nil))
|
||||
|
||||
(def xml-namespace
|
||||
{'aggregate-xmlns (copy-var xml/aggregate-xmlns xns)
|
||||
'alias-uri (copy-var alias-uri xns)
|
||||
'as-qname (copy-var xml/as-qname xns)
|
||||
'cdata (copy-var xml/cdata xns)
|
||||
'element (copy-var xml/element xns)
|
||||
|
|
@ -72,11 +33,3 @@
|
|||
'uri-file (copy-var xml/uri-file xns)
|
||||
'uri-symbol (copy-var xml/uri-symbol xns)
|
||||
'xml-comment (copy-var xml/xml-comment xns)})
|
||||
|
||||
(def xml-event-namespace
|
||||
{'event-element (copy-var event/event-element xens)
|
||||
'event-exit? (copy-var event/event-exit? xens)
|
||||
'event-node (copy-var event/event-node xens)})
|
||||
|
||||
(def xml-tree-namespace
|
||||
{'seq-tree (copy-var tree/seq-tree xtns)})
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
(ns babashka.impl.ordered
|
||||
{:no-doc true}
|
||||
(:require [flatland.ordered.map :as omap]
|
||||
[flatland.ordered.set :as oset]
|
||||
[sci.core :as sci]))
|
||||
|
||||
(def omap-ns (sci/create-ns 'flatland.ordered.map nil))
|
||||
(def oset-ns (sci/create-ns 'flatland.ordered.set nil))
|
||||
|
||||
(def ordered-map-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 1beb91cd5f352d1e3a914c94e7ec25a2644b07e5
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
((nil
|
||||
(cider-clojure-cli-global-options . "-A:test:build")))
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
{:tasks {install (clojure "-T:build install")
|
||||
deploy (clojure "-T:build deploy")}}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
(ns build
|
||||
(:require [build.reify2 :as reify2]
|
||||
[clojure.tools.build.api :as b]))
|
||||
|
||||
(def lib 'org.babashka/babashka.impl.java)
|
||||
(def version "0.1.10")
|
||||
(def class-dir "target/classes")
|
||||
(def basis (b/create-basis {:project "deps.edn"}))
|
||||
(def jar-file (format "target/%s-%s.jar" (name lib) version))
|
||||
|
||||
(defn clean [_]
|
||||
(b/delete {:path "target"}))
|
||||
|
||||
(defn gen-classes [_]
|
||||
(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 [_]
|
||||
(compile-java nil)
|
||||
(gen-classes nil)
|
||||
(b/write-pom {:class-dir class-dir
|
||||
:lib lib
|
||||
:version version
|
||||
:basis basis
|
||||
:src-dirs ["src"]
|
||||
:pom-data
|
||||
[[:licenses
|
||||
[:license
|
||||
[:name "MIT License"]
|
||||
[:url "https://opensource.org/license/mit/"]]]]})
|
||||
(b/copy-dir {:src-dirs ["src"]
|
||||
:target-dir class-dir})
|
||||
(b/jar {:class-dir class-dir
|
||||
:jar-file jar-file}))
|
||||
|
||||
(defn install [_]
|
||||
(jar nil)
|
||||
(b/install {:basis basis
|
||||
:lib lib
|
||||
:version version
|
||||
:jar-file jar-file
|
||||
:class-dir class-dir}))
|
||||
|
||||
(defn deploy [opts]
|
||||
(jar opts)
|
||||
((requiring-resolve 'deps-deploy.deps-deploy/deploy)
|
||||
(merge {:installer :remote
|
||||
:artifact jar-file
|
||||
:pom-file (b/pom-path {:lib lib :class-dir class-dir})}
|
||||
opts))
|
||||
opts)
|
||||
|
||||
;;;; Scratch
|
||||
|
||||
(comment
|
||||
(gen-classes nil)
|
||||
)
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
(ns build.reify2
|
||||
{:no-doc true}
|
||||
(:require [babashka.impl.reify2.interfaces :refer [interfaces]]
|
||||
[insn.core :as insn]))
|
||||
|
||||
(set! *warn-on-reflection* false)
|
||||
|
||||
(defn set-symbol! [s]
|
||||
[[:aconst-null]
|
||||
[:ldc s]
|
||||
[:invokestatic clojure.lang.Symbol "intern" [String String clojure.lang.Symbol]]
|
||||
[:putstatic :this (str "_sym_" s) clojure.lang.Symbol]])
|
||||
|
||||
(defn return [desc]
|
||||
(case (last desc)
|
||||
:void [:return]
|
||||
(:boolean :int) [:ireturn]
|
||||
[:areturn]))
|
||||
|
||||
(defn loads [desc cast?]
|
||||
(let [desc (butlast desc)]
|
||||
(vec
|
||||
(mapcat (fn [i e]
|
||||
(case e
|
||||
:boolean [[:iload i]
|
||||
(when cast? [:invokestatic Boolean "valueOf" [:boolean Boolean]])]
|
||||
:int [[:iload i]
|
||||
(when cast? [:invokestatic Integer "valueOf" [:int Integer]])]
|
||||
[[:aload i]]))
|
||||
(range 1 (inc (count desc)))
|
||||
desc))))
|
||||
|
||||
(defn emit-method [class meth desc default]
|
||||
(let [args (dec (count desc))]
|
||||
[[[:aload 0]
|
||||
[:getfield :this "_methods" java.util.Map]
|
||||
[:getstatic :this (str "_sym_" meth) clojure.lang.Symbol]
|
||||
[:invokeinterface java.util.Map "get" [Object Object]]
|
||||
[:checkcast clojure.lang.IFn]
|
||||
[:astore (inc args)]
|
||||
[:aload (inc args)]
|
||||
[:ifnull :fallback]
|
||||
[:aload (inc args)]
|
||||
;; load this, always the first argument of IFn
|
||||
[:aload 0]]
|
||||
;; load remaining args
|
||||
(loads desc true)
|
||||
[[:invokeinterface clojure.lang.IFn "invoke" (vec (repeat (inc (count desc)) Object))]
|
||||
(let [ret-type* (last desc)
|
||||
ret-type (if (class? ret-type*)
|
||||
(.getName ^Class ret-type*)
|
||||
ret-type*)]
|
||||
(case ret-type
|
||||
:void [:pop]
|
||||
:boolean [[:checkcast Boolean]
|
||||
[:invokevirtual Boolean "booleanValue"]]
|
||||
:int [[:checkcast Integer]
|
||||
[:invokevirtual Integer "intValue"]]
|
||||
"java.lang.Object" nil
|
||||
(when (class? ret-type*)
|
||||
[[:checkcast ret-type*]])))
|
||||
(return desc)
|
||||
[:mark :fallback]]
|
||||
(if default
|
||||
[[[:aload 0]]
|
||||
(loads desc false)
|
||||
[[:invokespecial class meth desc true]
|
||||
(return desc)]]
|
||||
[[:new java.lang.UnsupportedOperationException]
|
||||
[:dup]
|
||||
[:ldc (format "No implementation of method found: %s %s" meth desc)]
|
||||
[:invokespecial java.lang.UnsupportedOperationException :init [String :void]]
|
||||
[:athrow]])]))
|
||||
|
||||
(defn interface-data [^Class interface methods]
|
||||
(let [class-sym (symbol (.getName interface))
|
||||
method-names (distinct (map :name methods))]
|
||||
{:name (symbol (str "babashka.impl." (.getName interface)))
|
||||
:version 1.8
|
||||
:interfaces [class-sym
|
||||
'sci.impl.types.IReified
|
||||
'clojure.lang.IMeta
|
||||
'clojure.lang.IObj]
|
||||
:flags [:super :public]
|
||||
:fields (into [{:flags #{:private},
|
||||
:name "_methods" :type java.util.Map}
|
||||
{:flags #{:private},
|
||||
:name "_interfaces" :type Object}
|
||||
{:flags #{:private},
|
||||
:name "_protocols" :type Object}
|
||||
{:flags #{:private},
|
||||
:name "_meta" :type clojure.lang.IPersistentMap}]
|
||||
(for [name method-names]
|
||||
{:flags #{:private :static},
|
||||
:name (str "_sym_" name) :type clojure.lang.Symbol}))
|
||||
:methods (into [{:name :clinit
|
||||
:emit (reduce into
|
||||
[]
|
||||
(conj
|
||||
(mapv set-symbol! method-names)
|
||||
[[:return]]))}
|
||||
{:name :init
|
||||
:desc [:void]
|
||||
:emit [[:aload 0]
|
||||
[:invokespecial :super :init [:void]]
|
||||
[:return]]}
|
||||
{:name :init
|
||||
:desc [java.util.Map Object Object :void]
|
||||
:emit [[:aload 0]
|
||||
[:invokespecial :super :init [:void]]
|
||||
[:aload 0]
|
||||
[:aload 1]
|
||||
[:putfield :this "_methods" java.util.Map]
|
||||
[:aload 0]
|
||||
[:aload 2]
|
||||
[:putfield :this "_interfaces" Object]
|
||||
[:aload 0]
|
||||
[:aload 3]
|
||||
[:putfield :this "_protocols" Object]
|
||||
[:return]]}
|
||||
{:name :meta
|
||||
:desc [clojure.lang.IPersistentMap]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_meta" clojure.lang.IPersistentMap]
|
||||
[:areturn]]}
|
||||
{:name :withMeta
|
||||
:desc [clojure.lang.IPersistentMap clojure.lang.IObj]
|
||||
:emit [[:aload 0]
|
||||
[:aload 1]
|
||||
[:putfield :this "_meta" clojure.lang.IPersistentMap]
|
||||
[:aload 0]
|
||||
[:areturn]]}
|
||||
{:name :getInterfaces
|
||||
:desc [Object]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_interfaces" Object]
|
||||
[:areturn]]}
|
||||
{:name :getMethods
|
||||
:desc [Object]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_methods" java.util.Map]
|
||||
[:areturn]]}
|
||||
{:name :getProtocols
|
||||
:desc [Object]
|
||||
:emit [[:aload 0]
|
||||
[:getfield :this "_protocols" Object]
|
||||
[:areturn]]}]
|
||||
(for [{:keys [name desc default]} methods]
|
||||
{:flags #{:public}, :name name
|
||||
:desc desc
|
||||
:emit (emit-method interface name desc default)}
|
||||
))}))
|
||||
|
||||
(set! *warn-on-reflection* true)
|
||||
|
||||
(defn type->kw [type]
|
||||
(condp = type
|
||||
Void/TYPE :void
|
||||
Boolean/TYPE :boolean
|
||||
Integer/TYPE :int
|
||||
type))
|
||||
|
||||
(defn class->methods [^Class clazz]
|
||||
(let [meths (.getMethods clazz)
|
||||
meths (mapv bean meths)
|
||||
;; TODO: fix problems with clojure.lang.IFn, special cased for now
|
||||
;; The problem is that the 20-arity (highest one) could not be reified
|
||||
;; meths (filter #(<= (:parameterCount %) 19) meths)
|
||||
meths (mapv (fn [{:keys [name
|
||||
parameterTypes
|
||||
returnType
|
||||
default]}]
|
||||
(let [ret-type (type->kw returnType)]
|
||||
{:name name
|
||||
:desc (conj (mapv type->kw parameterTypes) ret-type)
|
||||
:default default}))
|
||||
meths)]
|
||||
(distinct meths)))
|
||||
|
||||
(let [i clojure.lang.IFn]
|
||||
(insn/define (insn/visit (interface-data i (class->methods i)))))
|
||||
|
||||
(def reified (babashka.impl.clojure.lang.IFn. {'invoke (fn [& _args] :yep)} {} {}))
|
||||
|
||||
(defn gen-classes [_]
|
||||
(doseq [i interfaces]
|
||||
(insn/write (doto (insn/visit (interface-data i (class->methods i)))
|
||||
insn/define) "target/classes")))
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
{:deps {org.babashka/sci.impl.types {:mvn/version "0.0.2"}}
|
||||
:aliases
|
||||
{:build ;; added by neil
|
||||
{:paths ["." "build" "src"]
|
||||
:deps {io.github.clojure/tools.build {:git/tag "v0.9.6" :git/sha "8e78bcc"}
|
||||
slipset/deps-deploy {:mvn/version "0.2.0"}
|
||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||
;; insn/insn {:mvn/version "0.5.3"}
|
||||
insn/insn {
|
||||
:git/sha "f85da286d429b507480f8527b12ce3e1e0e17296"
|
||||
:git/url "https://github.com/phronmophobic/insn"
|
||||
}}
|
||||
:ns-default build}}}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
(ns babashka.impl.reify2
|
||||
(:require [babashka.impl.reify2.interfaces :refer [interfaces]]))
|
||||
|
||||
(set! *warn-on-reflection* false)
|
||||
|
||||
(defn method-or-bust [methods k]
|
||||
(or (get methods k)
|
||||
(throw (UnsupportedOperationException. "Method not implemented: " k))))
|
||||
|
||||
(defn reify-ifn [m]
|
||||
(let [methods (:methods m)
|
||||
invoke-fn (or (get methods 'invoke)
|
||||
(fn [& _args]
|
||||
(throw (UnsupportedOperationException. "Method not implemented: invoke"))))
|
||||
apply-fn (or (get methods 'applyTo)
|
||||
(fn [& _args]
|
||||
(throw (UnsupportedOperationException. "Method not implemented: applyTo"))))]
|
||||
(reify
|
||||
sci.impl.types.IReified
|
||||
(getMethods [_] (:methods m))
|
||||
(getInterfaces [_] (:interfaces m))
|
||||
(getProtocols [_] (:protocols m))
|
||||
clojure.lang.IFn
|
||||
(invoke [this] (invoke-fn this))
|
||||
(invoke [this a0] (invoke-fn this a0))
|
||||
(invoke [this a0 a1] (invoke-fn this a0 a1))
|
||||
(invoke [this a0 a1 a2] (invoke-fn this a0 a1 a2))
|
||||
(invoke [this a0 a1 a2 a3] (invoke-fn this a0 a1 a2 a3))
|
||||
(invoke [this a0 a1 a2 a3 a4] (invoke-fn this a0 a1 a2 a3 a4))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5] (invoke-fn this a0 a1 a2 a3 a4 a5))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6] (invoke-fn this a0 a1 a2 a3 a4 a5 a6))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19))
|
||||
(invoke [this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20] (invoke-fn this a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20))
|
||||
(applyTo [this arglist] (apply-fn this arglist)))))
|
||||
|
||||
(defn reify-object [m]
|
||||
(let [methods (:methods m)
|
||||
toString-fn (or (get methods 'toString)
|
||||
(fn [this]
|
||||
(str
|
||||
(.getName (.getClass this))
|
||||
"@"
|
||||
(Integer/toHexString (.hashCode this)))))]
|
||||
(reify
|
||||
sci.impl.types.IReified
|
||||
(getMethods [_] (:methods m))
|
||||
(getInterfaces [_] (:interfaces m))
|
||||
(getProtocols [_] (:protocols m))
|
||||
java.lang.Object
|
||||
(toString [this] (toString-fn this)))))
|
||||
|
||||
(defmacro gen-reify-fn []
|
||||
`(fn [~'m]
|
||||
(when (> (count (:interfaces ~'m)) 1)
|
||||
(throw (UnsupportedOperationException. "babashka reify only supports implementing a single interface")))
|
||||
(if (empty? (:interfaces ~'m))
|
||||
(reify
|
||||
sci.impl.types.IReified
|
||||
(getMethods [_] (:methods ~'m))
|
||||
(getInterfaces [_] (:interfaces ~'m))
|
||||
(getProtocols [_] (:protocols ~'m)))
|
||||
(case (.getName ~(with-meta `(first (:interfaces ~'m))
|
||||
{:tag 'Class}))
|
||||
~@(mapcat identity
|
||||
(cons
|
||||
["clojure.lang.IFn"
|
||||
`(reify-ifn ~'m)
|
||||
"java.lang.Object"
|
||||
`(reify-object ~'m)]
|
||||
(for [i interfaces]
|
||||
(let [in (.getName ^Class i)]
|
||||
[in
|
||||
`(new ~(symbol (str "babashka.impl." in))
|
||||
(:methods ~'m)
|
||||
(:interfaces ~'m)
|
||||
(:protocols ~'m))]))))))))
|
||||
|
||||
(def reify-fn (gen-reify-fn))
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
(ns babashka.impl.reify2.interfaces)
|
||||
|
||||
(def interfaces [java.nio.file.FileVisitor
|
||||
java.nio.file.DirectoryStream$Filter
|
||||
java.io.FileFilter
|
||||
java.io.FilenameFilter
|
||||
clojure.lang.Associative
|
||||
clojure.lang.ILookup
|
||||
java.util.Map$Entry
|
||||
;; TODO: fix problems with clojure.lang.IFn, special cased for now
|
||||
;; The problem is that the 20-arity (highest one) could not be reified
|
||||
;; clojure.lang.IFn
|
||||
clojure.lang.IPersistentCollection
|
||||
clojure.lang.IReduce
|
||||
clojure.lang.IReduceInit
|
||||
clojure.lang.IKVReduce
|
||||
clojure.lang.Indexed
|
||||
clojure.lang.IPersistentMap
|
||||
clojure.lang.IPersistentStack
|
||||
clojure.lang.Reversible
|
||||
clojure.lang.Seqable
|
||||
java.lang.Iterable
|
||||
java.lang.Runnable
|
||||
java.net.http.WebSocket$Listener
|
||||
java.util.Iterator
|
||||
java.util.function.Consumer
|
||||
java.util.function.BiConsumer
|
||||
java.util.function.Function
|
||||
java.util.function.BiFunction
|
||||
java.util.function.Predicate
|
||||
java.util.function.Supplier
|
||||
java.lang.Comparable
|
||||
javax.net.ssl.X509TrustManager
|
||||
clojure.lang.LispReader$Resolver
|
||||
sun.misc.SignalHandler
|
||||
java.util.concurrent.ThreadFactory
|
||||
java.lang.Thread$UncaughtExceptionHandler
|
||||
java.util.concurrent.Callable])
|
||||
99
install
99
install
|
|
@ -8,7 +8,6 @@ static_binary="false"
|
|||
default_install_dir="/usr/local/bin"
|
||||
install_dir="$default_install_dir"
|
||||
download_dir=""
|
||||
dev_build=""
|
||||
|
||||
print_help() {
|
||||
echo "Installs latest (or specific) version of babashka. Installation directory defaults to /usr/local/bin."
|
||||
|
|
@ -29,32 +28,6 @@ print_help() {
|
|||
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 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
|
@ -83,10 +56,6 @@ do
|
|||
static_binary="true"
|
||||
shift
|
||||
;;
|
||||
--dev-build)
|
||||
dev_build="true"
|
||||
shift
|
||||
;;
|
||||
*) # unknown option
|
||||
print_help
|
||||
shift
|
||||
|
|
@ -105,11 +74,7 @@ if [[ "$checksum" != "" ]] && [[ "$version" == "" ]]; then
|
|||
fi
|
||||
|
||||
if [[ "$version" == "" ]]; then
|
||||
if [[ "$dev_build" == "true" ]]; then
|
||||
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
|
||||
version="$(curl -sL https://raw.githubusercontent.com/babashka/babashka/master/resources/BABASHKA_RELEASED_VERSION)"
|
||||
fi
|
||||
|
||||
case "$(uname -s)" in
|
||||
|
|
@ -117,36 +82,21 @@ case "$(uname -s)" in
|
|||
Darwin*) platform=macos;;
|
||||
esac
|
||||
|
||||
# Ugly ugly conversion of version to a comparable number
|
||||
IFS='.' read -ra VER <<< "${version//-SNAPSHOT/}"
|
||||
vernum=$(printf "%03d%03d%03d" "${VER[0]}" "${VER[1]}" "${VER[2]}")
|
||||
|
||||
case "$(uname -m)" in
|
||||
aarch64) arch=aarch64
|
||||
if [[ "$platform" == "linux" ]]; then
|
||||
static_binary="true"
|
||||
fi
|
||||
;;
|
||||
arm64) if [[ 10#$vernum -le 10#000008002 ]]; then
|
||||
arch="amd64"
|
||||
else
|
||||
arch="aarch64"
|
||||
fi
|
||||
;;
|
||||
*) arch=amd64
|
||||
# always use static image on linux
|
||||
if [[ "$platform" == "linux" ]]; then
|
||||
static_binary="true"
|
||||
fi
|
||||
;;
|
||||
aarch64) arch=aarch64;;
|
||||
*) arch=amd64;;
|
||||
esac
|
||||
|
||||
if [[ 10#$vernum -le 10#000002013 ]]; then
|
||||
ext="zip"
|
||||
util="$(which unzip) -qqo"
|
||||
# Ugly ugly conversion of version to a comparable number
|
||||
IFS='.' read -ra VER <<< "$version"
|
||||
vernum=$(printf "%03d%03d%03d" "${VER[0]}" "${VER[1]}" "${VER[2]}")
|
||||
|
||||
if [[ $vernum -le 000002013 ]]; then
|
||||
ext="zip"
|
||||
util="$(which unzip) -qqo"
|
||||
else
|
||||
ext="tar.gz"
|
||||
util="$(which tar) -zxf"
|
||||
ext="tar.gz"
|
||||
util="$(which tar) -zxf"
|
||||
fi
|
||||
|
||||
case "$platform-$static_binary" in
|
||||
|
|
@ -159,35 +109,16 @@ case "$platform-$static_binary" in
|
|||
;;
|
||||
esac
|
||||
|
||||
if [[ "$version" == *-SNAPSHOT ]]
|
||||
then
|
||||
repo="babashka-dev-builds"
|
||||
else
|
||||
repo="babashka"
|
||||
fi
|
||||
|
||||
download_url="https://github.com/babashka/$repo/releases/download/v$version/$filename"
|
||||
|
||||
# macOS only have shasum available by default
|
||||
# Some Linux distros (RHEL-like) only have sha256sum available by default (others have both)
|
||||
if has sha256sum; then
|
||||
sha256sum_cmd="sha256sum"
|
||||
elif has shasum; then
|
||||
sha256sum_cmd="shasum -a 256"
|
||||
else
|
||||
>&2 echo "Either 'sha256sum' or 'shasum' needs to be on PATH for '--checksum' flag!"
|
||||
>&2 echo "Exiting..."
|
||||
exit 1
|
||||
fi
|
||||
download_url="https://github.com/babashka/babashka/releases/download/v$version/$filename"
|
||||
|
||||
# Running this part in a subshell so when it finishes we go back to the previous directory
|
||||
mkdir -p "$download_dir" && (
|
||||
cd "$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 ! echo "$checksum *$filename" | $sha256sum_cmd --check --status; then
|
||||
if ! echo "$checksum *$filename" | shasum -a 256 --check --status; then
|
||||
>&2 echo "Failed checksum on $filename"
|
||||
>&2 echo "Got: $(shasum -a 256 "$filename" | cut -d' ' -f1)"
|
||||
>&2 echo "Expected: $checksum"
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 124 KiB |
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="882" height="648" viewBox="0 0 2944 2162" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1742.91 1219.89C1857.93 1138.38 1933 1004.21 1933 852.5C1933 603.972 1761 280.5 1483 139C1207.5 288 1033 603.972 1033 852.5C1033 1004.21 1108.07 1138.38 1223.09 1219.89C1218.98 1220.44 1214.95 1221.14 1211 1222C1123.61 1241.07 1017 1385.05 1017 1385.05H1281C1327.97 1385.05 1372.63 1367.41 1407.96 1347.62C1425.12 1370.32 1452.34 1385 1483 1385C1513.66 1385 1540.89 1370.32 1558.04 1347.62C1593.37 1367.41 1638.03 1385.05 1685 1385.05H1949C1949 1385.05 1842.39 1241.07 1755 1222C1751.05 1221.14 1747.02 1220.44 1742.91 1219.89Z" style="fill-rule: evenodd; fill: rgb(0, 91, 187);"/>
|
||||
<circle cx="1482.5" cy="878.5" r="311.5" style="fill: rgb(255, 213, 0);"/>
|
||||
<path d="M1212 745.5C1396.5 758.5 1505.5 713.5 1581 602C1581 602 1435.5 553 1347 602C1258.8 650.834 1212 745.5 1212 745.5Z" fill="#B4B4B4"/>
|
||||
<path d="M1728 718C1654 710 1588 686 1556.5 595.5C1556.5 595.5 1621.93 610.435 1688 670.614C1756.62 733.114 1728 718 1728 718Z" fill="#B4B4B4"/>
|
||||
<circle cx="1482.5" cy="878.5" r="311.5" stroke="#0A0000" stroke-width="40"/>
|
||||
<path d="M1544 745H1421L1451 775V865C1455.5 835.5 1511.5 834.5 1514.5 865L1522 775L1544 745Z" fill="black"/>
|
||||
<path d="M1098.12 785C1098.12 762.909 1116.03 745 1138.12 745H1423.02C1447.2 745 1465.85 766.292 1462.67 790.264L1437.91 976.764C1435.27 996.646 1418.31 1011.5 1398.26 1011.5H1138.12C1116.03 1011.5 1098.12 993.591 1098.12 971.5V785Z" fill="black"/>
|
||||
<path d="M1216.1 967.55V951.05H1210.55C1206.95 951.05 1204.55 948.5 1203.35 944.75L1180.55 876.05C1179.05 871.7 1177.25 868.55 1174.85 866.15C1170.35 861.5 1164.5 860 1157.9 860H1150.7V877.25H1155.5C1159.55 877.25 1162.7 878.75 1164.05 883.55L1167.2 894.65L1139 967.55H1159.55L1176.5 919.55L1185.5 948.5C1188.95 959.75 1194.8 967.55 1208 967.55H1216.1Z" fill="white"/>
|
||||
<path d="M1248.8 951.05V967.55H1304.8V951.05H1248.8Z" fill="white"/>
|
||||
<path d="M1503.01 790.267C1499.83 766.294 1518.48 745 1542.66 745H1827C1849.09 745 1867 762.909 1867 785V971.096C1867 993.187 1849.09 1011.1 1827 1011.1H1567.38C1547.33 1011.1 1530.37 996.244 1527.73 976.362L1503.01 790.267Z" fill="black"/>
|
||||
<path d="M1649.3 968V951.5H1643.75C1640.15 951.5 1637.75 948.95 1636.55 945.2L1613.75 876.5C1612.25 872.15 1610.45 869 1608.05 866.6C1603.55 861.95 1597.7 860.45 1591.1 860.45H1583.9V877.7H1588.7C1592.75 877.7 1595.9 879.2 1597.25 884L1600.4 895.1L1572.2 968H1592.75L1609.7 920L1618.7 948.95C1622.15 960.2 1628 968 1641.2 968H1649.3Z" fill="white"/>
|
||||
<path d="M1682 951.5V968H1738V951.5H1682Z" fill="white"/>
|
||||
<path d="M 245.923 1712.64 C 254.47 1701.19 264.812 1692.21 276.949 1685.72 C 289.085 1679.05 301.991 1675.72 315.667 1675.72 C 349.684 1675.72 374.897 1688.37 391.308 1713.67 C 407.889 1738.79 416.18 1774.26 416.18 1820.08 C 416.18 1848.45 411.906 1873.67 403.359 1895.72 C 394.983 1917.6 382.59 1934.78 366.18 1947.26 C 349.94 1959.56 330.282 1965.72 307.205 1965.72 C 293.53 1965.72 280.795 1962.81 269 1957 C 257.376 1951.36 247.633 1943.15 239.769 1932.38 L 236.692 1957 L 164.897 1957 L 164.897 1576.49 L 245.923 1568.03 L 245.923 1712.64 Z M 285.923 1906.74 C 317.034 1906.74 332.59 1878.2 332.59 1821.1 C 332.59 1799.22 330.88 1782.04 327.462 1769.56 C 324.043 1756.91 319.171 1748.11 312.846 1743.15 C 306.692 1738.03 299.085 1735.46 290.026 1735.46 C 273.274 1735.46 258.573 1745.97 245.923 1767 L 245.923 1881.87 C 251.222 1890.25 257.034 1896.49 263.359 1900.59 C 269.855 1904.69 277.376 1906.74 285.923 1906.74 Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M 701.745 1878.54 C 701.745 1888.62 703.113 1896.06 705.848 1900.85 C 708.583 1905.46 713.198 1908.97 719.694 1911.36 L 703.027 1964.69 C 686.446 1963.15 672.686 1959.56 661.745 1953.92 C 650.976 1948.11 642.515 1939.74 636.361 1928.79 C 626.275 1940.93 613.198 1950.16 597.13 1956.49 C 581.233 1962.64 564.395 1965.72 546.617 1965.72 C 528.156 1965.72 511.916 1962.13 497.899 1954.95 C 484.053 1947.6 473.369 1937.51 465.848 1924.69 C 458.327 1911.7 454.566 1896.83 454.566 1880.08 C 454.566 1860.59 459.78 1843.92 470.207 1830.08 C 480.634 1816.23 495.763 1805.72 515.592 1798.54 C 535.421 1791.19 559.267 1787.51 587.13 1787.51 L 623.797 1787.51 L 623.797 1777.26 C 623.797 1749.39 605.848 1735.46 569.951 1735.46 C 560.891 1735.46 549.438 1736.74 535.592 1739.31 C 521.916 1741.87 508.498 1745.38 495.335 1749.82 L 476.617 1695.97 C 493.711 1689.48 511.745 1684.52 530.72 1681.1 C 549.694 1677.51 567.045 1675.72 582.771 1675.72 C 622.771 1675.72 652.6 1683.84 672.258 1700.08 C 691.916 1716.32 701.745 1740.25 701.745 1771.87 L 701.745 1878.54 Z M 574.566 1907.77 C 583.797 1907.77 593.113 1905.12 602.515 1899.82 C 611.916 1894.35 619.01 1887 623.797 1877.77 L 623.797 1833.67 L 603.797 1833.67 C 581.574 1833.67 565.079 1837.09 554.31 1843.92 C 543.54 1850.76 538.156 1860.93 538.156 1874.44 C 538.156 1885.03 541.318 1893.24 547.643 1899.05 C 554.139 1904.86 563.113 1907.77 574.566 1907.77 Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M984.204 1711.64C992.751 1700.19 1003.09 1691.21 1015.23 1684.72C1027.37 1678.05 1040.27 1674.72 1053.95 1674.72C1087.97 1674.72 1113.18 1687.37 1129.59 1712.67C1146.17 1737.79 1154.46 1773.26 1154.46 1819.08C1154.46 1847.45 1150.19 1872.67 1141.64 1894.72C1133.26 1916.6 1120.87 1933.78 1104.46 1946.26C1088.22 1958.56 1068.56 1964.72 1045.49 1964.72C1031.81 1964.72 1019.08 1961.81 1007.28 1956C995.657 1950.36 985.914 1942.15 978.05 1931.38L974.974 1956H903.179V1575.49L984.204 1567.03V1711.64ZM1024.2 1905.74C1055.32 1905.74 1070.87 1877.2 1070.87 1820.1C1070.87 1798.22 1069.16 1781.04 1065.74 1768.56C1062.32 1755.91 1057.45 1747.11 1051.13 1742.15C1044.97 1737.03 1037.37 1734.46 1028.31 1734.46C1011.55 1734.46 996.854 1744.97 984.204 1766V1880.87C989.503 1889.25 995.315 1895.49 1001.64 1899.59C1008.14 1903.69 1015.66 1905.74 1024.2 1905.74Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M1440.03 1877.54C1440.03 1887.62 1441.39 1895.06 1444.13 1899.85C1446.86 1904.46 1451.48 1907.97 1457.98 1910.36L1441.31 1963.69C1424.73 1962.15 1410.97 1958.56 1400.03 1952.92C1389.26 1947.11 1380.8 1938.74 1374.64 1927.79C1364.56 1939.93 1351.48 1949.16 1335.41 1955.49C1319.51 1961.64 1302.68 1964.72 1284.9 1964.72C1266.44 1964.72 1250.2 1961.13 1236.18 1953.95C1222.33 1946.6 1211.65 1936.51 1204.13 1923.69C1196.61 1910.7 1192.85 1895.83 1192.85 1879.08C1192.85 1859.59 1198.06 1842.92 1208.49 1829.08C1218.92 1815.23 1234.04 1804.72 1253.87 1797.54C1273.7 1790.19 1297.55 1786.51 1325.41 1786.51H1362.08V1776.26C1362.08 1748.39 1344.13 1734.46 1308.23 1734.46C1299.17 1734.46 1287.72 1735.74 1273.87 1738.31C1260.2 1740.87 1246.78 1744.38 1233.62 1748.82L1214.9 1694.97C1231.99 1688.48 1250.03 1683.52 1269 1680.1C1287.98 1676.51 1305.33 1674.72 1321.05 1674.72C1361.05 1674.72 1390.88 1682.84 1410.54 1699.08C1430.2 1715.32 1440.03 1739.25 1440.03 1770.87V1877.54ZM1312.85 1906.77C1322.08 1906.77 1331.39 1904.12 1340.8 1898.82C1350.2 1893.35 1357.29 1886 1362.08 1876.77V1832.67H1342.08C1319.86 1832.67 1303.36 1836.09 1292.59 1842.92C1281.82 1849.76 1276.44 1859.93 1276.44 1873.44C1276.44 1884.03 1279.6 1892.24 1285.92 1898.05C1292.42 1903.86 1301.39 1906.77 1312.85 1906.77Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M1627.64 1906.77C1641.49 1906.77 1652.43 1904.63 1660.46 1900.36C1668.67 1895.91 1672.77 1889.5 1672.77 1881.13C1672.77 1875.15 1671.15 1870.27 1667.9 1866.51C1664.65 1862.58 1658.58 1858.91 1649.7 1855.49C1640.81 1851.9 1626.96 1847.54 1608.16 1842.41C1580.81 1835.06 1559.87 1824.97 1545.34 1812.15C1530.98 1799.33 1523.8 1781.56 1523.8 1758.82C1523.8 1742.41 1528.33 1727.88 1537.39 1715.23C1546.62 1702.58 1560.12 1692.67 1577.9 1685.49C1595.68 1678.31 1617.05 1674.72 1642 1674.72C1685.25 1674.72 1722 1685.74 1752.26 1707.79L1719.95 1755.49C1708.16 1748.31 1695.76 1742.67 1682.77 1738.56C1669.95 1734.46 1657.13 1732.41 1644.31 1732.41C1631.15 1732.41 1621.32 1734.21 1614.82 1737.79C1608.5 1741.21 1605.34 1746.43 1605.34 1753.44C1605.34 1758.22 1606.96 1762.24 1610.21 1765.49C1613.63 1768.74 1619.7 1772.07 1628.41 1775.49C1637.3 1778.91 1651.06 1783.26 1669.7 1788.56C1689.35 1794.03 1705.34 1800.1 1717.64 1806.77C1729.95 1813.26 1739.52 1821.98 1746.36 1832.92C1753.37 1843.69 1756.87 1857.62 1756.87 1874.72C1756.87 1893.86 1751.06 1910.27 1739.44 1923.95C1727.99 1937.45 1712.52 1947.62 1693.03 1954.46C1673.54 1961.3 1651.92 1964.72 1628.16 1964.72C1602.69 1964.72 1579.78 1961.13 1559.44 1953.95C1539.1 1946.6 1521.58 1936.51 1506.87 1923.69L1547.64 1878.05C1558.93 1886.94 1571.32 1893.95 1584.82 1899.08C1598.33 1904.21 1612.6 1906.77 1627.64 1906.77Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M1907.06 1710.62C1929.79 1686.68 1956.46 1674.72 1987.06 1674.72C2011.16 1674.72 2029.62 1681.81 2042.44 1696C2055.43 1710.02 2061.93 1730.02 2061.93 1756V1956H1980.9V1778.56C1980.9 1767.45 1980.05 1758.74 1978.34 1752.41C1976.8 1746.09 1974.15 1741.56 1970.39 1738.82C1966.63 1735.91 1961.41 1734.46 1954.75 1734.46C1946.54 1734.46 1938.59 1737.28 1930.9 1742.92C1923.21 1748.56 1915.26 1756.77 1907.06 1767.54V1956H1826.03V1575.49L1907.06 1567.54V1710.62Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M2337.72 1956H2256.69V1575.49L2337.72 1567.03V1956ZM2425.67 1804.21L2522.59 1956H2430.28L2340.8 1806.77L2430.28 1683.69H2515.16L2425.67 1804.21Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M2793.54 1877.54C2793.54 1887.62 2794.91 1895.06 2797.64 1899.85C2800.38 1904.46 2805 1907.97 2811.49 1910.36L2794.82 1963.69C2778.24 1962.15 2764.48 1958.56 2753.54 1952.92C2742.77 1947.11 2734.31 1938.74 2728.16 1927.79C2718.07 1939.93 2705 1949.16 2688.93 1955.49C2673.03 1961.64 2656.19 1964.72 2638.41 1964.72C2619.95 1964.72 2603.71 1961.13 2589.7 1953.95C2575.85 1946.6 2565.17 1936.51 2557.64 1923.69C2550.12 1910.7 2546.36 1895.83 2546.36 1879.08C2546.36 1859.59 2551.58 1842.92 2562 1829.08C2572.43 1815.23 2587.56 1804.72 2607.39 1797.54C2627.22 1790.19 2651.06 1786.51 2678.93 1786.51H2715.59V1776.26C2715.59 1748.39 2697.64 1734.46 2661.75 1734.46C2652.69 1734.46 2641.23 1735.74 2627.39 1738.31C2613.71 1740.87 2600.29 1744.38 2587.13 1748.82L2568.41 1694.97C2585.51 1688.48 2603.54 1683.52 2622.52 1680.1C2641.49 1676.51 2658.84 1674.72 2674.57 1674.72C2714.57 1674.72 2744.4 1682.84 2764.06 1699.08C2783.71 1715.32 2793.54 1739.25 2793.54 1770.87V1877.54ZM2666.36 1906.77C2675.59 1906.77 2684.91 1904.12 2694.31 1898.82C2703.71 1893.35 2710.81 1886 2715.59 1876.77V1832.67H2695.59C2673.37 1832.67 2656.88 1836.09 2646.11 1842.92C2635.34 1849.76 2629.95 1859.93 2629.95 1873.44C2629.95 1884.03 2633.11 1892.24 2639.44 1898.05C2645.94 1903.86 2654.91 1906.77 2666.36 1906.77Z" style="fill: rgb(0, 91, 187);"/>
|
||||
<path d="M862 1819C862 1848.27 838.271 1872 809 1872C779.729 1872 756 1848.27 756 1819C756 1789.73 779.729 1766 809 1766C838.271 1766 862 1789.73 862 1819Z" style="fill: rgb(255, 213, 0);"/>
|
||||
<path d="M2215.5 1819C2215.5 1848.27 2191.77 1872 2162.5 1872C2133.23 1872 2109.5 1848.27 2109.5 1819C2109.5 1789.73 2133.23 1766 2162.5 1766C2191.77 1766 2215.5 1789.73 2215.5 1819Z" style="fill: rgb(255, 213, 0);"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 141 KiB |
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg width="882" height="648" viewBox="0 0 2944 2162" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1742.91 1219.89C1857.93 1138.38 1933 1004.21 1933 852.5C1933 603.972 1761 280.5 1483 139C1207.5 288 1033 603.972 1033 852.5C1033 1004.21 1108.07 1138.38 1223.09 1219.89C1218.98 1220.44 1214.95 1221.14 1211 1222C1123.61 1241.07 1017 1385.05 1017 1385.05H1281C1327.97 1385.05 1372.63 1367.41 1407.96 1347.62C1425.12 1370.32 1452.34 1385 1483 1385C1513.66 1385 1540.89 1370.32 1558.04 1347.62C1593.37 1367.41 1638.03 1385.05 1685 1385.05H1949C1949 1385.05 1842.39 1241.07 1755 1222C1751.05 1221.14 1747.02 1220.44 1742.91 1219.89Z" fill="url(#paint0_linear)"/>
|
||||
<circle cx="1482.5" cy="878.5" r="311.5" fill="white"/>
|
||||
<path d="M1212 745.5C1396.5 758.5 1505.5 713.5 1581 602C1581 602 1435.5 553 1347 602C1258.8 650.834 1212 745.5 1212 745.5Z" fill="#B4B4B4"/>
|
||||
<path d="M1728 718C1654 710 1588 686 1556.5 595.5C1556.5 595.5 1621.93 610.435 1688 670.614C1756.62 733.114 1728 718 1728 718Z" fill="#B4B4B4"/>
|
||||
<circle cx="1482.5" cy="878.5" r="311.5" stroke="#0A0000" stroke-width="40"/>
|
||||
<path d="M1544 745H1421L1451 775V865C1455.5 835.5 1511.5 834.5 1514.5 865L1522 775L1544 745Z" fill="black"/>
|
||||
<path d="M1098.12 785C1098.12 762.909 1116.03 745 1138.12 745H1423.02C1447.2 745 1465.85 766.292 1462.67 790.264L1437.91 976.764C1435.27 996.646 1418.31 1011.5 1398.26 1011.5H1138.12C1116.03 1011.5 1098.12 993.591 1098.12 971.5V785Z" fill="black"/>
|
||||
<path d="M1216.1 967.55V951.05H1210.55C1206.95 951.05 1204.55 948.5 1203.35 944.75L1180.55 876.05C1179.05 871.7 1177.25 868.55 1174.85 866.15C1170.35 861.5 1164.5 860 1157.9 860H1150.7V877.25H1155.5C1159.55 877.25 1162.7 878.75 1164.05 883.55L1167.2 894.65L1139 967.55H1159.55L1176.5 919.55L1185.5 948.5C1188.95 959.75 1194.8 967.55 1208 967.55H1216.1Z" fill="white"/>
|
||||
<path d="M1248.8 951.05V967.55H1304.8V951.05H1248.8Z" fill="white"/>
|
||||
<path d="M1503.01 790.267C1499.83 766.294 1518.48 745 1542.66 745H1827C1849.09 745 1867 762.909 1867 785V971.096C1867 993.187 1849.09 1011.1 1827 1011.1H1567.38C1547.33 1011.1 1530.37 996.244 1527.73 976.362L1503.01 790.267Z" fill="black"/>
|
||||
<path d="M1649.3 968V951.5H1643.75C1640.15 951.5 1637.75 948.95 1636.55 945.2L1613.75 876.5C1612.25 872.15 1610.45 869 1608.05 866.6C1603.55 861.95 1597.7 860.45 1591.1 860.45H1583.9V877.7H1588.7C1592.75 877.7 1595.9 879.2 1597.25 884L1600.4 895.1L1572.2 968H1592.75L1609.7 920L1618.7 948.95C1622.15 960.2 1628 968 1641.2 968H1649.3Z" fill="white"/>
|
||||
<path d="M1682 951.5V968H1738V951.5H1682Z" fill="white"/>
|
||||
<path d="M245.923 1711.64C254.47 1700.19 264.812 1691.21 276.949 1684.72C289.085 1678.05 301.991 1674.72 315.667 1674.72C349.684 1674.72 374.897 1687.37 391.308 1712.67C407.889 1737.79 416.18 1773.26 416.18 1819.08C416.18 1847.45 411.906 1872.67 403.359 1894.72C394.983 1916.6 382.59 1933.78 366.18 1946.26C349.94 1958.56 330.282 1964.72 307.205 1964.72C293.53 1964.72 280.795 1961.81 269 1956C257.376 1950.36 247.633 1942.15 239.769 1931.38L236.692 1956H164.897V1575.49L245.923 1567.03V1711.64ZM285.923 1905.74C317.034 1905.74 332.59 1877.2 332.59 1820.1C332.59 1798.22 330.88 1781.04 327.462 1768.56C324.043 1755.91 319.171 1747.11 312.846 1742.15C306.692 1737.03 299.085 1734.46 290.026 1734.46C273.274 1734.46 258.573 1744.97 245.923 1766V1880.87C251.222 1889.25 257.034 1895.49 263.359 1899.59C269.855 1903.69 277.376 1905.74 285.923 1905.74Z" style="fill: rgb(220, 27, 32);"/>
|
||||
<path d="M701.745 1877.54C701.745 1887.62 703.113 1895.06 705.848 1899.85C708.583 1904.46 713.198 1907.97 719.694 1910.36L703.027 1963.69C686.446 1962.15 672.686 1958.56 661.745 1952.92C650.976 1947.11 642.515 1938.74 636.361 1927.79C626.275 1939.93 613.198 1949.16 597.13 1955.49C581.233 1961.64 564.395 1964.72 546.617 1964.72C528.156 1964.72 511.916 1961.13 497.899 1953.95C484.053 1946.6 473.369 1936.51 465.848 1923.69C458.327 1910.7 454.566 1895.83 454.566 1879.08C454.566 1859.59 459.78 1842.92 470.207 1829.08C480.634 1815.23 495.763 1804.72 515.592 1797.54C535.421 1790.19 559.267 1786.51 587.13 1786.51H623.797V1776.26C623.797 1748.39 605.848 1734.46 569.951 1734.46C560.891 1734.46 549.438 1735.74 535.592 1738.31C521.916 1740.87 508.498 1744.38 495.335 1748.82L476.617 1694.97C493.711 1688.48 511.745 1683.52 530.72 1680.1C549.694 1676.51 567.045 1674.72 582.771 1674.72C622.771 1674.72 652.6 1682.84 672.258 1699.08C691.916 1715.32 701.745 1739.25 701.745 1770.87V1877.54ZM574.566 1906.77C583.797 1906.77 593.113 1904.12 602.515 1898.82C611.916 1893.35 619.01 1886 623.797 1876.77V1832.67H603.797C581.574 1832.67 565.079 1836.09 554.31 1842.92C543.54 1849.76 538.156 1859.93 538.156 1873.44C538.156 1884.03 541.318 1892.24 547.643 1898.05C554.139 1903.86 563.113 1906.77 574.566 1906.77Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M984.204 1711.64C992.751 1700.19 1003.09 1691.21 1015.23 1684.72C1027.37 1678.05 1040.27 1674.72 1053.95 1674.72C1087.97 1674.72 1113.18 1687.37 1129.59 1712.67C1146.17 1737.79 1154.46 1773.26 1154.46 1819.08C1154.46 1847.45 1150.19 1872.67 1141.64 1894.72C1133.26 1916.6 1120.87 1933.78 1104.46 1946.26C1088.22 1958.56 1068.56 1964.72 1045.49 1964.72C1031.81 1964.72 1019.08 1961.81 1007.28 1956C995.657 1950.36 985.914 1942.15 978.05 1931.38L974.974 1956H903.179V1575.49L984.204 1567.03V1711.64ZM1024.2 1905.74C1055.32 1905.74 1070.87 1877.2 1070.87 1820.1C1070.87 1798.22 1069.16 1781.04 1065.74 1768.56C1062.32 1755.91 1057.45 1747.11 1051.13 1742.15C1044.97 1737.03 1037.37 1734.46 1028.31 1734.46C1011.55 1734.46 996.854 1744.97 984.204 1766V1880.87C989.503 1889.25 995.315 1895.49 1001.64 1899.59C1008.14 1903.69 1015.66 1905.74 1024.2 1905.74Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M1440.03 1877.54C1440.03 1887.62 1441.39 1895.06 1444.13 1899.85C1446.86 1904.46 1451.48 1907.97 1457.98 1910.36L1441.31 1963.69C1424.73 1962.15 1410.97 1958.56 1400.03 1952.92C1389.26 1947.11 1380.8 1938.74 1374.64 1927.79C1364.56 1939.93 1351.48 1949.16 1335.41 1955.49C1319.51 1961.64 1302.68 1964.72 1284.9 1964.72C1266.44 1964.72 1250.2 1961.13 1236.18 1953.95C1222.33 1946.6 1211.65 1936.51 1204.13 1923.69C1196.61 1910.7 1192.85 1895.83 1192.85 1879.08C1192.85 1859.59 1198.06 1842.92 1208.49 1829.08C1218.92 1815.23 1234.04 1804.72 1253.87 1797.54C1273.7 1790.19 1297.55 1786.51 1325.41 1786.51H1362.08V1776.26C1362.08 1748.39 1344.13 1734.46 1308.23 1734.46C1299.17 1734.46 1287.72 1735.74 1273.87 1738.31C1260.2 1740.87 1246.78 1744.38 1233.62 1748.82L1214.9 1694.97C1231.99 1688.48 1250.03 1683.52 1269 1680.1C1287.98 1676.51 1305.33 1674.72 1321.05 1674.72C1361.05 1674.72 1390.88 1682.84 1410.54 1699.08C1430.2 1715.32 1440.03 1739.25 1440.03 1770.87V1877.54ZM1312.85 1906.77C1322.08 1906.77 1331.39 1904.12 1340.8 1898.82C1350.2 1893.35 1357.29 1886 1362.08 1876.77V1832.67H1342.08C1319.86 1832.67 1303.36 1836.09 1292.59 1842.92C1281.82 1849.76 1276.44 1859.93 1276.44 1873.44C1276.44 1884.03 1279.6 1892.24 1285.92 1898.05C1292.42 1903.86 1301.39 1906.77 1312.85 1906.77Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M1627.64 1906.77C1641.49 1906.77 1652.43 1904.63 1660.46 1900.36C1668.67 1895.91 1672.77 1889.5 1672.77 1881.13C1672.77 1875.15 1671.15 1870.27 1667.9 1866.51C1664.65 1862.58 1658.58 1858.91 1649.7 1855.49C1640.81 1851.9 1626.96 1847.54 1608.16 1842.41C1580.81 1835.06 1559.87 1824.97 1545.34 1812.15C1530.98 1799.33 1523.8 1781.56 1523.8 1758.82C1523.8 1742.41 1528.33 1727.88 1537.39 1715.23C1546.62 1702.58 1560.12 1692.67 1577.9 1685.49C1595.68 1678.31 1617.05 1674.72 1642 1674.72C1685.25 1674.72 1722 1685.74 1752.26 1707.79L1719.95 1755.49C1708.16 1748.31 1695.76 1742.67 1682.77 1738.56C1669.95 1734.46 1657.13 1732.41 1644.31 1732.41C1631.15 1732.41 1621.32 1734.21 1614.82 1737.79C1608.5 1741.21 1605.34 1746.43 1605.34 1753.44C1605.34 1758.22 1606.96 1762.24 1610.21 1765.49C1613.63 1768.74 1619.7 1772.07 1628.41 1775.49C1637.3 1778.91 1651.06 1783.26 1669.7 1788.56C1689.35 1794.03 1705.34 1800.1 1717.64 1806.77C1729.95 1813.26 1739.52 1821.98 1746.36 1832.92C1753.37 1843.69 1756.87 1857.62 1756.87 1874.72C1756.87 1893.86 1751.06 1910.27 1739.44 1923.95C1727.99 1937.45 1712.52 1947.62 1693.03 1954.46C1673.54 1961.3 1651.92 1964.72 1628.16 1964.72C1602.69 1964.72 1579.78 1961.13 1559.44 1953.95C1539.1 1946.6 1521.58 1936.51 1506.87 1923.69L1547.64 1878.05C1558.93 1886.94 1571.32 1893.95 1584.82 1899.08C1598.33 1904.21 1612.6 1906.77 1627.64 1906.77Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M1907.06 1710.62C1929.79 1686.68 1956.46 1674.72 1987.06 1674.72C2011.16 1674.72 2029.62 1681.81 2042.44 1696C2055.43 1710.02 2061.93 1730.02 2061.93 1756V1956H1980.9V1778.56C1980.9 1767.45 1980.05 1758.74 1978.34 1752.41C1976.8 1746.09 1974.15 1741.56 1970.39 1738.82C1966.63 1735.91 1961.41 1734.46 1954.75 1734.46C1946.54 1734.46 1938.59 1737.28 1930.9 1742.92C1923.21 1748.56 1915.26 1756.77 1907.06 1767.54V1956H1826.03V1575.49L1907.06 1567.54V1710.62Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M2337.72 1956H2256.69V1575.49L2337.72 1567.03V1956ZM2425.67 1804.21L2522.59 1956H2430.28L2340.8 1806.77L2430.28 1683.69H2515.16L2425.67 1804.21Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M2793.54 1877.54C2793.54 1887.62 2794.91 1895.06 2797.64 1899.85C2800.38 1904.46 2805 1907.97 2811.49 1910.36L2794.82 1963.69C2778.24 1962.15 2764.48 1958.56 2753.54 1952.92C2742.77 1947.11 2734.31 1938.74 2728.16 1927.79C2718.07 1939.93 2705 1949.16 2688.93 1955.49C2673.03 1961.64 2656.19 1964.72 2638.41 1964.72C2619.95 1964.72 2603.71 1961.13 2589.7 1953.95C2575.85 1946.6 2565.17 1936.51 2557.64 1923.69C2550.12 1910.7 2546.36 1895.83 2546.36 1879.08C2546.36 1859.59 2551.58 1842.92 2562 1829.08C2572.43 1815.23 2587.56 1804.72 2607.39 1797.54C2627.22 1790.19 2651.06 1786.51 2678.93 1786.51H2715.59V1776.26C2715.59 1748.39 2697.64 1734.46 2661.75 1734.46C2652.69 1734.46 2641.23 1735.74 2627.39 1738.31C2613.71 1740.87 2600.29 1744.38 2587.13 1748.82L2568.41 1694.97C2585.51 1688.48 2603.54 1683.52 2622.52 1680.1C2641.49 1676.51 2658.84 1674.72 2674.57 1674.72C2714.57 1674.72 2744.4 1682.84 2764.06 1699.08C2783.71 1715.32 2793.54 1739.25 2793.54 1770.87V1877.54ZM2666.36 1906.77C2675.59 1906.77 2684.91 1904.12 2694.31 1898.82C2703.71 1893.35 2710.81 1886 2715.59 1876.77V1832.67H2695.59C2673.37 1832.67 2656.88 1836.09 2646.11 1842.92C2635.34 1849.76 2629.95 1859.93 2629.95 1873.44C2629.95 1884.03 2633.11 1892.24 2639.44 1898.05C2645.94 1903.86 2654.91 1906.77 2666.36 1906.77Z" style="fill: rgb(220, 27, 32);"/>
|
||||
<path d="M862 1819C862 1848.27 838.271 1872 809 1872C779.729 1872 756 1848.27 756 1819C756 1789.73 779.729 1766 809 1766C838.271 1766 862 1789.73 862 1819Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<path d="M2215.5 1819C2215.5 1848.27 2191.77 1872 2162.5 1872C2133.23 1872 2109.5 1848.27 2109.5 1819C2109.5 1789.73 2133.23 1766 2162.5 1766C2191.77 1766 2215.5 1789.73 2215.5 1819Z" style="fill: rgb(219, 25, 31);"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear" x1="1499" y1="139" x2="1499" y2="1385.52" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#E41F26"/>
|
||||
<stop offset="1" stop-color="#B70000"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="151" height="20" role="img" aria-label="babashka: compatible"><title>babashka: compatible</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="151" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="80" height="20" fill="#555"/><rect x="80" width="71" height="20" fill="#97ca00"/><rect width="151" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAxNDcyIDE0NzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTk1LjkxMSAxMTkzLjg5QzExMTAuOTMgMTExMi4zOCAxMTg2IDk3OC4yMDYgMTE4NiA4MjYuNUMxMTg2IDU3Ny45NzIgMTAxNCAyNTQuNSA3MzYgMTEzQzQ2MC41IDI2MiAyODYgNTc3Ljk3MiAyODYgODI2LjVDMjg2IDk3OC4yMDYgMzYxLjA3IDExMTIuMzggNDc2LjA4OSAxMTkzLjg5QzQ3MS45ODMgMTE5NC40NCA0NjcuOTQ5IDExOTUuMTQgNDY0IDExOTZDMzc2LjYxMSAxMjE1LjA3IDI3MCAxMzU5LjA1IDI3MCAxMzU5LjA1SDUzNEM1ODAuOTcyIDEzNTkuMDUgNjI1LjYzMSAxMzQxLjQxIDY2MC45NTYgMTMyMS42MkM2NzguMTE1IDEzNDQuMzIgNzA1LjM0NCAxMzU5IDczNiAxMzU5Qzc2Ni42NTYgMTM1OSA3OTMuODg1IDEzNDQuMzIgODExLjA0NCAxMzIxLjYyQzg0Ni4zNjkgMTM0MS40MSA4OTEuMDI4IDEzNTkuMDUgOTM4IDEzNTkuMDVIMTIwMkMxMjAyIDEzNTkuMDUgMTA5NS4zOSAxMjE1LjA3IDEwMDggMTE5NkMxMDA0LjA1IDExOTUuMTQgMTAwMC4wMiAxMTk0LjQ0IDk5NS45MTEgMTE5My44OVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcikiLz4KPGNpcmNsZSBjeD0iNzM1LjUiIGN5PSI4NTIuNSIgcj0iMzExLjUiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik00NDMgNzUwLjQxN0M2NjIgNzY1Ljg2NiA3OTEuMzgyIDcxMi4zODggODgxIDU3OS44ODFDODgxIDU3OS44ODEgNzA4LjI5MyA1MjEuNjQ5IDYwMy4yNDQgNTc5Ljg4MUM0OTguNTUgNjM3LjkxNiA0NDMgNzUwLjQxNyA0NDMgNzUwLjQxN1oiIGZpbGw9IiNCNEI0QjQiLz4KPHBhdGggZD0iTTEwMzkuOTkgNzQ4LjI4MkM5MTQuODYyIDczNC43NDUgODAzLjI2NCA2OTQuMTM1IDc1MCA1NDFDNzUwIDU0MSA4NjAuNjMzIDU2Ni4yNzIgOTcyLjM1NSA2NjguMTAxQzEwODguMzkgNzczLjg1NyAxMDM5Ljk5IDc0OC4yODIgMTAzOS45OSA3NDguMjgyWiIgZmlsbD0iI0I0QjRCNCIvPgo8Y2lyY2xlIGN4PSI3MzUuNSIgY3k9Ijg1Mi41IiByPSIzMTEuNSIgc3Ryb2tlPSIjMEEwMDAwIiBzdHJva2Utd2lkdGg9IjQwIi8+CjxwYXRoIGQ9Ik03OTcgNzE5SDY3NEw3MDQgNzQ5VjgzOUM3MDguNSA4MDkuNSA3NjQuNSA4MDguNSA3NjcuNSA4MzlMNzc1IDc0OUw3OTcgNzE5WiIgZmlsbD0iYmxhY2siLz4KPHBhdGggZD0iTTM1MS4xMTcgNzU5QzM1MS4xMTcgNzM2LjkwOSAzNjkuMDI2IDcxOSAzOTEuMTE3IDcxOUg2NzYuMDE4QzcwMC4yIDcxOSA3MTguODUyIDc0MC4yOTIgNzE1LjY3IDc2NC4yNjRMNjkwLjkxIDk1MC43NjRDNjg4LjI3IDk3MC42NDYgNjcxLjMxNCA5ODUuNSA2NTEuMjU4IDk4NS41SDM5MS4xMTdDMzY5LjAyNiA5ODUuNSAzNTEuMTE3IDk2Ny41OTEgMzUxLjExNyA5NDUuNVY3NTlaIiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNNzU2LjAxMiA3NjQuMjY3Qzc1Mi44MjggNzQwLjI5NCA3NzEuNDgxIDcxOSA3OTUuNjY0IDcxOUgxMDgwQzExMDIuMDkgNzE5IDExMjAgNzM2LjkwOSAxMTIwIDc1OVY5NDUuMDk2QzExMjAgOTY3LjE4NyAxMTAyLjA5IDk4NS4wOTYgMTA4MCA5ODUuMDk2SDgyMC4zODFDODAwLjMyNSA5ODUuMDk2IDc4My4zNyA5NzAuMjQ0IDc4MC43MjkgOTUwLjM2Mkw3NTYuMDEyIDc2NC4yNjdaIiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNMTAyNCA5NTJWOTIxLjQ3SDEwMTMuNzFDMTAwNy4wMyA5MjEuNDcgMTAwMi41OCA5MTYuNzUyIDEwMDAuMzUgOTA5LjgxM0w5NTguMDY0IDc4Mi42OTdDOTU1LjI4MiA3NzQuNjQ5IDk1MS45NDQgNzY4LjgyIDk0Ny40OTIgNzY0LjM3OUM5MzkuMTQ2IDc1NS43NzUgOTI4LjI5NiA3NTMgOTE2LjA1NCA3NTNIOTAyLjdWNzg0LjkxOEg5MTEuNjAzQzkxOS4xMTUgNzg0LjkxOCA5MjQuOTU3IDc4Ny42OTMgOTI3LjQ2MSA3OTYuNTc1TDkzMy4zMDMgODE3LjExM0w4ODEgOTUySDkxOS4xMTVMOTUwLjU1MyA4NjMuMTg1TDk2Ny4yNDUgOTE2Ljc1MkM5NzMuNjQ0IDkzNy41NjggOTg0LjQ5NCA5NTIgMTAwOC45OCA5NTJIMTAyNFoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik01OTAgOTUyVjkyMS40N0g1NzkuNzA2QzU3My4wMjkgOTIxLjQ3IDU2OC41NzggOTE2Ljc1MiA1NjYuMzUyIDkwOS44MTNMNTI0LjA2NCA3ODIuNjk3QzUyMS4yODIgNzc0LjY0OSA1MTcuOTQ0IDc2OC44MiA1MTMuNDkyIDc2NC4zNzlDNTA1LjE0NiA3NTUuNzc1IDQ5NC4yOTYgNzUzIDQ4Mi4wNTQgNzUzSDQ2OC43Vjc4NC45MThINDc3LjYwM0M0ODUuMTE1IDc4NC45MTggNDkwLjk1NyA3ODcuNjkzIDQ5My40NjEgNzk2LjU3NUw0OTkuMzAzIDgxNy4xMTNMNDQ3IDk1Mkg0ODUuMTE1TDUxNi41NTMgODYzLjE4NUw1MzMuMjQ1IDkxNi43NTJDNTM5LjY0NCA5MzcuNTY4IDU1MC40OTQgOTUyIDU3NC45NzcgOTUySDU5MFoiIGZpbGw9IndoaXRlIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXIiIHgxPSI3NTIiIHkxPSIxMTMiIHgyPSI3NTIiIHkyPSIxMzU5LjUyIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNFNDFGMjYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjQjcwMDAwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjwvZGVmcz4KPC9zdmc+Cg=="/><text aria-hidden="true" x="495" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">babashka</text><text x="495" y="140" transform="scale(.1)" fill="#fff" textLength="530">babashka</text><text aria-hidden="true" x="1145" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="610">compatible</text><text x="1145" y="140" transform="scale(.1)" fill="#fff" textLength="610">compatible</text></g></svg>
|
||||
|
Before Width: | Height: | Size: 4.8 KiB |
|
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="129" height="20" role="img" aria-label="babashka: built-in"><title>babashka: built-in</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="129" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="80" height="20" fill="#555"/><rect x="80" width="49" height="20" fill="#97ca00"/><rect width="129" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDE0NzIgMTQ3MiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OTUuOTExIDExOTMuODlDMTExMC45MyAxMTEyLjM4IDExODYgOTc4LjIwNiAxMTg2IDgyNi41QzExODYgNTc3Ljk3MiAxMDE0IDI1NC41IDczNiAxMTNDNDYwLjUgMjYyIDI4NiA1NzcuOTcyIDI4NiA4MjYuNUMyODYgOTc4LjIwNiAzNjEuMDcgMTExMi4zOCA0NzYuMDg5IDExOTMuODlDNDcxLjk4MyAxMTk0LjQ0IDQ2Ny45NDkgMTE5NS4xNCA0NjQgMTE5NkMzNzYuNjExIDEyMTUuMDcgMjcwIDEzNTkuMDUgMjcwIDEzNTkuMDVINTM0QzU4MC45NzIgMTM1OS4wNSA2MjUuNjMxIDEzNDEuNDEgNjYwLjk1NiAxMzIxLjYyQzY3OC4xMTUgMTM0NC4zMiA3MDUuMzQ0IDEzNTkgNzM2IDEzNTlDNzY2LjY1NiAxMzU5IDc5My44ODUgMTM0NC4zMiA4MTEuMDQ0IDEzMjEuNjJDODQ2LjM2OSAxMzQxLjQxIDg5MS4wMjggMTM1OS4wNSA5MzggMTM1OS4wNUgxMjAyQzEyMDIgMTM1OS4wNSAxMDk1LjM5IDEyMTUuMDcgMTAwOCAxMTk2QzEwMDQuMDUgMTE5NS4xNCAxMDAwLjAyIDExOTQuNDQgOTk1LjkxMSAxMTkzLjg5WiIgZmlsbD0idXJsKCNwYWludDBfbGluZWFyKSIvPgo8Y2lyY2xlIGN4PSI3MzUuNSIgY3k9Ijg1Mi41IiByPSIzMTEuNSIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTQ0MyA3NTAuNDE3QzY2MiA3NjUuODY2IDc5MS4zODIgNzEyLjM4OCA4ODEgNTc5Ljg4MUM4ODEgNTc5Ljg4MSA3MDguMjkzIDUyMS42NDkgNjAzLjI0NCA1NzkuODgxQzQ5OC41NSA2MzcuOTE2IDQ0MyA3NTAuNDE3IDQ0MyA3NTAuNDE3WiIgZmlsbD0iI0I0QjRCNCIvPgo8cGF0aCBkPSJNMTAzOS45OSA3NDguMjgyQzkxNC44NjIgNzM0Ljc0NSA4MDMuMjY0IDY5NC4xMzUgNzUwIDU0MUM3NTAgNTQxIDg2MC42MzMgNTY2LjI3MiA5NzIuMzU1IDY2OC4xMDFDMTA4OC4zOSA3NzMuODU3IDEwMzkuOTkgNzQ4LjI4MiAxMDM5Ljk5IDc0OC4yODJaIiBmaWxsPSIjQjRCNEI0Ii8+CjxjaXJjbGUgY3g9IjczNS41IiBjeT0iODUyLjUiIHI9IjMxMS41IiBzdHJva2U9IiMwQTAwMDAiIHN0cm9rZS13aWR0aD0iNDAiLz4KPHBhdGggZD0iTTc5NyA3MTlINjc0TDcwNCA3NDlWODM5QzcwOC41IDgwOS41IDc2NC41IDgwOC41IDc2Ny41IDgzOUw3NzUgNzQ5TDc5NyA3MTlaIiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNMzUxLjExNyA3NTlDMzUxLjExNyA3MzYuOTA5IDM2OS4wMjYgNzE5IDM5MS4xMTcgNzE5SDY3Ni4wMThDNzAwLjIgNzE5IDcxOC44NTIgNzQwLjI5MiA3MTUuNjcgNzY0LjI2NEw2OTAuOTEgOTUwLjc2NEM2ODguMjcgOTcwLjY0NiA2NzEuMzE0IDk4NS41IDY1MS4yNTggOTg1LjVIMzkxLjExN0MzNjkuMDI2IDk4NS41IDM1MS4xMTcgOTY3LjU5MSAzNTEuMTE3IDk0NS41Vjc1OVoiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGQ9Ik03NTYuMDEyIDc2NC4yNjdDNzUyLjgyOCA3NDAuMjk0IDc3MS40ODEgNzE5IDc5NS42NjQgNzE5SDEwODBDMTEwMi4wOSA3MTkgMTEyMCA3MzYuOTA5IDExMjAgNzU5Vjk0NS4wOTZDMTEyMCA5NjcuMTg3IDExMDIuMDkgOTg1LjA5NiAxMDgwIDk4NS4wOTZIODIwLjM4MUM4MDAuMzI1IDk4NS4wOTYgNzgzLjM3IDk3MC4yNDQgNzgwLjcyOSA5NTAuMzYyTDc1Ni4wMTIgNzY0LjI2N1oiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGQ9Ik0xMDI0IDk1MlY5MjEuNDdIMTAxMy43MUMxMDA3LjAzIDkyMS40NyAxMDAyLjU4IDkxNi43NTIgMTAwMC4zNSA5MDkuODEzTDk1OC4wNjQgNzgyLjY5N0M5NTUuMjgyIDc3NC42NDkgOTUxLjk0NCA3NjguODIgOTQ3LjQ5MiA3NjQuMzc5QzkzOS4xNDYgNzU1Ljc3NSA5MjguMjk2IDc1MyA5MTYuMDU0IDc1M0g5MDIuN1Y3ODQuOTE4SDkxMS42MDNDOTE5LjExNSA3ODQuOTE4IDkyNC45NTcgNzg3LjY5MyA5MjcuNDYxIDc5Ni41NzVMOTMzLjMwMyA4MTcuMTEzTDg4MSA5NTJIOTE5LjExNUw5NTAuNTUzIDg2My4xODVMOTY3LjI0NSA5MTYuNzUyQzk3My42NDQgOTM3LjU2OCA5ODQuNDk0IDk1MiAxMDA4Ljk4IDk1MkgxMDI0WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZD0iTTU5MCA5NTJWOTIxLjQ3SDU3OS43MDZDNTczLjAyOSA5MjEuNDcgNTY4LjU3OCA5MTYuNzUyIDU2Ni4zNTIgOTA5LjgxM0w1MjQuMDY0IDc4Mi42OTdDNTIxLjI4MiA3NzQuNjQ5IDUxNy45NDQgNzY4LjgyIDUxMy40OTIgNzY0LjM3OUM1MDUuMTQ2IDc1NS43NzUgNDk0LjI5NiA3NTMgNDgyLjA1NCA3NTNINDY4LjdWNzg0LjkxOEg0NzcuNjAzQzQ4NS4xMTUgNzg0LjkxOCA0OTAuOTU3IDc4Ny42OTMgNDkzLjQ2MSA3OTYuNTc1TDQ5OS4zMDMgODE3LjExM0w0NDcgOTUySDQ4NS4xMTVMNTE2LjU1MyA4NjMuMTg1TDUzMy4yNDUgOTE2Ljc1MkM1MzkuNjQ0IDkzNy41NjggNTUwLjQ5NCA5NTIgNTc0Ljk3NyA5NTJINTkwWiIgZmlsbD0id2hpdGUiLz4KPGRlZnM+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhciIgeDE9Ijc1MiIgeTE9IjExMyIgeDI9Ijc1MiIgeTI9IjEzNTkuNTIiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0U0MUYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNCNzAwMDAiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"/><text aria-hidden="true" x="495" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">babashka</text><text x="495" y="140" transform="scale(.1)" fill="#fff" textLength="530">babashka</text><text aria-hidden="true" x="1035" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="390">built-in</text><text x="1035" y="140" transform="scale(.1)" fill="#fff" textLength="390">built-in</text></g></svg>
|
||||
|
Before Width: | Height: | Size: 4.8 KiB |
2
pods
2
pods
|
|
@ -1 +1 @@
|
|||
Subproject commit 717cef7af5cb1c1b091bd10e012b2e71b7b8b9bc
|
||||
Subproject commit de4c3610c9ef3879370d01b7202a9f3a9d056f6e
|
||||
2
process
2
process
|
|
@ -1 +1 @@
|
|||
Subproject commit 2058c79fb63f80ca71917432eddea73e0c58717c
|
||||
Subproject commit 4c6699d06b49773d3e5c5b4c11d3334fb78cc996
|
||||
81
project.clj
81
project.clj
|
|
@ -8,83 +8,64 @@
|
|||
:license {:name "Eclipse Public License 1.0"
|
||||
:url "http://opensource.org/licenses/eclipse-1.0.php"}
|
||||
:source-paths ["src" "sci/src" "babashka.curl/src" "fs/src" "pods/src"
|
||||
"babashka.core/src"
|
||||
"babashka.nrepl/src" "depstar/src" "process/src"
|
||||
"deps.clj/src" "deps.clj/resources"
|
||||
"impl-java/src"]
|
||||
"deps.clj/src" "deps.clj/resources"]
|
||||
;; for debugging Reflector.java code:
|
||||
;; :java-source-paths ["sci/reflector/src-java"]
|
||||
:java-source-paths ["src-java"]
|
||||
:resource-paths ["resources" "sci/resources"]
|
||||
:test-selectors {:default (complement (some-fn :windows-only :flaky))
|
||||
:windows (complement (some-fn :skip-windows :flaky))
|
||||
:non-flaky (complement :flaky)
|
||||
:flaky :flaky}
|
||||
:jvm-opts ["--enable-preview"]
|
||||
:dependencies [[org.clojure/clojure "1.12.0"]
|
||||
[borkdude/edamame "1.4.30"]
|
||||
[org.clojure/tools.cli "1.0.214"]
|
||||
[cheshire "6.0.0"]
|
||||
[nrepl/bencode "1.2.0"]
|
||||
[borkdude/sci.impl.reflector "0.0.4"]
|
||||
[org.babashka/sci.impl.types "0.0.2"]
|
||||
[org.babashka/babashka.impl.java "0.1.10"]
|
||||
[org.clojure/core.async "1.8.741"]
|
||||
[org.clojure/test.check "1.1.1"]
|
||||
[com.github.clj-easy/graal-build-time "0.1.0"]
|
||||
[rewrite-clj/rewrite-clj "1.1.49"]
|
||||
[insn/insn "0.5.2"]
|
||||
[org.babashka/cli "0.8.65"]
|
||||
[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"]]
|
||||
:metabom {:jar-name "metabom.jar"}
|
||||
:test-selectors {:default (complement :windows-only)
|
||||
:windows (complement :skip-windows)}
|
||||
:dependencies [[org.clojure/clojure "1.11.0-alpha1"]
|
||||
[borkdude/edamame "0.0.11"]
|
||||
[borkdude/graal.locking "0.0.2"]
|
||||
[org.clojure/tools.cli "1.0.206"]
|
||||
[cheshire "5.10.1"]
|
||||
[nrepl/bencode "1.1.0"]
|
||||
[borkdude/sci.impl.reflector "0.0.1"]
|
||||
[org.clojure/test.check "1.1.0"]
|
||||
[com.taoensso/timbre "5.1.2"]
|
||||
[org.clojure/tools.logging "1.1.0"]]
|
||||
:profiles {:feature/xml {:source-paths ["feature-xml"]
|
||||
:dependencies [[org.clojure/data.xml "0.2.0-alpha8"]]}
|
||||
:dependencies [[org.clojure/data.xml "0.2.0-alpha6"]]}
|
||||
:feature/yaml {:source-paths ["feature-yaml"]
|
||||
:dependencies [[clj-commons/clj-yaml "1.0.29"
|
||||
:exclusions [org.flatland/ordered]#_#_clj-commons/clj-yaml "0.7.110"]
|
||||
[org.flatland/ordered "1.15.12"]]}
|
||||
:dependencies [[clj-commons/clj-yaml "0.7.107"]]}
|
||||
:feature/jdbc {:source-paths ["feature-jdbc"]
|
||||
:dependencies [[seancorfield/next.jdbc "1.1.610"]]}
|
||||
:feature/sqlite [:feature/jdbc {:dependencies [[org.xerial/sqlite-jdbc "3.36.0.3"]]}]
|
||||
:feature/postgresql [:feature/jdbc {:dependencies [[org.postgresql/postgresql "42.2.18"]]}]
|
||||
;:feature/oracledb [:feature/jdbc {:dependencies [[com.oracle.database.jdbc/ojdbc8 "19.8.0.0"]]}]
|
||||
:feature/oracledb [:feature/jdbc {:dependencies [[io.helidon.integrations.db/ojdbc "2.1.0"]]}] ; ojdbc10 + GraalVM config, by Oracle
|
||||
:feature/hsqldb [:feature/jdbc {:dependencies [[org.hsqldb/hsqldb "2.5.1"]]}]
|
||||
:feature/core-async {:source-paths ["feature-core-async"]
|
||||
:dependencies [[org.clojure/core.async "1.3.618"]]}
|
||||
:feature/csv {:source-paths ["feature-csv"]
|
||||
:dependencies [[org.clojure/data.csv "1.0.0"]]}
|
||||
:feature/transit {:source-paths ["feature-transit"]
|
||||
:dependencies [[com.cognitect/transit-clj "1.0.333"]]}
|
||||
:dependencies [[com.cognitect/transit-clj "1.0.324"]]}
|
||||
:feature/datascript {:source-paths ["feature-datascript"]
|
||||
:dependencies [[datascript "1.3.10"]]}
|
||||
:dependencies [[datascript "1.0.1"]]}
|
||||
:feature/httpkit-client {:source-paths ["feature-httpkit-client"]
|
||||
:dependencies [[http-kit "2.8.0-RC1"]]}
|
||||
:dependencies [[http-kit "2.5.3"]]}
|
||||
:feature/httpkit-server {:source-paths ["feature-httpkit-server"]
|
||||
:dependencies [[http-kit "2.8.0-RC1"]]}
|
||||
:dependencies [[http-kit "2.5.3"]]}
|
||||
:feature/lanterna {:source-paths ["feature-lanterna"]
|
||||
:dependencies [[babashka/clojure-lanterna "0.9.8-SNAPSHOT"]]}
|
||||
:feature/core-match {:source-paths ["feature-core-match"]
|
||||
:dependencies [[org.clojure/core.match "1.0.0"]]}
|
||||
: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/spec-alpha {:source-paths ["feature-spec-alpha"]}
|
||||
:feature/rewrite-clj {:source-paths ["feature-rewrite-clj"]
|
||||
:dependencies [[rewrite-clj/rewrite-clj "1.0.644-alpha"]]}
|
||||
:feature/selmer {:source-paths ["feature-selmer"]
|
||||
:dependencies [[selmer/selmer "1.12.59"]]}
|
||||
:feature/logging {:source-paths ["feature-logging"]
|
||||
:dependencies [[com.taoensso/timbre "6.6.0"]
|
||||
[org.clojure/tools.logging "1.1.0"]]}
|
||||
:feature/priority-map {:source-paths ["feature-priority-map"]
|
||||
:dependencies [[org.clojure/data.priority-map "1.1.0"]]}
|
||||
:feature/rrb-vector {:source-paths ["feature-rrb-vector"]
|
||||
:dependencies [[org.clojure/core.rrb-vector "0.1.2"]]}
|
||||
:dependencies [[selmer/selmer "1.12.44"]]}
|
||||
:test [:feature/xml
|
||||
:feature/lanterna
|
||||
:feature/yaml
|
||||
:feature/postgresql
|
||||
:feature/hsqldb
|
||||
:feature/core-async
|
||||
:feature/csv
|
||||
:feature/transit
|
||||
:feature/datascript
|
||||
|
|
@ -94,14 +75,10 @@
|
|||
:feature/hiccup
|
||||
:feature/test-check
|
||||
:feature/spec-alpha
|
||||
:feature/rewrite-clj
|
||||
:feature/selmer
|
||||
:feature/logging
|
||||
:feature/priority-map
|
||||
:feature/rrb-vector
|
||||
{:dependencies [[borkdude/rewrite-edn "0.4.6"]
|
||||
[com.clojure-goes-fast/clj-async-profiler "0.5.0"]
|
||||
[com.opentable.components/otj-pg-embedded "0.13.3"]
|
||||
[nubank/matcher-combinators "3.6.0"]]}]
|
||||
{:dependencies [[com.clojure-goes-fast/clj-async-profiler "0.5.0"]
|
||||
[com.opentable.components/otj-pg-embedded "0.13.3"]]}]
|
||||
:uberjar {:global-vars {*assert* false}
|
||||
:jvm-opts ["-Dclojure.compiler.direct-linking=true"
|
||||
"-Dclojure.spec.skip-macros=true"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.12.200
|
||||
0.5.0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.12.201-SNAPSHOT
|
||||
0.5.1-SNAPSHOT
|
||||
|
|
@ -1,198 +0,0 @@
|
|||
{:paths ["src" "feature-xml"
|
||||
"feature-yaml" "feature-csv" "feature-transit"
|
||||
"feature-java-time" "feature-java-nio"
|
||||
"feature-httpkit-client" "feature-httpkit-server"
|
||||
"feature-lanterna"
|
||||
"feature-core-match"
|
||||
"feature-hiccup"
|
||||
"feature-test-check"
|
||||
"feature-spec-alpha"
|
||||
"feature-selmer"
|
||||
"feature-logging"
|
||||
"feature-priority-map"
|
||||
"feature-rrb-vector"
|
||||
"feature-jdbc"
|
||||
"pods/src"
|
||||
"babashka.nrepl/src"
|
||||
"depstar/src" "process/src"
|
||||
"deps.clj/src" "deps.clj/resources"
|
||||
"resources" "sci/resources"
|
||||
"impl-java/src"],
|
||||
:deps {org.clojure/clojure {:mvn/version "1.12.0"},
|
||||
org.babashka/sci {:local/root "sci"}
|
||||
org.babashka/babashka.impl.java {:mvn/version "0.1.10"}
|
||||
org.babashka/sci.impl.types {:mvn/version "0.0.2"}
|
||||
babashka/babashka.curl {:local/root "babashka.curl"}
|
||||
babashka/fs {:local/root "fs"}
|
||||
babashka/babashka.core {:local/root "babashka.core"}
|
||||
org.clojure/core.async {:mvn/version "1.8.741"},
|
||||
org.clojure/tools.cli {:mvn/version "1.0.214"},
|
||||
org.clojure/data.csv {:mvn/version "1.0.0"},
|
||||
cheshire/cheshire {:mvn/version "6.0.0"}
|
||||
org.clojure/data.xml {:mvn/version "0.2.0-alpha8"}
|
||||
clj-commons/clj-yaml {:mvn/version "1.0.29"}
|
||||
com.cognitect/transit-clj {:mvn/version "1.0.333"}
|
||||
org.clojure/test.check {:mvn/version "1.1.1"}
|
||||
nrepl/bencode {:mvn/version "1.2.0"}
|
||||
seancorfield/next.jdbc {:mvn/version "1.1.610"}
|
||||
org.postgresql/postgresql {:mvn/version "42.2.18"}
|
||||
org.hsqldb/hsqldb {:mvn/version "2.5.1"}
|
||||
datascript/datascript {:mvn/version "1.0.1"}
|
||||
http-kit/http-kit {:mvn/version "2.8.0-RC1"}
|
||||
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
||||
org.clojure/core.match {:mvn/version "1.0.0"}
|
||||
hiccup/hiccup {:mvn/version "2.0.0-RC1"}
|
||||
rewrite-clj/rewrite-clj {:mvn/version "1.1.49"}
|
||||
selmer/selmer {:mvn/version "1.12.59"}
|
||||
com.taoensso/timbre {:mvn/version "6.6.0"}
|
||||
org.clojure/tools.logging {:mvn/version "1.1.0"}
|
||||
org.clojure/data.priority-map {:mvn/version "1.1.0"}
|
||||
insn/insn {:mvn/version "0.5.2"}
|
||||
org.clojure/core.rrb-vector {:mvn/version "0.1.2"}
|
||||
org.babashka/cli {:mvn/version "0.8.65"}
|
||||
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
|
||||
{:main-opts ["-m" "babashka.main"]}
|
||||
:profile
|
||||
{:extra-deps
|
||||
{com.clojure-goes-fast/clj-async-profiler {:mvn/version "0.5.0"}}
|
||||
:extra-paths ["test"]
|
||||
:jvm-opts ["-Djdk.attach.allowAttachSelf"
|
||||
"-Dclojure.compiler.direct-linking=true"]
|
||||
:main-opts ["-m" "babashka.profile"]}
|
||||
: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"}
|
||||
#_#_org.babashka/spec.alpha {:git/url "https://github.com/babashka/spec.alpha"
|
||||
:sha "0dec1f88cbde74a0470b454396f09a03adb4ae39"}
|
||||
lambdaisland/regal {:mvn/version "0.0.143"}
|
||||
cprop/cprop {:mvn/version "0.1.16"}
|
||||
comb/comb {:mvn/version "0.1.1"}
|
||||
mvxcvi/arrangement {:mvn/version "2.0.0"}
|
||||
org.clojure/data.zip {:mvn/version "1.0.0"}
|
||||
clojure-csv/clojure-csv {:mvn/version "2.0.2"}
|
||||
org.clojure/math.combinatorics {:mvn/version "0.1.6"}
|
||||
doric/doric {:mvn/version "0.9.0"}
|
||||
henryw374/cljc.java-time
|
||||
{:git/url "https://github.com/henryw374/cljc.java-time.git"
|
||||
:sha "e3d184b78e933322b3fcaa6ca66cbb8f42a6b35c"}
|
||||
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.2"}
|
||||
aero/aero {:mvn/version "1.1.6"}
|
||||
org.clojure/data.generators {:mvn/version "1.0.0"}
|
||||
honeysql/honeysql {:mvn/version "1.0.461"}
|
||||
com.github.seancorfield/honeysql {:mvn/version "2.2.840"}
|
||||
minimallist/minimallist {:mvn/version "0.0.10"}
|
||||
circleci/bond {:mvn/version "0.6.0"}
|
||||
version-clj/version-clj {:mvn/version "2.0.2"}
|
||||
gaka/gaka {:mvn/version "0.3.0"}
|
||||
failjure/failjure {:mvn/version "2.2.0"}
|
||||
io.helins/binf {:mvn/version "1.1.0-beta0"}
|
||||
rm-hull/jasentaa {:mvn/version "0.2.5"}
|
||||
slingshot/slingshot {:mvn/version "0.12.2"}
|
||||
io.replikativ/hasch {:mvn/version "0.3.7"}
|
||||
com.grammarly/omniconf {:mvn/version "0.4.3"}
|
||||
crispin/crispin {:mvn/version "0.3.8"}
|
||||
org.clojure/data.json {:mvn/version "2.4.0"}
|
||||
clj-commons/multigrep {:mvn/version "0.5.0"}
|
||||
amperity/vault-clj {:mvn/version "1.0.4"}
|
||||
java-http-clj/java-http-clj {:mvn/version "0.4.3"}
|
||||
com.stuartsierra/component {:mvn/version "1.0.0"}
|
||||
org.clojars.askonomm/ruuter {:mvn/version "1.2.2"}
|
||||
org.clj-commons/digest {:mvn/version "1.4.100"}
|
||||
hato/hato {:mvn/version "0.8.2"}
|
||||
better-cond/better-cond {:mvn/version "2.1.1"}
|
||||
org.clojure/core.specs.alpha {:mvn/version "0.2.62"}
|
||||
reifyhealth/specmonstah {:git/url "https://github.com/reifyhealth/specmonstah", :sha "a2b357009a3aa99a0c2d2361f3bbcd0b0e36505e"}
|
||||
exoscale/coax {:mvn/version "1.0.0-alpha14"}
|
||||
orchestra/orchestra {:mvn/version "2021.01.01-1"}
|
||||
expound/expound {:mvn/version "0.8.10"}
|
||||
integrant/integrant {:git/url "https://github.com/weavejester/integrant", :git/sha "a9fd7c02bd7201f36344b47142badc3c3ef22f88"}
|
||||
com.stuartsierra/dependency {:mvn/version "1.0.0"}
|
||||
listora/again {:mvn/version "1.0.0"}
|
||||
org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
||||
environ/environ {:mvn/version "1.2.0"}
|
||||
table/table {:git/url "https://github.com/cldwalker/table", :sha "f6293c5f3dac1dd6f525a80fc80930f8ccdf16b7"}
|
||||
markdown-clj/markdown-clj {:mvn/version "1.10.8"}
|
||||
org.clojure/tools.namespace {:git/sha "daf82a10e70182aea4c0716a48f3922163441b32",
|
||||
:git/url "https://github.com/clojure/tools.namespace"}
|
||||
medley/medley {:mvn/version "1.3.0"}
|
||||
io.github.cognitect-labs/test-runner {:git/url "https://github.com/cognitect-labs/test-runner",
|
||||
:git/sha "7284cda41fb9edc0f3bc6b6185cfb7138fc8a023"}
|
||||
borkdude/missing.test.assertions {:git/url "https://github.com/borkdude/missing.test.assertions", :sha "603cb01bee72fb17addacc53c34c85612684ad70"}
|
||||
dev.nubank/docopt {:mvn/version "0.6.1-fix7"}
|
||||
testdoc/testdoc {:mvn/version "1.4.1"}
|
||||
org.clojars.lispyclouds/contajners {:mvn/version "0.0.6"}
|
||||
borkdude/rewrite-edn {:mvn/version "0.1.0"}
|
||||
clojure-term-colors/clojure-term-colors {:mvn/version "0.1.0"}
|
||||
io.aviso/pretty {:mvn/version "1.1.1"}
|
||||
progrock/progrock {:mvn/version "0.1.2"}
|
||||
djblue/portal {:mvn/version "0.19.0"}
|
||||
com.wsscode/cljc-misc {:mvn/version "2021.10.16"}
|
||||
edn-query-language/eql {:mvn/version "2021.07.18"}
|
||||
meta-merge/meta-merge {:mvn/version "1.0.0"}
|
||||
com.exoscale/lingo {:mvn/version "1.0.0-alpha14"}
|
||||
io.github.swirrl/dogstatsd {:mvn/version "0.1.39"}
|
||||
org.clojure/algo.monads {:mvn/version "0.1.6"}
|
||||
io.lambdaforge/datalog-parser {:mvn/version "0.1.9"}
|
||||
clj-stacktrace/clj-stacktrace {:mvn/version "0.2.8"}
|
||||
clojure-msgpack/clojure-msgpack {:mvn/version "1.2.1"}
|
||||
cli-matic/cli-matic {:git/url "https://github.com/l3nz/cli-matic.git", :git/sha "9cd53ba7336363e3d06650dbad413b6f8b06e471"}
|
||||
aysylu/loom {:mvn/version "1.0.2"}
|
||||
com.layerware/hugsql-core {:mvn/version "0.5.3"}
|
||||
com.github.seancorfield/expectations {:mvn/version "2.0.157"}
|
||||
com.rpl/specter {:mvn/version "1.1.4"}
|
||||
com.github.askonomm/clarktown {:mvn/version "1.1.2"}
|
||||
org.clojure/math.numeric-tower {:git/tag "math.numeric-tower-0.0.5", :git/sha "12eb9c5", :git/url "https://github.com/clojure/math.numeric-tower"}
|
||||
prismatic/schema {:git/url "https://github.com/plumatic/schema"
|
||||
:git/sha "6846dc7c3a9df5bfd718f68f183c683ce0f621ff"
|
||||
:git/tag "schema-1.3.0"}
|
||||
metosin/malli {:git/url "https://github.com/metosin/malli"
|
||||
:git/sha "588147ef49b2e41c7d12a8aa994b39c1c6fedd99"
|
||||
:git/tag "0.8.9"}
|
||||
meander/epsilon {:git/url "https://github.com/noprompt/meander"
|
||||
:git/sha "55f5ce70e6ef717e95c58260f6bc725d70c0cb6d"}
|
||||
cc.qbits/auspex {:git/url "https://github.com/mpenet/auspex"
|
||||
:git/sha "1a9d7427e60e1a434a764aa820d1c53f7e22504a"
|
||||
:deps/manifest :deps}
|
||||
exoscale/interceptor {:git/url "https://github.com/exoscale/interceptor"
|
||||
:git/sha "ca115fe00a0abf3a2f78452ab309c3aa4c00fc4e"
|
||||
: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
|
||||
org.clojure/spec.alpha nil}}
|
||||
:clj-nvd
|
||||
{:extra-deps {clj-nvd/clj-nvd {:git/url "https://github.com/miikka/clj-nvd.git"
|
||||
:sha "f2ec98699e057a379baf170cb49cf7ad76874a70"}}
|
||||
:main-opts ["-m" "clj-nvd.core"]}
|
||||
:test
|
||||
{:extra-paths ["test"]
|
||||
:extra-deps {io.github.cognitect-labs/test-runner
|
||||
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
|
||||
nubank/matcher-combinators {:mvn/version "3.6.0"}}
|
||||
:main-opts ["-m" "cognitect.test-runner"]
|
||||
:exec-fn cognitect.test-runner.api/test}
|
||||
:test-pod
|
||||
{:extra-paths ["test-resources"]
|
||||
:main-opts ["-m" "babashka.main" "test-resources/pod.clj"]}}}
|
||||
;; release
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
|
||||
ImageName=bb
|
||||
Args=-H:+ReportExceptionStackTraces \
|
||||
-J-Dborkdude.dynaload.aot=true \
|
||||
-H:IncludeResources=BABASHKA_VERSION \
|
||||
-H:IncludeResources=META-INF/babashka/.* \
|
||||
-H:IncludeResources=src/babashka/.* \
|
||||
-H:IncludeResources=SCI_VERSION \
|
||||
-H:Log=registerResource:3 \
|
||||
--enable-url-protocols=http,https,jar,unix \
|
||||
--enable-all-security-services \
|
||||
-H:+JNI \
|
||||
--no-server \
|
||||
--report-unsupported-elements-at-runtime \
|
||||
--initialize-at-build-time=com.fasterxml.jackson \
|
||||
--initialize-at-build-time=java.sql.SQLException \
|
||||
--initialize-at-build-time=org.yaml.snakeyaml \
|
||||
--initialize-at-run-time=org.postgresql.sspi.SSPIClient \
|
||||
--initialize-at-run-time=org.httpkit.client.ClientSslEngineFactory$SSLHolder \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileReader \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileReader \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.MixerProvider \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.FormatConversionProvider \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.sampled.spi.AudioFileWriter \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiDeviceProvider \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.SoundbankReader \
|
||||
-H:ServiceLoaderFeatureExcludeServices=javax.sound.midi.spi.MidiFileWriter \
|
||||
-H:ServiceLoaderFeatureExcludeServices=java.net.ContentHandlerFactory \
|
||||
-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 5ed2190f3c97de6d30f3aba96362bf6c68e95e90
|
||||
|
|
@ -1,206 +0,0 @@
|
|||
#!/usr/bin/env bb
|
||||
;; Adds a library to bb-tested-libs.edn and libraries.csv and optionally run its
|
||||
;; tests. There are two modes to this script - automatic (default) and manual.
|
||||
;; The script defaults to automatically copying tests as this normally works.
|
||||
;; There are several options to specify where the library is including
|
||||
;; --git-url, --dir and --test-directories. See --help for more. In manual mode,
|
||||
;; tests are manually added outside of the script and the script is run to add
|
||||
;; the library to library lists.
|
||||
|
||||
(ns add-libtest
|
||||
(:require [babashka.deps :as deps]
|
||||
[babashka.fs :as fs]
|
||||
[babashka.tasks :refer [shell]]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.string :as str]
|
||||
[clojure.tools.cli :as cli]
|
||||
[org.httpkit.client :as http]))
|
||||
|
||||
(deps/add-deps '{:deps {org.clojure/tools.gitlibs {:mvn/version "2.4.172"}
|
||||
borkdude/rewrite-edn {:mvn/version "0.1.0"}
|
||||
org.clojure/data.csv {:mvn/version "1.0.0"}}})
|
||||
|
||||
(require '[clojure.tools.gitlibs :as gl])
|
||||
(require '[borkdude.rewrite-edn :as r])
|
||||
(require '[clojure.data.csv :as csv])
|
||||
|
||||
;; CLI Utils
|
||||
;; =========
|
||||
(defn- error
|
||||
"Print error message(s) and exit"
|
||||
[& msgs]
|
||||
(apply println "Error:" msgs)
|
||||
(System/exit 1))
|
||||
|
||||
(defn- print-summary
|
||||
"Print help summary given args and opts strings"
|
||||
[args-string options-summary]
|
||||
(println (format "Usage: %s [OPTIONS]%s\nOptions:\n%s"
|
||||
(.getName (io/file *file*))
|
||||
args-string
|
||||
options-summary)))
|
||||
|
||||
(defn- run-command
|
||||
"Processes a command's functionality given a cli options definition, arguments
|
||||
and primary command fn. This handles option parsing, handles any errors with
|
||||
parsing and then passes parsed input to command fn"
|
||||
[command-fn args cli-opts & parse-opts-options]
|
||||
(let [{:keys [errors] :as parsed-input}
|
||||
(apply cli/parse-opts args cli-opts parse-opts-options)]
|
||||
(if (seq errors)
|
||||
(do
|
||||
(error (str/join "\n" (into ["Options failed to parse:"] errors)))
|
||||
(System/exit 1))
|
||||
(command-fn parsed-input))))
|
||||
|
||||
;; Add libtest
|
||||
;; ===========
|
||||
(defn- add-lib-to-deps
|
||||
[lib-name lib-coordinate]
|
||||
(let [nodes (-> "deps.edn" slurp r/parse-string)]
|
||||
(spit "deps.edn"
|
||||
(str (r/assoc-in nodes
|
||||
[:aliases :lib-tests :extra-deps lib-name]
|
||||
lib-coordinate)))))
|
||||
|
||||
(defn- default-test-dir
|
||||
[lib-root-dir]
|
||||
(some #(when (fs/exists? (fs/file lib-root-dir %))
|
||||
(str (fs/file lib-root-dir %)))
|
||||
;; Most common test dir
|
||||
["test"
|
||||
;; official clojure repos like https://github.com/clojure/tools.gitlibs
|
||||
"src/test/clojure"]))
|
||||
|
||||
(defn- copy-tests
|
||||
[git-url lib-name {:keys [directory branch test-directories]}]
|
||||
(let [lib-dir (if branch
|
||||
(gl/procure git-url lib-name branch)
|
||||
(or (gl/procure git-url lib-name "master")
|
||||
(gl/procure git-url lib-name "main")
|
||||
(throw (ex-info "Unable to clone git-url" {}))))
|
||||
_ (println "Git clone is at" lib-dir)
|
||||
lib-root-dir (if directory (fs/file lib-dir directory) lib-dir)
|
||||
test-dirs (if test-directories
|
||||
(map #(when (fs/exists? (fs/file lib-root-dir %))
|
||||
(str (fs/file lib-root-dir %)))
|
||||
test-directories)
|
||||
(some-> (default-test-dir lib-root-dir) vector))]
|
||||
(when (empty? test-dirs)
|
||||
(error "No test directories found"))
|
||||
(doseq [test-dir test-dirs]
|
||||
(shell "cp -R" (str test-dir fs/file-separator) "test-resources/lib_tests/"))
|
||||
{:lib-dir lib-dir
|
||||
:test-dirs test-dirs}))
|
||||
|
||||
(defn- default-test-namespaces
|
||||
[test-dir]
|
||||
(let [relative-test-files (map #(str (fs/relativize test-dir %))
|
||||
(fs/glob test-dir "**/*.{clj,cljc}"))]
|
||||
(when (empty? relative-test-files)
|
||||
(error (str "No test files found in " test-dir)))
|
||||
(map #(-> %
|
||||
(str/replace fs/file-separator ".")
|
||||
(str/replace "_" "-")
|
||||
(str/replace-first #"\.clj(c?)$" "")
|
||||
symbol)
|
||||
relative-test-files)))
|
||||
|
||||
(defn- add-lib-to-tested-libs
|
||||
[lib-name git-url {:keys [lib-dir test-dirs]} options]
|
||||
(let [namespaces (or (get-in options [:manually-added :test-namespaces])
|
||||
(mapcat default-test-namespaces test-dirs))
|
||||
default-lib (merge
|
||||
{:git-url git-url
|
||||
:test-namespaces namespaces}
|
||||
;; Options needed to update libs
|
||||
(select-keys options [:branch :directory :test-directories]))
|
||||
lib (if (:manually-added options)
|
||||
(-> default-lib
|
||||
(merge (:manually-added options))
|
||||
(assoc :manually-added true))
|
||||
(assoc default-lib
|
||||
:git-sha (fs/file-name lib-dir)))
|
||||
nodes (-> "test-resources/lib_tests/bb-tested-libs.edn" slurp r/parse-string)]
|
||||
(spit "test-resources/lib_tests/bb-tested-libs.edn"
|
||||
(str (r/assoc-in nodes
|
||||
[(symbol lib-name)]
|
||||
lib)))
|
||||
namespaces))
|
||||
|
||||
(defn- fetch-artifact
|
||||
"Using the clojars api to get a library's git url doesn't always work. A
|
||||
possibly more reliable data source could be the scm urls in this POM feed -
|
||||
https://github.com/clojars/clojars-web/wiki/Data#useful-extracts-from-the-poms"
|
||||
[artifact]
|
||||
(let [url (str "https://clojars.org/api/artifacts/" artifact)
|
||||
_ (println "GET" url "...")
|
||||
resp @(http/get url {:headers {"Accept" "application/edn"}})]
|
||||
(if (= 200 (:status resp))
|
||||
(-> resp :body slurp edn/read-string)
|
||||
(error (str "Response failed and returned " (pr-str resp))))))
|
||||
|
||||
(defn- get-lib-map
|
||||
[deps-string options]
|
||||
;; if deps-string is artifact name
|
||||
(if (re-matches #"\S+/\S+" deps-string)
|
||||
(let [artifact-edn (fetch-artifact deps-string)]
|
||||
{:lib-name (symbol deps-string)
|
||||
:lib-coordinate {:mvn/version (:latest_version artifact-edn)}
|
||||
:git-url (or (:git-url options) (:homepage artifact-edn))})
|
||||
(let [deps-map (edn/read-string deps-string)
|
||||
_ (when (or (not (map? deps-map)) (not= 1 (count deps-map)))
|
||||
(error "Deps map must have one key"))
|
||||
lib-coordinate (-> deps-map vals first)]
|
||||
{:lib-name (ffirst deps-map)
|
||||
:lib-coordinate lib-coordinate
|
||||
:git-url (or (:git/url lib-coordinate) (:git-url options))})))
|
||||
|
||||
(defn- write-lib-to-csv
|
||||
"Updates libraries.csv with latest bb-tested-libs.edn"
|
||||
[]
|
||||
(let [libs (-> "test-resources/lib_tests/bb-tested-libs.edn" slurp edn/read-string)
|
||||
rows (sort-by first
|
||||
(map (fn [[name {:keys [git-url]}]]
|
||||
[name git-url]) libs))]
|
||||
(with-open [w (io/writer "doc/libraries.csv")]
|
||||
(csv/write-csv w (into [["maven-name" "git-url"]] rows)))))
|
||||
|
||||
(defn- add-libtest*
|
||||
[args options]
|
||||
(let [[artifact-or-deps-string] args
|
||||
{:keys [lib-name lib-coordinate git-url]}
|
||||
(get-lib-map artifact-or-deps-string options)
|
||||
_ (when (nil? git-url)
|
||||
(error "git-url is required. Please specify with --git-url"))
|
||||
_ (when-not (:manually-added options) (add-lib-to-deps lib-name lib-coordinate))
|
||||
dirs (when-not (:manually-added options) (copy-tests git-url lib-name options))
|
||||
namespaces (add-lib-to-tested-libs lib-name git-url dirs options)]
|
||||
(println "Added lib" lib-name "which tests the following namespaces:" namespaces)
|
||||
(write-lib-to-csv)
|
||||
(when (:test options)
|
||||
(apply shell "script/lib_tests/run_all_libtests" namespaces))))
|
||||
|
||||
(defn add-libtest
|
||||
[{:keys [arguments options summary]}]
|
||||
(if (or (< (count arguments) 1) (:help options))
|
||||
(print-summary "ARTIFACT-OR-DEPS-MAP " summary)
|
||||
(add-libtest* arguments options)))
|
||||
|
||||
(def cli-options
|
||||
[["-h" "--help"]
|
||||
["-t" "--test" "Run tests"]
|
||||
;; https://github.com/weavejester/environ/tree/master/environ used this option
|
||||
["-d" "--directory DIRECTORY" "Directory where library is located"]
|
||||
;; https://github.com/reifyhealth/specmonstah used this option
|
||||
["-b" "--branch BRANCH" "Default branch for git url"]
|
||||
["-g" "--git-url GITURL" "Git url for artifact. Defaults to homepage on clojars"]
|
||||
["-m" "--manually-added LIB-MAP" "Only add library to edn file with LIB-MAP merged into library entry"
|
||||
:parse-fn edn/read-string :validate-fn map?]
|
||||
;; https://github.com/jeaye/orchestra used this option
|
||||
["-T" "--test-directories TEST-DIRECTORY" "Directories where library tests are located"
|
||||
:multi true :update-fn conj]])
|
||||
|
||||
(when (= *file* (System/getProperty "babashka.file"))
|
||||
(run-command add-libtest *command-line-args* cli-options))
|
||||
|
|
@ -7,41 +7,21 @@
|
|||
(or (System/getenv "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH")
|
||||
(System/getenv "APPVEYOR_REPO_BRANCH")
|
||||
(System/getenv "CIRCLE_BRANCH")
|
||||
(System/getenv "GITHUB_REF_NAME")
|
||||
(System/getenv "CIRRUS_BRANCH")
|
||||
(-> (sh "git" "rev-parse" "--abbrev-ref" "HEAD")
|
||||
:out
|
||||
str/trim)))
|
||||
|
||||
(defn release [& args]
|
||||
(let [ght (System/getenv "GITHUB_TOKEN")
|
||||
_ (println "Github token found")
|
||||
(let [current-version (-> (slurp "resources/BABASHKA_VERSION")
|
||||
str/trim)
|
||||
ght (System/getenv "GITHUB_TOKEN")
|
||||
file (first args)
|
||||
_ (println "File" file)
|
||||
branch (current-branch)
|
||||
_ (println "On branch:" branch)
|
||||
current-version
|
||||
(-> (slurp "resources/BABASHKA_VERSION")
|
||||
str/trim)]
|
||||
branch (current-branch)]
|
||||
(if (and ght (contains? #{"master" "main"} branch))
|
||||
(do (assert file "File name must be provided")
|
||||
(println "On main branch. Publishing asset.")
|
||||
(ghr/overwrite-asset {:org "babashka"
|
||||
:repo "babashka"
|
||||
:file file
|
||||
:tag (str "v" current-version)
|
||||
:draft true
|
||||
:overwrite (str/ends-with? current-version "SNAPSHOT")
|
||||
:sha256 true})
|
||||
(ghr/overwrite-asset {:org "babashka"
|
||||
:repo "babashka-dev-builds"
|
||||
:file file
|
||||
:tag (str "v" current-version)
|
||||
;; do not set, because we are posting to another repo
|
||||
:target-commitish false
|
||||
:draft false
|
||||
:prerelease true
|
||||
:overwrite (str/ends-with? current-version "SNAPSHOT")
|
||||
:sha256 true}))
|
||||
:tag (str "v" current-version)}))
|
||||
(println "Skipping release artifact (no GITHUB_TOKEN or not on main branch)"))
|
||||
nil))
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue