├── VERSION ├── VERSION_TEMPLATE ├── devel.properties ├── stable.properties ├── src ├── main │ ├── resources │ │ └── clojure │ │ │ └── install │ │ │ ├── example-deps.edn │ │ │ ├── tools.edn │ │ │ ├── clj │ │ │ ├── deps.edn │ │ │ ├── install.sh │ │ │ ├── clojure.rb │ │ │ ├── clojure@version.rb │ │ │ ├── win-install.ps1 │ │ │ ├── linux-install.sh │ │ │ ├── posix-install.sh │ │ │ ├── ClojureTools.psd1 │ │ │ ├── clojure │ │ │ └── ClojureTools.psm1 │ └── clojure │ │ └── clojure │ │ └── run │ │ └── exec.clj └── test │ └── clojure │ └── clojure │ └── run │ └── test_exec.clj ├── .gitignore ├── script ├── update_version ├── print_version ├── read_versions.sh ├── publish.sh └── build.clj ├── .gitattributes ├── deps.edn ├── .github └── workflows │ ├── check.yml │ ├── promote.yml │ └── release.yml ├── README.md ├── doc └── clojure.1 ├── LICENSE ├── epl.html └── CHANGELOG.md /VERSION: -------------------------------------------------------------------------------- 1 | 1.12.4.1582 2 | -------------------------------------------------------------------------------- /VERSION_TEMPLATE: -------------------------------------------------------------------------------- 1 | 1.12.4.GENERATED_VERSION 2 | -------------------------------------------------------------------------------- /devel.properties: -------------------------------------------------------------------------------- 1 | 1.12.4.1582 fd5864f22bf2ec30311f9ce3caf3d31799e04d653b657ecdb4f0836fe972ff21 2 | -------------------------------------------------------------------------------- /stable.properties: -------------------------------------------------------------------------------- 1 | 1.12.4.1582 fd5864f22bf2ec30311f9ce3caf3d31799e04d653b657ecdb4f0836fe972ff21 2 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/example-deps.edn: -------------------------------------------------------------------------------- 1 | { 2 | :aliases { 3 | ;; Add cross-project aliases here 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dependency-reduced-pom.xml 2 | target 3 | .idea/ 4 | clojure-tools.iml 5 | .cpcache/ 6 | *.iml 7 | .nrepl-port 8 | .lsp/ 9 | .clj-kondo/ 10 | .calva/ 11 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/tools.edn: -------------------------------------------------------------------------------- 1 | {:lib io.github.clojure/tools.tools 2 | :coord {:git/tag "v0.3.4" 3 | :git/sha "0e9e6c8b409ac916ad6f2ec5bc075bbcb09545c0"}} 4 | -------------------------------------------------------------------------------- /script/update_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | v=$(script/print_version) 6 | echo "Setting version to $v" 7 | echo "$v" > VERSION 8 | git commit -m "update version to $v" VERSION 9 | -------------------------------------------------------------------------------- /script/print_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | version_template=$(cat VERSION_TEMPLATE) 6 | rev=$(git rev-list HEAD --count) 7 | v=${version_template/GENERATED_VERSION/$rev} 8 | echo "$v" 9 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | # Unix Shell Scripts 4 | *.sh text eol=lf 5 | clj text eol=lf 6 | clojure text eol=lf 7 | print_version text eol=lf 8 | update_version text eol=lf 9 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/clj: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | bin_dir=BINDIR 4 | 5 | if type -p rlwrap >/dev/null 2>&1; then 6 | exec rlwrap -m -r -q '\"' -b "(){}[],^%#@\";:'" "$bin_dir/clojure" "$@" 7 | else 8 | echo "Please install rlwrap for command editing or use \"clojure\" instead." 9 | exit 1 10 | fi 11 | -------------------------------------------------------------------------------- /script/read_versions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Grab version info 6 | read stable_version stable_sha < stable.properties 7 | read devel_version devel_sha < devel.properties 8 | echo "Promoting stable from $stable_version to $devel_version" 9 | 10 | export STABLE_VERSION=$stable_version 11 | export STABLE_SHA=$stable_sha 12 | export DEVEL_VERSION=$devel_version 13 | export DEVEL_SHA=$devel_sha -------------------------------------------------------------------------------- /src/main/resources/clojure/install/deps.edn: -------------------------------------------------------------------------------- 1 | { 2 | :paths ["src"] 3 | 4 | :deps { 5 | org.clojure/clojure {:mvn/version "${clojure.version}"} 6 | } 7 | 8 | :aliases { 9 | :deps {:replace-paths [] 10 | :replace-deps {org.clojure/tools.deps.cli {:mvn/version "0.14.121"}} 11 | :ns-default clojure.tools.deps.cli.api 12 | :ns-aliases {help clojure.tools.deps.cli.help}} 13 | :test {:extra-paths ["test"]} 14 | } 15 | 16 | :mvn/repos { 17 | "central" {:url "https://repo1.maven.org/maven2/"} 18 | "clojars" {:url "https://repo.clojars.org/"} 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | prefix="$1" 4 | 5 | # default config file 6 | cp deps.edn "$prefix" 7 | cp example-deps.edn "$prefix" 8 | cp tools.edn "$prefix" 9 | 10 | # jar needed by scripts 11 | mkdir -p "$prefix/libexec" 12 | cp ./*.jar "$prefix/libexec" 13 | 14 | # scripts 15 | ${HOMEBREW_RUBY_PATH} -pi.bak -e "gsub(/PREFIX/, '$prefix')" clojure 16 | ${HOMEBREW_RUBY_PATH} -pi.bak -e "gsub(/BINDIR/, '$prefix/bin')" clj 17 | mkdir -p "$prefix/bin" 18 | cp clojure "$prefix/bin" 19 | cp clj "$prefix/bin" 20 | 21 | # man pages 22 | mkdir -p "$prefix/share/man/man1" 23 | cp clojure.1 "$prefix/share/man/man1" 24 | cp clj.1 "$prefix/share/man/man1" 25 | -------------------------------------------------------------------------------- /deps.edn: -------------------------------------------------------------------------------- 1 | {:paths [] 2 | 3 | :deps 4 | {org.clojure/clojure {:mvn/version "1.12.4"} 5 | org.clojure/tools.deps {:mvn/version "0.27.1564"} 6 | org.slf4j/slf4j-nop {:mvn/version "1.7.36"}} 7 | 8 | :aliases 9 | { 10 | ;; clj -T:build release 11 | :build 12 | {:deps {io.github.clojure/tools.build {:git/tag "v0.10.10" :git/sha "deedd62"}} 13 | :paths ["script"] 14 | :ns-default build} 15 | 16 | ;; clj -X:test 17 | :test {:extra-paths ["src/test/clojure" "src/main/clojure"] 18 | :extra-deps {io.github.cognitect-labs/test-runner 19 | {:git/tag "v0.5.1" :git/sha "dfb30dd"}} 20 | :exec-fn cognitect.test-runner.api/test 21 | :exec-args {:dirs ["src/test/clojure"] 22 | :patterns [".*"]}} 23 | }} 24 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/clojure.rb: -------------------------------------------------------------------------------- 1 | class Clojure < Formula 2 | desc "The Clojure Programming Language" 3 | homepage "https://clojure.org" 4 | url "https://github.com/clojure/brew-install/releases/download/${stable.version}/clojure-tools-${stable.version}.tar.gz" 5 | mirror "https://download.clojure.org/install/clojure-tools-${stable.version}.tar.gz" 6 | sha256 "${stable.sha}" 7 | license "EPL-1.0" 8 | 9 | depends_on "rlwrap" 10 | 11 | uses_from_macos "ruby" => :build 12 | 13 | def install 14 | system "./install.sh", prefix 15 | end 16 | 17 | test do 18 | ENV["TERM"] = "xterm" 19 | system("#{bin}/clj -M -e nil") 20 | %w[clojure clj].each do |clj| 21 | assert_equal "2", shell_output("#{bin}/#{clj} -M -e \"(+ 1 1)\"").strip 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/clojure@version.rb: -------------------------------------------------------------------------------- 1 | class ClojureAT${version.short} < Formula 2 | desc "The Clojure Programming Language" 3 | homepage "https://clojure.org" 4 | url "https://github.com/clojure/brew-install/releases/download/${project.version}/clojure-tools-${project.version}.tar.gz" 5 | mirror "https://download.clojure.org/install/clojure-tools-${project.version}.tar.gz" 6 | sha256 "SHA" 7 | license "EPL-1.0" 8 | 9 | depends_on "rlwrap" 10 | 11 | uses_from_macos "ruby" => :build 12 | 13 | def install 14 | system "./install.sh", prefix 15 | end 16 | 17 | test do 18 | ENV["TERM"] = "xterm" 19 | system("#{bin}/clj -M -e nil") 20 | %w[clojure clj].each do |clj| 21 | assert_equal "2", shell_output("#{bin}/#{clj} -M -e \"(+ 1 1)\"").strip 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | permissions: 2 | contents: read 3 | name: Check download via setup-clojure 4 | 5 | on: 6 | workflow_dispatch: 7 | inputs: 8 | os: 9 | description: 'OS to check installation with' 10 | required: true 11 | default: 'ubuntu-latest' 12 | version: 13 | description: 'Version to check installation with' 14 | required: true 15 | default: 'latest' 16 | 17 | jobs: 18 | build: 19 | runs-on: ${{ github.event.inputs.os }} 20 | steps: 21 | - name: Set Github identity 22 | run: | 23 | git config --global user.name clojure-build 24 | git config --global user.email "clojure-build@users.noreply.github.com" 25 | - name: Set up Java 26 | uses: actions/setup-java@v3 27 | with: 28 | java-version: 8 29 | distribution: 'temurin' 30 | - name: Set up Clojure 31 | uses: DeLaGuardo/setup-clojure@13.2 32 | with: 33 | cli: ${{ github.event.inputs.version }} 34 | - name: Check downloaded version 35 | run: clojure --version 36 | - name: Run CLI 37 | run: clojure -M -e nil 38 | 39 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/win-install.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | 3 | $ErrorActionPreference = 'Stop' 4 | $ProgressPreference = 'SilentlyContinue' 5 | 6 | $Version = '${project.version}' 7 | $ClojureToolsUrl = "https://github.com/clojure/brew-install/releases/download/$Version/clojure-tools.zip" 8 | 9 | Write-Host 'Downloading Clojure tools' -ForegroundColor Gray 10 | [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls12' 11 | Invoke-WebRequest -Uri $ClojureToolsUrl -OutFile clojure-tools.zip 12 | 13 | Write-Warning 'Clojure will install as a module in your PowerShell module path.' 14 | Write-Host '' 15 | Write-Host 'Possible install locations:' 16 | 17 | $InstallLocations = $env:PSModulePath -split [IO.Path]::PathSeparator 18 | for ($Index = 0; $Index -lt $InstallLocations.Length; $Index++) { 19 | Write-Host (' {0}) {1}' -f ($Index + 1), $InstallLocations[$Index]) 20 | } 21 | $Choice = Read-Host 'Enter number of preferred install location' 22 | $DestinationPath = $InstallLocations[$Choice - 1] 23 | 24 | Write-Host '' 25 | 26 | $ExistingLocation = "$DestinationPath\ClojureTools" 27 | if (Test-Path $ExistingLocation) { 28 | Write-Host 'Cleaning up existing install' -ForegroundColor Gray 29 | Remove-Item -Path $ExistingLocation -Recurse 30 | } 31 | 32 | Write-Host 'Installing PowerShell module' 33 | Expand-Archive clojure-tools.zip -DestinationPath $DestinationPath 34 | 35 | Write-Host 'Removing download' 36 | Remove-Item clojure-tools.zip 37 | 38 | Write-Host 'Clojure now installed. Use "clj -h" for help.' -ForegroundColor Green 39 | -------------------------------------------------------------------------------- /.github/workflows/promote.yml: -------------------------------------------------------------------------------- 1 | name: Promote dev to stable 2 | 3 | on: [workflow_dispatch] 4 | 5 | permissions: # Exchange the OIDC token (JWT) for a cloud access token 6 | id-token: write # This is required for requesting the JWT 7 | contents: write # This is required for actions/checkout 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: aws-actions/configure-aws-credentials@v2 14 | with: 15 | role-to-assume: arn:aws:iam::173728190221:role/github-CLI-upload 16 | aws-region: us-east-2 17 | - name: Check out 18 | uses: actions/checkout@v3 19 | - name: Set Github identity 20 | run: | 21 | git config --global user.name clojure-build 22 | git config --global user.email "clojure-build@users.noreply.github.com" 23 | - name: Read versions and save for later use 24 | run: | 25 | source script/read_versions.sh 26 | echo "DEVEL_VERSION=$DEVEL_VERSION" >> "$GITHUB_ENV" 27 | echo "DEVEL_SHA=$DEVEL_SHA" >> "$GITHUB_ENV" 28 | echo "STABLE_VERSION=$STABLE_VERSION" >> "$GITHUB_ENV" 29 | echo "STABLE_SHA=$STABLE_SHA" >> "$GITHUB_ENV" 30 | - name: Read versions 31 | run: | 32 | cp devel.properties stable.properties 33 | git add stable.properties 34 | git commit -m "update stable to $DEVEL_VERSION" 35 | git push 36 | - name: Publish new stable version 37 | run: aws s3 cp --only-show-errors "stable.properties" "$S3_BUCKET/install/stable.properties" 38 | env: 39 | S3_BUCKET: ${{ secrets.S3_BUCKET }} 40 | - name: Mark github release as published and latest 41 | run: gh release edit "$DEVEL_VERSION" --prerelease=false --latest 42 | env: 43 | GH_TOKEN: ${{secrets.GH_TOKEN}} 44 | - name: Change brew recipe in tap 45 | run: | 46 | echo "old $STABLE_VERSION" 47 | gh workflow run -R clojure/homebrew-tools promote -r master -f old_version="$STABLE_VERSION" -f old_sha="$STABLE_SHA" -f new_version="$DEVEL_VERSION" -f new_sha="$DEVEL_SHA" 48 | env: 49 | GH_TOKEN: ${{secrets.GH_TOKEN}} 50 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/linux-install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -euo pipefail 4 | 5 | # Start 6 | do_usage() { 7 | echo "Installs the Clojure command line tools." 8 | echo -e 9 | echo "Usage:" 10 | echo "linux-install.sh [-p|--prefix
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE 33 | PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR 34 | DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS 35 | AGREEMENT.
36 | 37 |1. DEFINITIONS
38 | 39 |"Contribution" means:
40 | 41 |a) in the case of the initial Contributor, the initial 42 | code and documentation distributed under this Agreement, and
43 |b) in the case of each subsequent Contributor:
44 |i) changes to the Program, and
45 |ii) additions to the Program;
46 |where such changes and/or additions to the Program 47 | originate from and are distributed by that particular Contributor. A 48 | Contribution 'originates' from a Contributor if it was added to the 49 | Program by such Contributor itself or anyone acting on such 50 | Contributor's behalf. Contributions do not include additions to the 51 | Program which: (i) are separate modules of software distributed in 52 | conjunction with the Program under their own license agreement, and (ii) 53 | are not derivative works of the Program.
54 | 55 |"Contributor" means any person or entity that distributes 56 | the Program.
57 | 58 |"Licensed Patents" mean patent claims licensable by a 59 | Contributor which are necessarily infringed by the use or sale of its 60 | Contribution alone or when combined with the Program.
61 | 62 |"Program" means the Contributions distributed in accordance 63 | with this Agreement.
64 | 65 |"Recipient" means anyone who receives the Program under 66 | this Agreement, including all Contributors.
67 | 68 |2. GRANT OF RIGHTS
69 | 70 |a) Subject to the terms of this Agreement, each 71 | Contributor hereby grants Recipient a non-exclusive, worldwide, 72 | royalty-free copyright license to reproduce, prepare derivative works 73 | of, publicly display, publicly perform, distribute and sublicense the 74 | Contribution of such Contributor, if any, and such derivative works, in 75 | source code and object code form.
76 | 77 |b) Subject to the terms of this Agreement, each 78 | Contributor hereby grants Recipient a non-exclusive, worldwide, 79 | royalty-free patent license under Licensed Patents to make, use, sell, 80 | offer to sell, import and otherwise transfer the Contribution of such 81 | Contributor, if any, in source code and object code form. This patent 82 | license shall apply to the combination of the Contribution and the 83 | Program if, at the time the Contribution is added by the Contributor, 84 | such addition of the Contribution causes such combination to be covered 85 | by the Licensed Patents. The patent license shall not apply to any other 86 | combinations which include the Contribution. No hardware per se is 87 | licensed hereunder.
88 | 89 |c) Recipient understands that although each Contributor 90 | grants the licenses to its Contributions set forth herein, no assurances 91 | are provided by any Contributor that the Program does not infringe the 92 | patent or other intellectual property rights of any other entity. Each 93 | Contributor disclaims any liability to Recipient for claims brought by 94 | any other entity based on infringement of intellectual property rights 95 | or otherwise. As a condition to exercising the rights and licenses 96 | granted hereunder, each Recipient hereby assumes sole responsibility to 97 | secure any other intellectual property rights needed, if any. For 98 | example, if a third party patent license is required to allow Recipient 99 | to distribute the Program, it is Recipient's responsibility to acquire 100 | that license before distributing the Program.
101 | 102 |d) Each Contributor represents that to its knowledge it 103 | has sufficient copyright rights in its Contribution, if any, to grant 104 | the copyright license set forth in this Agreement.
105 | 106 |3. REQUIREMENTS
107 | 108 |A Contributor may choose to distribute the Program in object code 109 | form under its own license agreement, provided that:
110 | 111 |a) it complies with the terms and conditions of this 112 | Agreement; and
113 | 114 |b) its license agreement:
115 | 116 |i) effectively disclaims on behalf of all Contributors 117 | all warranties and conditions, express and implied, including warranties 118 | or conditions of title and non-infringement, and implied warranties or 119 | conditions of merchantability and fitness for a particular purpose;
120 | 121 |ii) effectively excludes on behalf of all Contributors 122 | all liability for damages, including direct, indirect, special, 123 | incidental and consequential damages, such as lost profits;
124 | 125 |iii) states that any provisions which differ from this 126 | Agreement are offered by that Contributor alone and not by any other 127 | party; and
128 | 129 |iv) states that source code for the Program is available 130 | from such Contributor, and informs licensees how to obtain it in a 131 | reasonable manner on or through a medium customarily used for software 132 | exchange.
133 | 134 |When the Program is made available in source code form:
135 | 136 |a) it must be made available under this Agreement; and
137 | 138 |b) a copy of this Agreement must be included with each 139 | copy of the Program.
140 | 141 |Contributors may not remove or alter any copyright notices contained 142 | within the Program.
143 | 144 |Each Contributor must identify itself as the originator of its 145 | Contribution, if any, in a manner that reasonably allows subsequent 146 | Recipients to identify the originator of the Contribution.
147 | 148 |4. COMMERCIAL DISTRIBUTION
149 | 150 |Commercial distributors of software may accept certain 151 | responsibilities with respect to end users, business partners and the 152 | like. While this license is intended to facilitate the commercial use of 153 | the Program, the Contributor who includes the Program in a commercial 154 | product offering should do so in a manner which does not create 155 | potential liability for other Contributors. Therefore, if a Contributor 156 | includes the Program in a commercial product offering, such Contributor 157 | ("Commercial Contributor") hereby agrees to defend and 158 | indemnify every other Contributor ("Indemnified Contributor") 159 | against any losses, damages and costs (collectively "Losses") 160 | arising from claims, lawsuits and other legal actions brought by a third 161 | party against the Indemnified Contributor to the extent caused by the 162 | acts or omissions of such Commercial Contributor in connection with its 163 | distribution of the Program in a commercial product offering. The 164 | obligations in this section do not apply to any claims or Losses 165 | relating to any actual or alleged intellectual property infringement. In 166 | order to qualify, an Indemnified Contributor must: a) promptly notify 167 | the Commercial Contributor in writing of such claim, and b) allow the 168 | Commercial Contributor to control, and cooperate with the Commercial 169 | Contributor in, the defense and any related settlement negotiations. The 170 | Indemnified Contributor may participate in any such claim at its own 171 | expense.
172 | 173 |For example, a Contributor might include the Program in a commercial 174 | product offering, Product X. That Contributor is then a Commercial 175 | Contributor. If that Commercial Contributor then makes performance 176 | claims, or offers warranties related to Product X, those performance 177 | claims and warranties are such Commercial Contributor's responsibility 178 | alone. Under this section, the Commercial Contributor would have to 179 | defend claims against the other Contributors related to those 180 | performance claims and warranties, and if a court requires any other 181 | Contributor to pay any damages as a result, the Commercial Contributor 182 | must pay those damages.
183 | 184 |5. NO WARRANTY
185 | 186 |EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS 187 | PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 188 | OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, 189 | ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY 190 | OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely 191 | responsible for determining the appropriateness of using and 192 | distributing the Program and assumes all risks associated with its 193 | exercise of rights under this Agreement , including but not limited to 194 | the risks and costs of program errors, compliance with applicable laws, 195 | damage to or loss of data, programs or equipment, and unavailability or 196 | interruption of operations.
197 | 198 |6. DISCLAIMER OF LIABILITY
199 | 200 |EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT 201 | NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, 202 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING 203 | WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF 204 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 205 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR 206 | DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED 207 | HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
208 | 209 |7. GENERAL
210 | 211 |If any provision of this Agreement is invalid or unenforceable under 212 | applicable law, it shall not affect the validity or enforceability of 213 | the remainder of the terms of this Agreement, and without further action 214 | by the parties hereto, such provision shall be reformed to the minimum 215 | extent necessary to make such provision valid and enforceable.
216 | 217 |If Recipient institutes patent litigation against any entity 218 | (including a cross-claim or counterclaim in a lawsuit) alleging that the 219 | Program itself (excluding combinations of the Program with other 220 | software or hardware) infringes such Recipient's patent(s), then such 221 | Recipient's rights granted under Section 2(b) shall terminate as of the 222 | date such litigation is filed.
223 | 224 |All Recipient's rights under this Agreement shall terminate if it 225 | fails to comply with any of the material terms or conditions of this 226 | Agreement and does not cure such failure in a reasonable period of time 227 | after becoming aware of such noncompliance. If all Recipient's rights 228 | under this Agreement terminate, Recipient agrees to cease use and 229 | distribution of the Program as soon as reasonably practicable. However, 230 | Recipient's obligations under this Agreement and any licenses granted by 231 | Recipient relating to the Program shall continue and survive.
232 | 233 |Everyone is permitted to copy and distribute copies of this 234 | Agreement, but in order to avoid inconsistency the Agreement is 235 | copyrighted and may only be modified in the following manner. The 236 | Agreement Steward reserves the right to publish new versions (including 237 | revisions) of this Agreement from time to time. No one other than the 238 | Agreement Steward has the right to modify this Agreement. The Eclipse 239 | Foundation is the initial Agreement Steward. The Eclipse Foundation may 240 | assign the responsibility to serve as the Agreement Steward to a 241 | suitable separate entity. Each new version of the Agreement will be 242 | given a distinguishing version number. The Program (including 243 | Contributions) may always be distributed subject to the version of the 244 | Agreement under which it was received. In addition, after a new version 245 | of the Agreement is published, Contributor may elect to distribute the 246 | Program (including its Contributions) under the new version. Except as 247 | expressly stated in Sections 2(a) and 2(b) above, Recipient receives no 248 | rights or licenses to the intellectual property of any Contributor under 249 | this Agreement, whether expressly, by implication, estoppel or 250 | otherwise. All rights in the Program not expressly granted under this 251 | Agreement are reserved.
252 | 253 |This Agreement is governed by the laws of the State of New York and 254 | the intellectual property laws of the United States of America. No party 255 | to this Agreement will bring a legal action under this Agreement more 256 | than one year after the cause of action arose. Each party waives its 257 | rights to a jury trial in any resulting litigation.
258 | 259 | 260 | 261 | 262 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/clojure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | install_dir=PREFIX 6 | version=${project.version} 7 | 8 | function join { local d=$1; shift; echo -n "$1"; shift; printf "%s" "${@/#/$d}"; } 9 | 10 | # Extract opts 11 | print_classpath=false 12 | describe=false 13 | verbose=false 14 | trace=false 15 | force=false 16 | repro=false 17 | tree=false 18 | pom=false 19 | help=false 20 | prep=false 21 | jvm_opts=() 22 | repl_aliases=() 23 | mode="repl" 24 | while [ $# -gt 0 ] 25 | do 26 | case "$1" in 27 | -version) 28 | >&2 echo "Clojure CLI version $version" 29 | exit 0 30 | ;; 31 | --version) 32 | echo "Clojure CLI version $version" 33 | exit 0 34 | ;; 35 | -J*) 36 | jvm_opts+=("${1:2}") 37 | shift 38 | ;; 39 | -R*) 40 | >&2 echo "-R is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool" 41 | exit 1 42 | ;; 43 | -C*) 44 | >&2 echo "-C is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool" 45 | exit 1 46 | ;; 47 | -O*) 48 | >&2 echo "-O is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool" 49 | exit 1 50 | ;; 51 | -A) 52 | >&2 echo "-A requires an alias" 53 | exit 1 54 | ;; 55 | -A*) 56 | repl_aliases+=("${1:2}") 57 | shift 58 | ;; 59 | -M) 60 | mode="main" 61 | shift 62 | break 63 | ;; 64 | -M*) 65 | mode="main" 66 | main_aliases="${1:2}" 67 | shift 68 | break 69 | ;; 70 | -X) 71 | mode="exec" 72 | shift 73 | break 74 | ;; 75 | -X*) 76 | mode="exec" 77 | exec_aliases="${1:2}" 78 | shift 79 | break 80 | ;; 81 | -T:*) 82 | mode="tool" 83 | tool_aliases="${1:2}" 84 | shift 85 | break 86 | ;; 87 | -T*) 88 | mode="tool" 89 | tool_name="${1:2}" 90 | shift 91 | break 92 | ;; 93 | -T) 94 | mode="tool" 95 | shift 96 | break 97 | ;; 98 | -P) 99 | prep=true 100 | shift 101 | ;; 102 | -Sdeps) 103 | shift 104 | deps_data="${1}" 105 | shift 106 | ;; 107 | -Scp) 108 | shift 109 | force_cp="${1}" 110 | shift 111 | ;; 112 | -Spath) 113 | print_classpath=true 114 | shift 115 | ;; 116 | -Sverbose) 117 | verbose=true 118 | shift 119 | ;; 120 | -Sthreads) 121 | shift 122 | threads="${1}" 123 | shift 124 | ;; 125 | -Strace) 126 | trace=true 127 | shift 128 | ;; 129 | -Sdescribe) 130 | describe=true 131 | shift 132 | ;; 133 | -Sforce) 134 | force=true 135 | shift 136 | ;; 137 | -Srepro) 138 | repro=true 139 | shift 140 | ;; 141 | -Stree) 142 | tree=true 143 | shift 144 | ;; 145 | -Spom) 146 | pom=true 147 | shift 148 | ;; 149 | -Sresolve-tags) 150 | >&2 echo "Option changed, use: clj -X:deps git-resolve-tags" 151 | exit 1 152 | ;; 153 | -S*) 154 | >&2 echo "Invalid option: $1" 155 | exit 1 156 | ;; 157 | -h|--help|"-?") 158 | if [[ -n "$main_aliases" ]] || [[ ${#repl_aliases[@]} -gt 0 ]]; then 159 | break 160 | else 161 | help=true 162 | shift 163 | fi 164 | ;; 165 | --) 166 | shift 167 | break 168 | ;; 169 | *) 170 | break 171 | ;; 172 | esac 173 | done 174 | 175 | # Find java executable 176 | set +e 177 | JAVA_CMD=${JAVA_CMD:-$(type -p java)} 178 | set -e 179 | if [[ -z "$JAVA_CMD" ]]; then 180 | if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then 181 | JAVA_CMD="$JAVA_HOME/bin/java" 182 | else 183 | >&2 echo "Couldn't find 'java'. Please set JAVA_HOME." 184 | exit 1 185 | fi 186 | fi 187 | 188 | if "$help"; then 189 | cat <<-END 190 | Version: $version 191 | 192 | You use the Clojure tools ('clj' or 'clojure') to run Clojure programs 193 | on the JVM, e.g. to start a REPL or invoke a specific function with data. 194 | The Clojure tools will configure the JVM process by defining a classpath 195 | (of desired libraries), an execution environment (JVM options) and 196 | specifying a main class and args. 197 | 198 | Using a deps.edn file (or files), you tell Clojure where your source code 199 | resides and what libraries you need. Clojure will then calculate the full 200 | set of required libraries and a classpath, caching expensive parts of this 201 | process for better performance. 202 | 203 | The internal steps of the Clojure tools, as well as the Clojure functions 204 | you intend to run, are parameterized by data structures, often maps. Shell 205 | command lines are not optimized for passing nested data, so instead you 206 | will put the data structures in your deps.edn file and refer to them on the 207 | command line via 'aliases' - keywords that name data structures. 208 | 209 | 'clj' and 'clojure' differ in that 'clj' has extra support for use as a REPL 210 | in a terminal, and should be preferred unless you don't want that support, 211 | then use 'clojure'. 212 | 213 | Usage: 214 | Start a REPL clj [clj-opt*] [-Aaliases] 215 | Exec fn(s) clojure [clj-opt*] -X[aliases] a/fn? [kpath v]* kv-map? 216 | Run tool clojure [clj-opt*] -T[name|aliases] a/fn [kpath v] kv-map? 217 | Run main clojure [clj-opt*] -M[aliases] [init-opt*] [main-opt] [arg*] 218 | Prepare clojure [clj-opt*] -P [other exec opts] 219 | 220 | exec-opts: 221 | -Aaliases Use concatenated aliases to modify classpath 222 | -X[aliases] Use concatenated aliases to modify classpath or supply exec fn/args 223 | -T[toolname|aliases] Invoke tool by name or via aliases ala -X 224 | -M[aliases] Use concatenated aliases to modify classpath or supply main opts 225 | -P Prepare deps - download libs, cache classpath, but don't exec 226 | 227 | clj-opts: 228 | -Jopt Pass opt through in java_opts, ex: -J-Xmx512m 229 | -Sdeps EDN Deps data or file to use as the last deps file to be merged 230 | -Spath Compute classpath and echo to stdout only 231 | -Stree Print dependency tree 232 | -Scp CP Do NOT compute or cache classpath, use this one instead 233 | -Srepro Ignore the ~/.clojure/deps.edn config file 234 | -Sforce Force recomputation of the classpath (don't use the cache) 235 | -Sverbose Print important path info to console 236 | -Sthreads Set specific number of download threads 237 | -Strace Write a trace.edn file that traces deps expansion 238 | -- Stop parsing dep options and pass remaining arguments to clojure.main 239 | --version Print the version to stdout and exit 240 | -version Print the version to stderr and exit 241 | 242 | init-opt: 243 | -i, --init path Load a file or resource 244 | -e, --eval string Eval exprs in string; print non-nil values 245 | --report target Report uncaught exception to "file" (default), "stderr", or "none" 246 | 247 | main-opt: 248 | -m, --main ns-name Call the -main function from namespace w/args 249 | -r, --repl Run a repl 250 | path Run a script from a file or resource 251 | - Run a script from standard input 252 | -h, -?, --help Print this help message and exit 253 | 254 | Programs provided by :deps alias: 255 | -X:deps aliases List available aliases and their source 256 | -X:deps list List full transitive deps set and licenses 257 | -X:deps tree Print deps tree 258 | -X:deps basis Print runtime basis 259 | -X:deps find-versions Find available versions of a library 260 | -X:deps prep Prepare all unprepped libs in the dep tree 261 | -X:deps mvn-pom Generate (or update) pom.xml with deps and paths 262 | -X:deps mvn-install Install a maven jar to the local repository cache 263 | -X:deps git-resolve-tags Resolve git coord tags to shas and update deps.edn 264 | 265 | For more info, see: 266 | https://clojure.org/guides/deps_and_cli 267 | https://clojure.org/reference/repl_and_main 268 | END 269 | exit 0 270 | fi 271 | 272 | # Set tools classpath used for the various programs before the user's program 273 | tools_cp="$install_dir/libexec/clojure-tools-$version.jar" 274 | 275 | # Determine user config directory 276 | if [[ -n "$CLJ_CONFIG" ]]; then 277 | config_dir="$CLJ_CONFIG" 278 | elif [[ -n "$XDG_CONFIG_HOME" ]]; then 279 | config_dir="$XDG_CONFIG_HOME/clojure" 280 | else 281 | config_dir="$HOME/.clojure" 282 | fi 283 | 284 | # If user config directory does not exist, create it 285 | if [[ ! -d "$config_dir" ]]; then 286 | mkdir -p "$config_dir" 287 | fi 288 | if [[ ! -e "$config_dir/deps.edn" ]]; then 289 | cp "$install_dir/example-deps.edn" "$config_dir/deps.edn" 290 | fi 291 | if [ "$install_dir/tools.edn" -nt "$config_dir/tools/tools.edn" ]; then 292 | mkdir -p "$config_dir/tools" 293 | cp "$install_dir/tools.edn" "$config_dir/tools/tools.edn" 294 | fi 295 | 296 | # Determine user cache directory 297 | if [[ -n "$CLJ_CACHE" ]]; then 298 | user_cache_dir="$CLJ_CACHE" 299 | elif [[ -n "$XDG_CACHE_HOME" ]]; then 300 | user_cache_dir="$XDG_CACHE_HOME/clojure" 301 | else 302 | user_cache_dir="$config_dir/.cpcache" 303 | fi 304 | 305 | # Chain deps.edn in config paths. repro=skip config dir 306 | config_project="deps.edn" 307 | if "$repro"; then 308 | config_paths=("$install_dir/deps.edn" "deps.edn") 309 | else 310 | config_user="$config_dir/deps.edn" 311 | config_paths=("$install_dir/deps.edn" "$config_dir/deps.edn" "deps.edn") 312 | fi 313 | 314 | # Determine whether to use user or project cache 315 | if [[ -f deps.edn ]]; then 316 | if [ -w "." ]; then 317 | cache_dir=.cpcache 318 | else # can't write to .cpcache 319 | cache_dir_key="$PWD" 320 | cache_dir="$user_cache_dir" 321 | fi 322 | else 323 | cache_dir="$user_cache_dir" 324 | fi 325 | 326 | # Construct location of cached classpath file 327 | cache_version=6 328 | val="$cache_version|$cache_dir_key|$(join '' ${repl_aliases[@]})|$exec_aliases|$main_aliases|$deps_data|$tool_name|$tool_aliases" 329 | for config_path in "${config_paths[@]}"; do 330 | if [[ -f "$config_path" ]]; then 331 | val="$val|$config_path" 332 | else 333 | val="$val|NIL" 334 | fi 335 | done 336 | ck=$(echo "$val" | cksum | cut -d" " -f 1) 337 | 338 | cp_file="$cache_dir/$ck.cp" 339 | jvm_file="$cache_dir/$ck.jvm" 340 | main_file="$cache_dir/$ck.main" 341 | basis_file="$cache_dir/$ck.basis" 342 | manifest_file="$cache_dir/$ck.manifest" 343 | 344 | # Print paths in verbose mode 345 | if "$verbose"; then 346 | echo "version = $version" 347 | echo "install_dir = $install_dir" 348 | echo "config_dir = $config_dir" 349 | echo "config_paths =" "${config_paths[@]}" 350 | echo "root_deps = $tools_cp" 351 | echo "user_deps = $config_user" 352 | echo "project_deps = $config_project" 353 | echo "cache_dir = $cache_dir" 354 | echo "cp_file = $cp_file" 355 | echo 356 | fi 357 | 358 | # Check for stale classpath file 359 | stale=false 360 | if "$force" || "$trace" || "$tree" || "$prep" || [ ! -f "$cp_file" ]; then 361 | stale=true 362 | elif [[ -n "$tool_name" ]] && [ "$config_dir/tools/$tool_name.edn" -nt "$cp_file" ]; then 363 | stale=true 364 | else 365 | # Are deps.edn files stale? 366 | for config_path in "${config_paths[@]}"; do 367 | if [ "$config_path" -nt "$cp_file" ]; then 368 | stale=true 369 | break 370 | fi 371 | done 372 | 373 | # If -Sdeps is a file, and it exists, is it stale? 374 | if [[ "$deps_data" != \{* ]] && [[ -e "$deps_data" ]] && [ "$deps_data" -nt "$cp_file" ]; then 375 | stale=true 376 | fi 377 | 378 | # Are .jar files in classpath missing? 379 | IFS=':' read -ra cp_entries <<<"$(cat $cp_file)" 380 | for cp_entry in "${cp_entries[@]}"; do 381 | if [[ "$cp_entry" == *.jar && ! -f "$cp_entry" ]]; then 382 | stale=true 383 | break 384 | fi 385 | done 386 | 387 | # Are manifest files in local/git deps stale? 388 | if [[ "$stale" = false && -f "$manifest_file" ]]; then 389 | set +e 390 | IFS=$'\n' read -ra manifest_files -d '' <"$manifest_file" 391 | set -e 392 | for manifest in "${manifest_files[@]}"; do 393 | if [[ ! -f "$manifest" || "$manifest" -nt "$cp_file" ]]; then 394 | stale=true 395 | break 396 | fi 397 | done 398 | fi 399 | fi 400 | 401 | # Make tools args if needed 402 | if "$stale" || "$pom"; then 403 | tools_args=() 404 | if [[ -n "$deps_data" ]]; then 405 | tools_args+=("--config-data" "$deps_data") 406 | fi 407 | if [[ -n "$main_aliases" ]]; then 408 | tools_args+=("-M$main_aliases") 409 | fi 410 | if [[ ${#repl_aliases[@]} -gt 0 ]]; then 411 | tools_args+=("-A$(join '' ${repl_aliases[@]})") 412 | fi 413 | if [[ -n "$exec_aliases" ]]; then 414 | tools_args+=("-X$exec_aliases") 415 | fi 416 | if [ "$mode" == "tool" ]; then 417 | tools_args+=("--tool-mode") 418 | fi 419 | if [[ -n "$tool_name" ]]; then 420 | tools_args+=("--tool-name" "$tool_name") 421 | fi 422 | if [[ -n "$tool_aliases" ]]; then 423 | tools_args+=("-T$tool_aliases") 424 | fi 425 | if [[ -n "$force_cp" ]]; then 426 | tools_args+=("--skip-cp") 427 | fi 428 | if [[ -n "$threads" ]]; then 429 | tools_args+=("--threads" "$threads") 430 | fi 431 | if "$trace"; then 432 | tools_args+=("--trace") 433 | fi 434 | if "$tree"; then 435 | tools_args+=("--tree") 436 | fi 437 | fi 438 | 439 | # If stale, run make-classpath to refresh cached classpath 440 | if [[ "$stale" = true && "$describe" = false ]]; then 441 | if "$verbose"; then 442 | >&2 echo "Refreshing classpath" 443 | fi 444 | "$JAVA_CMD" -XX:-OmitStackTraceInFastThrow $CLJ_JVM_OPTS -classpath "$tools_cp" clojure.main -m clojure.tools.deps.script.make-classpath2 --config-user "$config_user" --config-project "$config_project" --basis-file "$basis_file" --cp-file "$cp_file" --jvm-file "$jvm_file" --main-file "$main_file" --manifest-file "$manifest_file" "${tools_args[@]}" 445 | fi 446 | 447 | if "$describe"; then 448 | cp= 449 | elif [[ -n "$force_cp" ]]; then 450 | cp="$force_cp" 451 | else 452 | cp=$(cat "$cp_file") 453 | fi 454 | 455 | if "$prep"; then 456 | exit 0 457 | elif "$pom"; then 458 | exec "$JAVA_CMD" -XX:-OmitStackTraceInFastThrow $CLJ_JVM_OPTS -classpath "$tools_cp" clojure.main -m clojure.tools.deps.script.generate-manifest2 --config-user "$config_user" --config-project "$config_project" --gen=pom "${tools_args[@]}" 459 | elif "$print_classpath"; then 460 | echo "$cp" 461 | elif "$describe"; then 462 | for config_path in "${config_paths[@]}"; do 463 | if [[ -f "$config_path" ]]; then 464 | path_vector="$path_vector\"$config_path\" " 465 | fi 466 | done 467 | cat <<-END 468 | {:version "$version" 469 | :config-files [$path_vector] 470 | :config-user "$config_user" 471 | :config-project "$config_project" 472 | :install-dir "$install_dir" 473 | :config-dir "$config_dir" 474 | :cache-dir "$cache_dir" 475 | :force $force 476 | :repro $repro 477 | :main-aliases "$main_aliases" 478 | :repl-aliases "${repl_aliases[@]}"} 479 | END 480 | elif "$tree"; then 481 | exit 0 482 | elif "$trace"; then 483 | >&2 echo "Wrote trace.edn" 484 | else 485 | set -f 486 | if [[ -f "$jvm_file" ]]; then 487 | set +e 488 | IFS=$'\n' read -ra jvm_cache_opts -d '' <"$jvm_file" 489 | set -e 490 | fi 491 | 492 | if [ "$mode" == "tool" ] || [ "$mode" == "exec" ]; then 493 | exec "$JAVA_CMD" -XX:-OmitStackTraceInFastThrow $JAVA_OPTS "${jvm_cache_opts[@]}" "${jvm_opts[@]}" "-Dclojure.basis=$basis_file" -classpath "$cp:$install_dir/libexec/exec.jar" clojure.main -m clojure.run.exec "$@" 494 | else 495 | if [[ -f "$main_file" ]]; then 496 | set +e 497 | IFS=$'\n' read -ra main_cache_opts -d '' <"$main_file" 498 | set -e 499 | fi 500 | if [ "$#" -gt 0 ] && [ "$mode" == "repl" ]; then 501 | >&2 echo "WARNING: Implicit use of clojure.main with options is deprecated, use -M $@" 502 | fi 503 | exec "$JAVA_CMD" -XX:-OmitStackTraceInFastThrow $JAVA_OPTS "${jvm_cache_opts[@]}" "${jvm_opts[@]}" "-Dclojure.basis=$basis_file" -classpath "$cp" clojure.main "${main_cache_opts[@]}" "$@" 504 | fi 505 | fi 506 | -------------------------------------------------------------------------------- /src/main/resources/clojure/install/ClojureTools.psm1: -------------------------------------------------------------------------------- 1 | function Get-StringHash($str) { 2 | $md5 = new-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider 3 | $utf8 = new-object -TypeName System.Text.UTF8Encoding 4 | return [System.BitConverter]::ToString($md5.ComputeHash($utf8.GetBytes($str))) 5 | } 6 | 7 | function Test-NewerFile($file1, $file2) { 8 | if (!(Test-Path $file1)) { 9 | return $FALSE 10 | } 11 | if (!(Test-Path $file2)) { 12 | return $TRUE 13 | } 14 | $mod1 = (Get-ChildItem $file1).LastWriteTimeUtc 15 | $mod2 = (Get-ChildItem $file2).LastWriteTimeUtc 16 | return $mod1 -gt $mod2 17 | } 18 | 19 | function Invoke-Clojure { 20 | $ErrorActionPreference = 'Stop' 21 | 22 | # Set dir containing the installed files 23 | $InstallDir = $PSScriptRoot 24 | $Version = '${project.version}' 25 | $ToolsCp = "$InstallDir\clojure-tools-$Version.jar" 26 | 27 | # Extract opts 28 | $PrintClassPath = $FALSE 29 | $Describe = $FALSE 30 | $Verbose = $FALSE 31 | $Trace = $FALSE 32 | $Force = $FALSE 33 | $Repro = $FALSE 34 | $Tree = $FALSE 35 | $Pom = $FALSE 36 | $Prep = $FALSE 37 | $Help = $FALSE 38 | $JvmOpts = @() 39 | $ReplAliases = @() 40 | $ClojureArgs = @() 41 | $Mode = "repl" 42 | 43 | $params = $args 44 | while ($params.Count -gt 0) { 45 | $arg, $params = $params 46 | if ($arg -ceq '-version') { 47 | Write-Error "Clojure CLI version $Version" 48 | return 49 | } elseif ($arg -ceq '--version') { 50 | Write-Output "Clojure CLI version $Version" 51 | return 52 | } elseif ($arg.StartsWith('-J')) { 53 | $JvmOpts += $arg.Substring(2) 54 | } elseif ($arg.StartsWith('-R')) { 55 | Write-Error "-R is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool" 56 | return 57 | } elseif ($arg.StartsWith('-C')) { 58 | Write-Error "-C is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool" 59 | return 60 | } elseif ($arg.StartsWith('-O')) { 61 | Write-Error "-O is no longer supported, use -A with repl, -M for main, -X for exec, -T for tool" 62 | return 63 | } elseif ($arg -ceq '-M') { 64 | $Mode = "main" 65 | $ClojureArgs += $params 66 | break 67 | } elseif ($arg -ceq '-M:') { 68 | $Mode = "main" 69 | $kw, $params = $params 70 | $MainAliases = ":$kw" 71 | $ClojureArgs += $params 72 | break 73 | } elseif ($arg -ceq '-T:') { 74 | $Mode = "tool" 75 | $kw, $params = $params 76 | $ToolAliases = ":$kw" 77 | $ClojureArgs += $params 78 | break 79 | } elseif ($arg -ceq '-T') { 80 | $Mode = "tool" 81 | $ClojureArgs += $params 82 | break 83 | } elseif ($arg.StartsWith('-T')) { 84 | $Mode = "tool" 85 | $ToolName = $arg.Substring(2) 86 | $ClojureArgs += $params 87 | break 88 | } elseif ($arg.StartsWith('-A')) { 89 | $aliases, $params = $params 90 | if ($aliases) { 91 | $ReplAliases += ":$aliases" 92 | } 93 | } elseif ($arg -ceq '-X') { 94 | $Mode = "exec" 95 | $ClojureArgs += $params 96 | break 97 | } elseif ($arg -ceq '-X:') { 98 | $Mode = "exec" 99 | $kw, $params = $params 100 | $ExecAliases = ":$kw" 101 | $ClojureArgs += $params 102 | break 103 | } elseif ($arg -ceq '-P') { 104 | $Prep = $TRUE 105 | } elseif ($arg -ceq '-Sdeps') { 106 | $DepsData, $params = $params 107 | } elseif ($arg -ceq '-Scp') { 108 | $ForceCP, $params = $params 109 | } elseif ($arg -ceq '-Spath') { 110 | $PrintClassPath = $TRUE 111 | } elseif ($arg -ceq '-Sverbose') { 112 | $Verbose = $TRUE 113 | } elseif ($arg -ceq '-Sthreads') { 114 | $Threads, $params = $params 115 | } elseif ($arg -ceq '-Strace') { 116 | $Trace = $TRUE 117 | } elseif ($arg -ceq '-Sdescribe') { 118 | $Describe = $TRUE 119 | } elseif ($arg -ceq '-Sforce') { 120 | $Force = $TRUE 121 | } elseif ($arg -ceq '-Srepro') { 122 | $Repro = $TRUE 123 | } elseif ($arg -ceq '-Stree') { 124 | $Tree = $TRUE 125 | } elseif ($arg -ceq '-Spom') { 126 | $Pom = $TRUE 127 | } elseif ($arg -ceq '-Sresolve-tags') { 128 | Write-Error "Option changed, use: clj -X:deps git-resolve-tags" 129 | return 130 | } elseif ($arg.StartsWith('-S')) { 131 | Write-Error "Invalid option: $arg" 132 | return 133 | } elseif ($arg -in '-h', '--help', '-?') { 134 | if ($MainAliases -or $AllAliases) { 135 | $ClojureArgs += $arg, $params 136 | break 137 | } else { 138 | $Help = $TRUE 139 | } 140 | } elseif ($arg -eq '--') { 141 | $ClojureArgs += $params 142 | break 143 | } else { 144 | $ClojureArgs += $arg, $params 145 | break 146 | } 147 | } 148 | 149 | # Find java executable 150 | $JavaCmd = (Get-Command java -ErrorAction SilentlyContinue).Path 151 | if (-not $JavaCmd) { 152 | $CandidateJavas = "$env:JAVA_HOME\bin\java.exe", "$env:JAVA_HOME\bin\java" 153 | $JavaCmd = $CandidateJavas | Where-Object { Test-Path $_ } | Select-Object -First 1 154 | if (-not ($env:JAVA_HOME -and $JavaCmd)) { 155 | Write-Error "Couldn't find 'java'. Please set JAVA_HOME." 156 | return 157 | } 158 | } 159 | if($env:JAVA_OPTS) { 160 | $JavaOpts = $env:JAVA_OPTS.Split(" ") 161 | } else { 162 | $JavaOpts = @() 163 | } 164 | if($env:CLJ_JVM_OPTS) { 165 | $CljJvmOpts = $env:CLJ_JVM_OPTS.Split(" ") 166 | } else { 167 | $CljJvmOpts = @() 168 | } 169 | 170 | if ($Help) { 171 | Write-Host @' 172 | Version: ${project.version} 173 | 174 | You use the Clojure tools ('clj' or 'clojure') to run Clojure programs 175 | on the JVM, e.g. to start a REPL or invoke a specific function with data. 176 | The Clojure tools will configure the JVM process by defining a classpath 177 | (of desired libraries), an execution environment (JVM options) and 178 | specifying a main class and args. 179 | 180 | Using a deps.edn file (or files), you tell Clojure where your source code 181 | resides and what libraries you need. Clojure will then calculate the full 182 | set of required libraries and a classpath, caching expensive parts of this 183 | process for better performance. 184 | 185 | The internal steps of the Clojure tools, as well as the Clojure functions 186 | you intend to run, are parameterized by data structures, often maps. Shell 187 | command lines are not optimized for passing nested data, so instead you 188 | will put the data structures in your deps.edn file and refer to them on the 189 | command line via 'aliases' - keywords that name data structures. 190 | 191 | 'clj' and 'clojure' differ in that 'clj' has extra support for use as a REPL 192 | in a terminal, and should be preferred unless you don't want that support, 193 | then use 'clojure'. 194 | 195 | Usage: 196 | Start a REPL clj [clj-opt*] [-Aaliases] 197 | Exec fn(s) clojure [clj-opt*] -X[aliases] a/fn? [kpath v]* kv-map? 198 | Run tool clojure [clj-opt*] -T[name|aliases] a/fn [kpath v] kv-map? 199 | Run main clojure [clj-opt*] -M[aliases] [init-opt*] [main-opt] [arg*] 200 | Prepare clojure [clj-opt*] -P [other exec opts] 201 | 202 | exec-opts: 203 | -Aaliases Use concatenated aliases to modify classpath 204 | -X[aliases] Use concatenated aliases to modify classpath or supply exec fn/args 205 | -T[name|aliases] Invoke tool by name or via aliases ala -X 206 | -M[aliases] Use concatenated aliases to modify classpath or supply main opts 207 | -P Prepare deps - download libs, cache classpath, but don't exec 208 | 209 | clj-opts: 210 | -Jopt Pass opt through in java_opts, ex: -J-Xmx512m 211 | -Sdeps EDN Deps data to use as the final deps file 212 | -Spath Compute classpath and echo to stdout only 213 | -Stree Print dependency tree 214 | -Scp CP Do NOT compute or cache classpath, use this one instead 215 | -Srepro Use only the local deps.edn (ignore other config files) 216 | -Sforce Force recomputation of the classpath (don't use the cache) 217 | -Sverbose Print important path info to console 218 | -Sthreads Set specific number of download threads 219 | -Strace Write a trace.edn file that traces deps expansion 220 | -- Stop parsing dep options and pass remaining arguments to clojure.main 221 | --version Print the version to stdout and exit 222 | -version Print the version to stderr and exit 223 | 224 | init-opt: 225 | -i, --init path Load a file or resource 226 | -e, --eval string Eval exprs in string; print non-nil values 227 | --report target Report uncaught exception to "file" (default), "stderr", or "none" 228 | 229 | main-opt: 230 | -m, --main ns-name Call the -main function from namespace w/args 231 | -r, --repl Run a repl 232 | path Run a script from a file or resource 233 | - Run a script from standard input 234 | -h, -?, --help Print this help message and exit 235 | 236 | Programs provided by :deps alias: 237 | -X:deps aliases List available aliases and their source 238 | -X:deps list List full transitive deps set and licenses 239 | -X:deps tree Print deps tree 240 | -X:deps find-versions Find available versions of a library 241 | -X:deps prep Prepare all unprepped libs in the dep tree 242 | -X:deps mvn-pom Generate (or update) pom.xml with deps and paths 243 | -X:deps mvn-install Install a maven jar to the local repository cache 244 | -X:deps git-resolve-tags Resolve git coord tags to shas and update deps.edn 245 | 246 | For more info, see: 247 | https://clojure.org/guides/deps_and_cli 248 | https://clojure.org/reference/repl_and_main 249 | '@ 250 | return 251 | } 252 | 253 | # Determine user config directory 254 | if ($env:CLJ_CONFIG) { 255 | $ConfigDir = $env:CLJ_CONFIG 256 | } elseif ($env:HOME) { 257 | $ConfigDir = "$env:HOME\.clojure" 258 | } else { 259 | $ConfigDir = "$env:USERPROFILE\.clojure" 260 | } 261 | 262 | # If user config directory does not exist, create it 263 | if (!(Test-Path "$ConfigDir")) { 264 | New-Item -Type Directory "$ConfigDir" | Out-Null 265 | } 266 | if (!(Test-Path "$ConfigDir\deps.edn")) { 267 | Copy-Item "$InstallDir\example-deps.edn" "$ConfigDir\deps.edn" 268 | } 269 | if (!(Test-Path "$ConfigDir\tools")) { 270 | New-Item -Type Directory "$ConfigDir\tools" | Out-Null 271 | } 272 | if (Test-NewerFile "$InstallDir\tools.edn" "$ConfigDir\tools\tools.edn") { 273 | Copy-Item "$InstallDir\tools.edn" "$ConfigDir\tools\tools.edn" 274 | } 275 | 276 | # Determine user cache directory 277 | if ($env:CLJ_CACHE) { 278 | $UserCacheDir = $env:CLJ_CACHE 279 | } else { 280 | $UserCacheDir = "$ConfigDir\.cpcache" 281 | } 282 | 283 | # Chain deps.edn in config paths. repro=skip config dir 284 | $ConfigProject='deps.edn' 285 | if ($Repro) { 286 | $ConfigPaths = "$InstallDir\deps.edn", 'deps.edn' 287 | } else { 288 | $ConfigUser = "$ConfigDir\deps.edn" 289 | $ConfigPaths = "$InstallDir\deps.edn", "$ConfigDir\deps.edn", 'deps.edn' 290 | } 291 | 292 | # Determine whether to use user or project cache 293 | if (Test-Path deps.edn) { 294 | $CacheDir = '.cpcache' 295 | if(!(Test-Path $CacheDir -PathType container)) { 296 | Try { 297 | New-Item -Name $CacheDir -ItemType "directory" 298 | } 299 | Catch { # fall back to user cache dir 300 | $CacheDirKey = Get-Location 301 | $CacheDir = $UserCacheDir 302 | } 303 | } 304 | } else { 305 | $CacheDir = $UserCacheDir 306 | } 307 | 308 | # Construct location of cached classpath file 309 | $CacheVersion = "5" 310 | $CacheKey = "$CacheVersion|$CacheDirKey|$($ReplAliases -join '')|$($JvmAliases -join '')|$ExecAliases|$MainAliases|$DepsData|$ToolName|$ToolAliases|$($ConfigPaths -join '|')" 311 | $CacheKeyHash = (Get-StringHash $CacheKey) -replace '-', '' 312 | 313 | $CpFile = "$CacheDir\$CacheKeyHash.cp" 314 | $JvmFile = "$CacheDir\$CacheKeyHash.jvm" 315 | $MainFile = "$CacheDir\$CacheKeyHash.main" 316 | $BasisFile = "$CacheDir\$CacheKeyHash.basis" 317 | $ManifestFile = "$CacheDir\$CacheKeyHash.manifest" 318 | 319 | # Print paths in verbose mode 320 | if ($Verbose) { 321 | Write-Output @" 322 | version = $Version 323 | install_dir = $InstallDir 324 | config_dir = $ConfigDir 325 | config_paths = $ConfigPaths 326 | cache_dir = $CacheDir 327 | cp_file = $CpFile 328 | "@ 329 | } 330 | 331 | # Check for stale classpath file 332 | $Stale = $FALSE 333 | if ($Force -or $Trace -or $Tree -or $Prep -or !(Test-Path $CpFile)) { 334 | $Stale = $TRUE 335 | } elseif ($ToolName -and (Test-NewerFile "$ConfigDir\tools\$ToolName.edn" "$CpFile" )) { 336 | $Stale = $TRUE 337 | } else { 338 | if ($ConfigPaths | Where-Object { Test-NewerFile $_ $CpFile }) { 339 | $Stale = $TRUE 340 | } 341 | if (Test-Path $ManifestFile) { 342 | $Manifests = @(Get-Content $ManifestFile) 343 | if ($Manifests | Where-Object { !(Test-Path $_) -or (Test-NewerFile $_ $CpFile) }) { 344 | $Stale = $TRUE 345 | } 346 | } 347 | } 348 | 349 | # Make tools args if needed 350 | if ($Stale -or $Pom) { 351 | $ToolsArgs = @() 352 | if ($DepsData) { 353 | $ToolsArgs += '--config-data' 354 | $ToolsArgs += $DepsData 355 | } 356 | if ($MainAliases) { 357 | $ToolsArgs += "-M$MainAliases" 358 | } 359 | if ($ReplAliases) { 360 | $ToolsArgs += "-A$($ReplAliases -join '')" 361 | } 362 | if ($ExecAliases) { 363 | $ToolsArgs += "-X$ExecAliases" 364 | } 365 | if ($Mode -ceq 'tool') { 366 | $ToolsArgs += "--tool-mode" 367 | } 368 | if ($ToolName) { 369 | $ToolsArgs += "--tool-name" 370 | $ToolsArgs += "$ToolName" 371 | } 372 | if ($ToolAliases) { 373 | $ToolsArgs += "-T$ToolAliases" 374 | } 375 | if ($ForceCp) { 376 | $ToolsArgs += '--skip-cp' 377 | } 378 | if ($Threads) { 379 | $ToolsArgs += '--threads' 380 | $ToolsArgs += $Threads 381 | } 382 | if ($Trace) { 383 | $ToolsArgs += '--trace' 384 | } 385 | if ($Tree) { 386 | $ToolsArgs += '--tree' 387 | } 388 | } 389 | 390 | # If stale, run make-classpath to refresh cached classpath 391 | if ($Stale -and (-not $Describe)) { 392 | if ($Verbose) { 393 | Write-Host "Refreshing classpath" 394 | } 395 | & $JavaCmd -XX:-OmitStackTraceInFastThrow @CljJvmOpts -classpath $ToolsCp clojure.main -m clojure.tools.deps.script.make-classpath2 --config-user $ConfigUser --config-project $ConfigProject --basis-file $BasisFile --cp-file $CpFile --jvm-file $JvmFile --main-file $MainFile --manifest-file $ManifestFile @ToolsArgs 396 | if ($LastExitCode -ne 0) { 397 | return 398 | } 399 | } 400 | 401 | if ($Describe) { 402 | $CP = '' 403 | } elseif ($ForceCp) { 404 | $CP = $ForceCp 405 | } else { 406 | $CP = Get-Content $CpFile 407 | } 408 | 409 | if ($Prep) { 410 | # Already done 411 | } elseif ($Pom) { 412 | & $JavaCmd -XX:-OmitStackTraceInFastThrow @CljJvmOpts -classpath $ToolsCp clojure.main -m clojure.tools.deps.script.generate-manifest2 --config-user $ConfigUser --config-project $ConfigProject --gen=pom @ToolsArgs 413 | } elseif ($PrintClassPath) { 414 | Write-Output $CP 415 | } elseif ($Describe) { 416 | $PathVector = ($ConfigPaths | ForEach-Object { "`"$($_.Replace("\","\\"))`"" }) -join ' ' 417 | Write-Output @" 418 | {:version "$Version" 419 | :config-files [$PathVector] 420 | :config-user "$($ConfigUser.Replace("\","\\"))" 421 | :config-project "$($ConfigProject.Replace("\","\\"))" 422 | :install-dir "$($InstallDir.Replace("\","\\"))" 423 | :config-dir "$($ConfigDir.Replace("\","\\"))" 424 | :cache-dir "$($CacheDir.Replace("\","\\"))" 425 | :force $(if ($Force) {"true"} else {"false"}) 426 | :repro $(if ($Repro) {"true"} else {"false"}) 427 | :main-aliases "$main_aliases" 428 | :repl-aliases "$repl_aliases" 429 | :exec-aliases "$exec_aliases"} 430 | "@ 431 | } elseif ($Tree) { 432 | # Already done 433 | } elseif ($Trace) { 434 | Write-Host "Wrote trace.edn" 435 | } else { 436 | if (Test-Path $JvmFile) { 437 | $JvmCacheOpts = @(Get-Content $JvmFile) 438 | } 439 | 440 | if (($Mode -eq 'exec') -or ($Mode -eq 'tool')) { 441 | & $JavaCmd -XX:-OmitStackTraceInFastThrow @JavaOpts @JvmCacheOpts @JvmOpts "-Dclojure.basis=$BasisFile" -classpath "$CP;$InstallDir/exec.jar" clojure.main -m clojure.run.exec @ClojureArgs 442 | } else { 443 | if (Test-Path $MainFile) { 444 | # TODO this seems dangerous 445 | $MainCacheOpts = @(Get-Content $MainFile) -replace '"', '\"' 446 | } 447 | if ($ClojureArgs.Count -gt 0 -and $Mode -eq 'repl') { 448 | Write-Warning "WARNING: Implicit use of clojure.main with options is deprecated, use -M" 449 | } 450 | & $JavaCmd -XX:-OmitStackTraceInFastThrow @JavaOpts @JvmCacheOpts @JvmOpts "-Dclojure.basis=$BasisFile" -classpath $CP clojure.main @MainCacheOpts @ClojureArgs 451 | } 452 | } 453 | } 454 | 455 | New-Alias -Name clj -Value Invoke-Clojure 456 | New-Alias -Name clojure -Value Invoke-Clojure 457 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changelog 2 | =========== 3 | 4 | **Also see [tools.deps changelog](https://github.com/clojure/tools.deps.alpha/blob/master/CHANGELOG.md)** 5 | 6 | clj has both stable and prerelease versions. Current and former stable build are listed in **bold** and are (or were) available from the default [brew formula](https://github.com/clojure/brew-install/). Other versions can be obtained using versioned formulas only. 7 | 8 | Prerelease versions: none 9 | 10 | **Current stable version:** 11 | 12 | * **1.12.4.1582 on Dec 10, 2025** 13 | * **Update to Clojure 1.12.4** 14 | 15 | Older versions (previous stable builds in bold): 16 | 17 | * **1.12.3.1577 on Sep 25, 2025** 18 | * **Update to Clojure 1.12.3** 19 | * **1.12.2.1571 on Sep 22, 2025** 20 | * **Update to latest tools.deps and tools.deps.cli** 21 | * **1.12.2.1565 on Aug 26, 2025** 22 | * **Update to Clojure 1.12.2** 23 | * **1.12.1.1561 on Aug 14, 2025** 24 | * **Update to latest deps** 25 | * **1.12.1.1550 on Jun 3, 2025** 26 | * **`-Sdescribe` - undocumented (prefer using tools.deps APIs instead)** 27 | * **`-Sverbose` - add explicit deps.edn references** 28 | * **1.12.1.1543 on Jun 3, 2025** 29 | * **Update to Clojure 1.12.1** 30 | * **1.12.1.1538 on Jun 2, 2025** 31 | * **Update to Clojure 1.12.1** 32 | * **1.12.0.1530 on Mar 5, 2025** 33 | * **Update to tools.deps 0.23.1512** 34 | * 1.12.0.1523 on Mar 5, 2025 35 | * Also accept file for -Sdeps, and check it for staleness 36 | * Update to tools.deps 0.22.1497 37 | * **1.12.0.1517 on Feb 7, 2025** 38 | * **Update to tools.deps 0.22.1492** 39 | * 1.12.0.1514 on Feb 7, 2025 40 | * Update to tools.deps 0.22.1484 41 | * 1.12.0.1510 on Feb 6, 2025 42 | * Update to tools.deps 0.22.1480 43 | * 1.12.0.1506 on Feb 6, 2025 44 | * Update to tools.deps 0.22.1476 45 | * **1.12.0.1501 on Jan 27, 2025** 46 | * **Update to tools.deps 0.21.1471** 47 | * **1.12.0.1495 on Dec 31, 2024** 48 | * **Echo args with -M deprecation warning for clarity** 49 | * **Update to tools.deps 0.21.1467** 50 | * **1.12.0.1488** on Nov 21, 2024 51 | * **Tweak message when -X or -T function namespace not found** 52 | * **Update to latest tools.tools** 53 | * **Update to latest tools.deps** 54 | * **1.12.0.1479** 55 | * **Default to Clojure 1.12.0** 56 | * **Update to tools.deps 0.21.1449 and tools.deps.cli** 57 | * **1.11.4.1474** 58 | * **Default to Clojure 1.11.4** 59 | * **Update to tools.deps 0.20.1440** 60 | * **1.11.3.1463** 61 | * **Update list of :deps programs in help** 62 | * **Update to latest tools.deps.cli, tools.deps, and tools.build** 63 | * **1.11.3.1456 on Apr 24, 2024** 64 | * **Update to latest tools.deps and tools.deps.cli** 65 | * 1.11.3.1452 on Apr 24, 2024 66 | * Update to Clojure 1.11.3 as default 67 | * **1.11.2.1446 on Mar 8, 2024** 68 | * **Update to tools.deps 0.19.1417** 69 | * **1.11.2.1441 on Mar 8, 2024** 70 | * **Update to tools.tools 0.3.3** 71 | * **Update to Clojure 1.11.2** 72 | * **1.11.1.1435 on Dec 29, 2023** 73 | * **Update to tools.deps 1.18.1394** 74 | * **1.11.1.1429 on Dec 4, 2023** 75 | * **Update to tools.deps 1.18.1374** 76 | * **1.11.1.1420 on Dec 4, 2023** 77 | * **TDEPS-119 Unable to start CLI in write-protected project directory** 78 | * **Update to tools.deps 1.18.1370** 79 | * **Update to tools.tools 0.3.2** 80 | * **1.11.1.1413 on Aug 26, 2023** 81 | * **No changes from prior** 82 | * **1.11.1.1409 on Aug 25, 2023** 83 | * **No changes from prior** 84 | * **1.11.1.1405 on Aug 22, 2023** 85 | * **GitHub releases now contain .sha256 files for binaries** 86 | * **1.11.1.1386 on Aug 14, 2023** 87 | * **Release artifacts are now published to GitHub, and the download archive is used only as a mirror** 88 | * **1.11.1.1369 on Aug 14, 2023** 89 | * **Download and mirroring wip** 90 | * **1.11.1.1365 on Aug 13, 2023** 91 | * **Download and mirroring wip** 92 | * **1.11.1.1347 on May 31, 2023** 93 | * **With -X or -T accept `-` as a trailing argument to read the remainder of args from stdin** 94 | * **On windows installer, hide progress bar on download** 95 | * **Update to tools.deps 0.18.1354** 96 | * **Update to tools.tools 0.3.1** 97 | * **1.11.1.1273 on Apr 3, 2023** 98 | * **Change help text to point to -X:deps mvn-pom instead of -Spom** 99 | * **Switch to tools.deps 0.18.1335** 100 | * **1.11.1.1267 on Mar 31, 2023** 101 | * **Switch to tools.deps 0.18.1331** 102 | * **1.11.1.1262 on Mar 27, 2023** 103 | * **Switch to tools.deps 0.18.1317** 104 | * **1.11.1.1257 on Mar 15, 2023** 105 | * **Switch to tools.deps 0.18.1308** 106 | * **1.11.1.1252 on Mar 6, 2023** 107 | * **Switch to passing exec args via the basis :argmap** 108 | * **Function execution protocol support for -X/-T** 109 | * **Switch to tools.deps 0.17.1297** 110 | * **1.11.1.1237 on Feb 27, 2023** 111 | * **Updates on -R and -C error messages** 112 | * 1.11.1.1234 on Feb 27, 2023 113 | * Remove deprecated support for -R and -C 114 | * Clean up help text around repl supporting init-opts 115 | * Switch to tools.deps 0.16.1285 116 | * **1.11.1.1224** on Feb 12, 2023** 117 | * **Switch to tools.deps 0.16.1281** 118 | * **TDEPS-236 Add rlwrap -m to clj for multiline editing** 119 | * **1.11.1.1208 on Dec 11, 2022** 120 | * **Switch to tools.deps 0.16.1264** 121 | * **TDEPS-234 - Set -XX:-OmitStackTraceInFastThrow always** 122 | * **1.11.1.1200 on Nov 14, 2022** 123 | * **Update to tools.deps.alpha 0.15.1254** 124 | * **Update to tools.tools v0.2.9** 125 | * 1.11.1.1194 on Nov 14, 2022 126 | * Update to tools.deps.alpha 0.15.1250 127 | * **1.11.1.1189 on Nov 2, 2022** 128 | * **TDEPS-233 bash script fixes from stale jar check changes** 129 | * **Add some missing items on help and man page** 130 | * **1.11.1.1182 on Oct 24, 2022** 131 | * **Update to tools.deps.alpha 0.15.1244** 132 | * 1.11.1.1177 on Oct 23, 2022 133 | * Fix bug in posix-install.sh 134 | * 1.11.1.1174 on Oct 23, 2022 135 | * TDEPS-70 - Detect missing jar in classpath and recompute 136 | * TDEPS-200 - Clean up default user deps.edn 137 | * TDEPS-232 - Add more generic posix installer 138 | * Update to tools.deps.alpha 0.15.1237 139 | * **1.11.1.1165 on Sep 18, 2022** 140 | * Extended the env var support to Windows 141 | * 1.11.1.1161 on Sep 16, 2022 142 | * Use `$CLJ_JVM_OPTS` as jvm options on calls to internal tooling (making classpaths etc) 143 | * Use `$JAVA_OPTS` as jvm options on calls to user programs 144 | * **1.11.1.1155 on Aug 5, 2022** 145 | * **Update to tools.deps.alpha 0.14.1222** 146 | * **1.11.1.1149 on Jun 21, 2022** 147 | * **Update to tools.tools 0.2.8** 148 | * 1.11.1.1145 on Jun 20, 2022 149 | * Update to tools.tools 0.2.7 150 | * Update to tools.deps.alpha 0.14.1212 151 | * **1.11.1.1139 on Jun 16, 2022** 152 | * **Update to tools.tools 0.2.6** 153 | * **Update to tools.deps.alpha 0.14.1205** 154 | * 1.11.1.1135 on Jun 16, 2022 155 | * Update to tools.deps.alpha 0.14.1200 156 | * **1.11.1.1129 on Jun 12, 2022** 157 | * **Update to tools.deps.alpha 0.14.1194** 158 | * **1.11.1.1124** on Jun 11, 2022 159 | * **Update to tools.deps.alpha 0.14.1189** 160 | * **1.11.1.1119** on Jun 9, 2022 161 | * **Update to tools.deps.alpha 0.14.1185** 162 | * **1.11.1.1113** on Apr 22, 2022 163 | * **Update to tools.deps.alpha 0.14.1178** 164 | * **Update to tools.build v0.8.1** 165 | * **1.11.1.1105 on Apr 5, 2022** 166 | * **Update to clojure 1.11.1** 167 | * **1.11.0.1100 on Mar 28, 2022** 168 | * **No changes from prior** 169 | * 1.11.0.1097 on Mar 25, 2022 170 | * Update to clojure 1.11.0 171 | * 1.10.3.1093 on Mar 21, 2022 172 | * Update to tools.deps.alpha 0.12.1162 173 | * **1.10.3.1087 on Feb 28, 2022** 174 | * **Update to tools.deps.alpha 0.12.1158** 175 | * **Update to tools.build v0.8.0** 176 | * 1.10.3.1082 on Feb 11, 2022 177 | * Update to tools.deps.alpha 0.12.1148 178 | * **1.10.3.1075 on Feb 2, 2022** 179 | * **Update to tools.deps.alpha 0.12.1135** 180 | * **1.10.3.1069 on Jan 26, 2022** 181 | * **Update to tools.deps.alpha 0.12.1120** 182 | * **Update to tools.tools v0.2.5** 183 | * **Add check to error on invocation of multiple exec functions** 184 | * **1.10.3.1058 on Jan 4, 2022** 185 | * **Update to tools.deps.alpha 0.12.1109** 186 | * 1.10.3.1053 on Dec 23, 2021 187 | * Update to tools.deps.alpha 0.12.1104 188 | * Update to tools.tools 0.2.3 189 | * Build with tools.build 0.7.3 190 | * 1.10.3.1049 on Dec 22, 2021 191 | * Update to tools.deps.alpha 0.12.1098 192 | * **1.10.3.1040 on Dec 1, 2021** 193 | * **Update to tools.deps.alpha 0.12.1084** 194 | * 1.10.3.1036 on Nov 30, 2021 195 | * Update to tools.deps.alpha 0.12.1080 196 | * **1.10.3.1029 on Nov 8, 2021** 197 | * **Update to tools.deps.alpha 0.12.1071** 198 | * **Update to tools.tools 0.2.2** 199 | * **Update to tools.build 0.6.3** 200 | * **1.10.3.1020 on Nov 4, 2021** 201 | * **TDEPS-83 - invalidate cp cache when local manifest is missing** 202 | * **Update to tools.deps.alpha 0.12.1067** 203 | * 1.10.3.1013 on Oct 30, 2021 204 | * Undo: -Stree no longer forces cache recompute 205 | * 1.10.3.1007 on Oct 29, 2021 206 | * TDEPS-83 - invalidate cp cache when local lib manifests are stale 207 | * -Stree no longer forces cache recompute 208 | * Clean up exception handling for -X 209 | * Update to tools.deps.alpha 0.12.1063 210 | * **1.10.3.998 on Oct 26, 2021** 211 | * **Remove `bottle :unneeded` from brew formulas** 212 | * **Update to tools.deps.alpha 0.12.1058** 213 | * **Update to tools.tools v0.2.1** 214 | * **1.10.3.986 on Sept 22, 2021** 215 | * **Rebuild to actually include latest tools.deps.alpha** 216 | * **Update to tools.deps.alpha 0.12.1048** 217 | * **1.10.3.981 on Sept 17, 2021** 218 | * **Update to tools.build v0.5.0** 219 | * 1.10.3.976 on Sept 17, 2021 220 | * Update to tools.deps.alpha 0.12.1041 221 | * **1.10.3.967 on Aug 31, 2021** 222 | * **Undo compilation of exec stub jar** 223 | * 1.10.3.962 on Aug 30, 2021 224 | * Modify build to compile tools.deps entry points and exec stub jar 225 | * Update to tools.deps.alpha 0.12.1036 226 | * 1.10.3.956 on Aug 27, 2021 227 | * Refine exec exceptions for missing namespace vs missing function in namespace 228 | * Update to tools.deps.alpha 0.12.1030 229 | * Build the Clojure CLI with tools.build, instead of Maven 230 | * 1.10.3.949 on Aug 17, 2021 231 | * Update to tools.deps.alpha 0.12.1026 232 | * **1.10.3.943 on Aug 10, 2021** 233 | * **Update to tools.deps.alpha 0.12.1019** 234 | * 1.10.3.939 on Aug 9, 2021 235 | * Update to tools.deps.alpha 0.12.1013 236 | * **1.10.3.933 on July 28, 2021** 237 | * **TDEPS-198 - on -X, don't use System/exit or shutdown-agents (but don't let agent threads block exit)** 238 | * 1.10.3.929 on July 21, 2021 239 | * TDEPS-189 Port -T changes to Windows 240 | * Did some script cleanup in bash 241 | * 1.10.3.920 on July 19, 2021 242 | * Fix regression in -X execution 243 | * 1.10.3.916 on July 19, 2021 244 | * TDEPS-187 - redo how -X and -T get execute arg data 245 | * Update to tools.deps.alpha 0.12.1003 246 | * 1.10.3.912 on July 15, 2021 247 | * On -X success, exit with (shutdown-agents) instead of System/exit 248 | * TDEPS-187 - pass -A aliases along with -Ttool 249 | * 1.10.3.905 on July 9, 2021 250 | * Removing multi-function support from -X and -T for now 251 | * 1.10.3.899 on July 9, 2021 252 | * New tools support 253 | * Added -T 254 | * Update to tools.deps.alpha 0.12.985 255 | * 1.10.3.882 on June 15, 2021 256 | * On -X success, exit with System/exit to avoid hang from futures 257 | * Bind namespace resolution context around -X 258 | * 1.10.3.875 on June 10, 2021 259 | * New: support for specifying multiple functions with -X with -> semantics 260 | * TDEPS-182 - Improve deprecation message to be more accurate 261 | * TDEPS-183 - Fix -Sdescribe output to be valid edn on Windows 262 | * Update to tools.deps.alpha 0.11.931 263 | * **1.10.3.855 on May 25, 2021** 264 | * **Fix bug in applying :jvm-opts flags for -X on Windows** 265 | * **1.10.3.849 on May 20, 2021** 266 | * **Add support for trailing map in -X calls** 267 | * **Update to tools.deps.alpha 0.11.922** 268 | * **1.10.3.839 on May 12, 2021** 269 | * **Fix breakage in linux installer in 1.10.3.833** 270 | * **1.10.3.833 on May 11, 2021** 271 | * **Clean up script variables** 272 | * 1.10.3.829 on May 11, 2021 273 | * Update to tools.deps.alpha 0.11.918 274 | * **1.10.3.822 on Apr 3, 2021** 275 | * **Update to tools.deps.alpha 0.11.910** 276 | * **1.10.3.814 on Mar 11, 2021** 277 | * **Update to tools.deps.alpha 0.11.905** 278 | * 1.10.3.810 on Mar 10, 2021 279 | * Use Clojure 1.10.3 by default 280 | * Update to tools.deps.alpha 0.11.901 281 | * 1.10.2.805 on Mar 10, 2021 282 | * Update to tools.deps.alpha 0.10.895 283 | * 1.10.2.801 on Mar 3, 2021 284 | * Update to tools.deps.alpha 0.10.889 285 | * **1.10.2.796 on Feb 23, 2021** 286 | * **Update to tools.deps.alpha 0.9.884** 287 | * **1.10.2.790 on Feb 19, 2021** 288 | * **Add -version and --version to print Clojure CLI version (to stderr and stdout respectively)** 289 | * 1.10.2.786 on Feb 17, 2021 290 | * TDEPS-56 - fix main-opts and jvm-opts splitting on space 291 | * Update to tools.deps.alpha 0.9.876 292 | * 1.10.2.781 on Feb 8, 2021 293 | * TDEPS-125 - use `JAVA_CMD` if set 294 | * Update to tools.deps.alpha 0.9.871 295 | * **1.10.2.774 on Jan 26, 2021** 296 | * **Change default Clojure dep to 1.10.2** 297 | * **Update to tools.deps.alpha 0.9.863** 298 | * 1.10.1.769 on Jan 26, 2021 299 | * Update to tools.deps.alpha 0.9.859 300 | * **1.10.1.763 on Dec 10, 2020** 301 | * **Set exit code for -X ex-info error** 302 | * **Sync up cli syntax for aliases in help** 303 | * **1.10.1.754 on Dec 7, 2020** 304 | * **Update to tools.deps.alpha 0.9.857** 305 | * **Update Windows scripts for new -Stree format** 306 | * 1.10.1.749 on Dec 6, 2020 307 | * Update -Stree to use new tree printer 308 | * Update to tools.deps.alpha 0.9.853 309 | * 1.10.1.745 on Dec 2, 2020 310 | * Update to tools.deps.alpha 0.9.847 311 | * **1.10.1.739 on Nov 23, 2020** 312 | * **Update to tools.deps.alpha 0.9.840** 313 | * 1.10.1.735 on Oct 30, 2020 314 | * Fix double throw in -X handling 315 | * Error if -A used without an alias 316 | * **1.10.1.727 on Oct 21, 2020** 317 | * **Update to tools.deps.alpha 0.9.833** 318 | * 1.10.1.723 on Oct 20, 2020 319 | * Fix `clj -X:deps tree` adding tools.deps.alpha to tree 320 | * Fix `clj -X:deps mvn-pom` adding tools.deps.alpha to pom deps 321 | * Fix `clj -X:deps git-resolve-tags` not working 322 | * Update to tools.deps.alpha 0.9.828 323 | * **1.10.1.716 on Oct 10, 2020** 324 | * **Make edn reading tolerant of unknown tagged literals** 325 | * **Update to tools.deps.alpha 0.9.821** 326 | * **1.10.1.708 on Oct 7, 2020** 327 | * **Update to tools.deps.alpha 0.9.816** 328 | * **TDEPS-168 - Fix error message handling for -X** 329 | * **1.10.1.697 on Sep 25, 2020** 330 | * **Update to tools.deps.alpha 0.9.810** 331 | * 1.10.1.693 on Sep 21, 2020 332 | * Update windows scripts for latest 333 | * Re-instate -Stree 334 | * Update to tools.deps.alpha 0.9.799 335 | * 1.10.1.681 on Sep 11, 2020 336 | * Reinstate -R, -C, and -Spom as deprecated options 337 | * Update to tools.deps.alpha 0.9.795 338 | * 1.10.1.672 on Sep 4, 2020 339 | * Add -P to prepare (download, cache classpath) without execution 340 | * Enhance -X and -M to support all argmaps 341 | * Enhance -X to support ad hoc function (-F removed) 342 | * Add new argmap keys for -X, :ns-default, :ns-aliases 343 | * Deprecate main args without -M 344 | * Remove -T, -R, -C, -O 345 | * In deps.edn, deprecate :deps/:paths in alias (change to :replace-deps/:replace-paths) 346 | * In deps.edn, change :fn/:args to :exec-fn/:exec-args 347 | * Move -Sdeps, -Spom, -Sresolve-tags into -X:deps invocations 348 | * Update to tools.deps.alpha 0.9.782 349 | * 1.10.1.645 on Aug 9, 2020 350 | * Update to tools.deps.alpha 0.9.763 351 | * 1.10.1.641 on Aug 8, 2020 352 | * Fix clj -X to make :args optional 353 | * 1.10.1.636 on Aug 7, 2020 354 | * Fix clj -X arg handler in Windows 355 | * Update to tools.deps.alpha 0.9.759 356 | * 1.10.1.619 on July 31, 2020 357 | * Error handling on -X :args 358 | * 1.10.1.615 on July 30, 2020 359 | * Add -F function exec 360 | * Update to tools.deps.alpha 0.9.751 361 | * 1.10.1.604 on July 28, 2020 362 | * Fix clj -X arg handler in Windows 363 | * 1.10.1.600 on July 28, 2020 364 | * Fix clj -X handler in Windows 365 | * 1.10.1.596 on July 28, 2020 366 | * Fix clj -X handler 367 | * 1.10.1.590 on July 22, 2020 368 | * Added new execution mode to execute a function that takes an argmap via -X 369 | * Added support for using data stored in aliases as :paths 370 | * Added explicit "tool" step to cover :deps and :paths replacement, which can be passed via alias -T 371 | * Update to tools.deps.alpha 0.9.745 372 | * **1.10.1.561 on July 17, 2020** 373 | * **Update to tools.deps.alpha 0.8.709** 374 | * 1.10.1.554 on July 15, 2020 375 | * Update to tools.deps.alpha 0.8.702 376 | * **1.10.1.547 on June 11, 2020** 377 | * **In Windows impl, use Write-Output when returning values like with -Spath** 378 | * **Update to tools.deps.alpha 0.8.695** 379 | * 1.10.1.524-**1.10.1.536 on Feb 28, 2020** 380 | * Working on release automation, no changes 381 | * **All releases older than this were stable releases** 382 | * 1.10.1.510 on Feb 14, 2020 383 | * Update to tools.deps.alpha 0.8.677 384 | * 1.10.1.507 on Jan 30, 2020 385 | * Update to tools.deps.alpha 0.8.661 386 | * Add -Sthreads option for concurrent downloads 387 | * Use -- to separate dep options and clojure.main options 388 | * 1.10.1.502 on Jan 20, 2020 389 | * Report clj version in clj -h 390 | * Update to tools.deps.alpha 0.8.640 391 | * 1.10.1.496 on Jan 16, 2020 392 | * Update to tools.deps.alpha 0.8.624 393 | * Remove -Xms on tool jvms 394 | * 1.10.1.492 on Nov 25, 2019 395 | * Fix bad condition checking whether to write trace.edn 396 | * 1.10.1.489 on Nov 20, 2019 397 | * Update to tools.deps.alpha 0.8.599 398 | * Join aliases in windows script without spaces 399 | * Added -Strace option 400 | * 1.10.1.483 on Nov 4, 2019 401 | * Update to tools.deps.alpha 0.8.584 402 | * Use homebrew ruby to minimize env conflicts 403 | * 1.10.1.478 on Oct 18, 2019 404 | * Update to tools.deps.alpha 0.8.567 405 | * Report locations of user and project configs in -Sdescribe 406 | * 1.10.1.472 on Oct 15, 2019 407 | * Update to tools.deps.alpha 0.8.559 408 | * 1.10.1.469 on Aug 9, 2019 409 | * Update to tools.deps.alpha 0.7.541 410 | * Add slf4j-nop which was removed from tools.deps.alpha 411 | * 1.10.1.466 on July 17, 2019 412 | * Use min heap setting, not max, on internal tool calls 413 | * Update to tools.deps 0.7.527 414 | * 1.10.1.462 on July 3, 2019 415 | * Rollback deps.edn install changes and install again 416 | * 1.10.1.458 on June 29, 2019 417 | * Update to tools.deps 0.7.511 418 | * 1.10.1.455 on June 28, 2019 419 | * Fix some manpage/help formatting 420 | * TDEPS-131 Fix bug tracker link in man page 421 | * Update to tools.deps 0.7.505 422 | * Stop installing deps.edn, now embedded in tools.deps 423 | * 1.10.1.447 on June 6, 2019 424 | * Add new clj option to man page and clj help 425 | * 1.10.1.445 on June 6, 2019 426 | * Change default Clojure to 1.10.1 427 | * 1.10.0.442 on Mar 16, 2019 428 | * Update to tools.deps.alpha 0.6.496 429 | * Early release of Windows clj 430 | * 1.10.0.414 on Feb 13, 2019 431 | * Update to tools.deps.alpha 0.6.488 432 | * 1.10.0.411 on Jan 4, 2019 433 | * Update to tools.deps.alpha 0.6.480 434 | * 1.10.0.408 on Jan 2, 2019 435 | * Update to tools.deps.alpha 0.6.474 436 | * FIX TDEPS-82 - ensure -Sdescribe doesn't trigger resolution 437 | * 1.10.0.403 on Dec 17, 2018 438 | * Changed default Clojure version to 1.10 439 | * 1.9.0.397 on Oct 17, 2018 440 | * Update to tools.deps.alpha 0.5.460 441 | * 1.9.0.394 on Sept 15, 2018 442 | * Update to tools.deps.alpha 0.5.452 443 | * 1.9.0.391 on July 19, 2018 444 | * FIX TDEPS-77 - fix bad break character in rlwrap 445 | * FIX TDEPS-86 - use non-0 exit code in clj if rlwrap doesn't exist 446 | * FIX TDEPS-87 - change wording describing -Sdeps in help and man 447 | * 1.9.0.381 on May 11, 2018 448 | * FIX TDEPS-76 - use exec for final Java invocation in script 449 | * NEW Convey lib map via Java system property 450 | * 1.9.0.375 on Apr 14, 2018 451 | * FIX TDEPS-61 - switch to use Clojars CDN repo 452 | * FIX TDEPS-71 - better error if Java not installed 453 | * FIX TDEPS-65 - specify permissions on installed files 454 | * 1.9.0.358 on Mar 2, 2018 455 | * FIX linux-install - use mkdir -p to ensure parent dirs are created 456 | * FIX brew install - move man page installation from formula to install.sh 457 | * FIX TDEPS-45 - don't swipe -h flag if main aliases are in effect 458 | * FIX TDEPS-47 - use classpath cache with -Sdeps 459 | * 1.9.0.348 on Feb 23, 2018 460 | * NEW Add --prefix to linux-install (INST-9) 461 | * NEW Add man page to installation (INST-18) 462 | * FIX Fix uberjar construction to avoid overlap of file and directory with same name 463 | * FIX Add missing license file 464 | * 1.9.0.341 on Feb 21, 2018 465 | * CHANGE -Senv to -Sdescribe 466 | * 1.9.0.338 on Feb 20, 2018 467 | * NEW -Senv - print edn for Clojure config, similar to -Sverbose info 468 | * NEW -Scp - provide a custom classpath and ignore classpath gen 469 | * 1.9.0.326 on Feb 2, 2018 470 | * NEW -O - Java option aliases (append if multiple) 471 | * NEW -M - clojure.main option aliases (replace if multiple) 472 | * NEW -A - generic alias can combine any kind of alias and all are applied 473 | * FIX - if multiple alias switches supplied, they combine 474 | * FIX - whitespace in help fixed 475 | * 1.9.0.315 on Jan 23, 2018 476 | * NEW -Stree to print dependency tree 477 | * NEW -Sdeps to supply a deps.edn on the command line as data 478 | * FIX bug with git deps using :deps/root writing File objects to libs files 479 | * 1.9.0.309 on Jan 18, 2018 480 | * NEW -Spom emits dep exclusions and classifier 481 | * NEW pom file reader for local and git deps 482 | * FIX git deps now use :deps/root if specified 483 | * FIX major updates to improve transitive version selection 484 | * ENHANCE git version resolution uses stricter rules in comparison 485 | * ENHANCE dump stack on unexpected errors for debugging 486 | * 1.9.0.302 on Jan 8, 2018 487 | * CHANGE git dep attributes (removed :rev, added :tag and :sha) 488 | * FIX Java 9 warning with -Spom 489 | * NEW -Sresolve-tags 490 | * 1.9.0.297 on Jan 4, 2018 491 | * NEW git deps 492 | * NEW Updated -Spom to include repositories in the pom 493 | * 1.9.0.273 on Dec 8, 2017 494 | * Initial release for 1.9 495 | --------------------------------------------------------------------------------