Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect CLJ_JVM_OPTS env var options when downloading clojure-tools #73

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ jobs:
- v1-dependencies-{{ checksum "deps.edn" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
# - run:
# name: Install babashka
# command: |
# bash <(curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install) --dir ~
# sudo mv ~/bb /usr/local/bin/bb

- run:
name: Install babashka
name: Install babashka REVIEW
command: |
bash <(curl -s https://raw.githubusercontent.com/borkdude/babashka/master/install) --dir ~
sudo mv ~/bb /usr/local/bin/bb
curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
chmod +x ./install
sudo ./install --version 1.0.165-SNAPSHOT

- run:
name: Run babashka tests
command: |
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,29 @@ jobs:
- name: Install Clojure
uses: DeLaGuardo/[email protected]
with:
bb: '0.10.163'
# bb: '0.10.163'
cli: '1.10.3.1013'
lein: '2.9.10'

- name: Install Babashka REVIEW
if: "!startsWith (matrix.os, 'win')"
run: |
curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
chmod +x ./install
./install --version 1.0.165-SNAPSHOT

- name: Install Babashka REVIEW (win)
if: "startsWith (matrix.os, 'win')"
shell: cmd
run: |
set LOCAL_BIN_DIR=%USERPROFILE%\.local\bin

mkdir %LOCAL_BIN_DIR%

curl.exe -fsSL https://github.com/babashka/babashka-dev-builds/releases/download/v1.0.165-SNAPSHOT/babashka-1.0.165-SNAPSHOT-windows-amd64.zip -o bb-snap.zip || exit /b
unzip bb-snap.zip -d %LOCAL_BIN_DIR% || exit /b
echo %LOCAL_BIN_DIR%>> %GITHUB_PATH%

- name: Cache clojure dependencies
uses: actions/cache@v3
with:
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ Windows binary from [Github
releases](https://github.com/borkdude/deps.clj/releases) and place it on your
path.

As of 1.11.1.1165, the scripts passes the values of the `CLJ_JVM_OPTS`
or `JAVA_OPTIONS` to `java` when downloading dependencies or executing
all other commands respectively (useful for setting up network
connectivity behind firewalls).

## Why

Originally this project was created as a proof of concept to see if the
Expand Down Expand Up @@ -176,9 +181,10 @@ This project will look in `$HOME/.deps.clj/<clojure-version>/ClojureTools` for
`clojure-tools-<clojure-version>.jar`, `exec.jar` and `example-deps.edn`. If it
cannot it find those files there, it will try to download them from
[this](https://download.clojure.org/install/clojure-tools-1.10.1.697.zip)
location. You can override the location of these jars with the
`DEPS_CLJ_TOOLS_DIR` environment variable. If the download fails for some reason,
you can try to download the zip yourself and unzip it at the expected location.
location invoking `java` using the value of the `CLJ_JVM_OPTS` environment variable as options.
You can override the location of these jars with the `DEPS_CLJ_TOOLS_DIR` environment variable.
If the download fails for some reason, you can try to download the zip yourself at the location
suggested by the failure message.

If you have an already installed version of clojure using e.g. brew, you can set
`DEPS_CLJ_TOOLS_DIR` to that directory:
Expand Down Expand Up @@ -296,7 +302,7 @@ $ lein run -m borkdude.deps -Spath
To run jvm tests:

```
$ bb test
$ bb jvm-test
```

To run with babashka after making changes to `src/borkdude/deps.clj`, you should run:
Expand Down Expand Up @@ -328,7 +334,7 @@ The script also assumes that you have
Run the compile script with:

```
$ script/compile
$ bb compile
```

If everything worked out, there will be a `deps` binary in the root of the
Expand All @@ -337,7 +343,7 @@ project.
To run executable tests:

```
$ script/exe_test
$ bb exe-test
```

## License
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "b3fd0d2"}
babashka/fs {:mvn/version "0.1.0"}
babashka/fs {:mvn/version "0.1.11"}
babashka/process {:mvn/version "0.0.2"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}
Expand Down
Loading