Skip to content

Commit

Permalink
fix changelog merge
Browse files Browse the repository at this point in the history
  • Loading branch information
puredanger committed Jul 12, 2024
2 parents 8f51ce3 + 5d4d360 commit cd3a7fd
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Changelog
===========

* v0.10.4
* v0.10.5
* compile-clj - fix ordering of namespaces not included in topo sort
* v0.10.3 15ead66 on May, 2024
* v0.10.4 31388ff on Jun 8, 2024
* uber, jar, zip - TBUILD-42 Use buffered output streams everywhere
* v0.10.3 15ead66 on May 1, 2024
* compile-clj - add simple spec for :basis arg
* v0.10.1 5e3b8f3 on Apr 28, 2024
* Update deps to latest
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Latest release:
As a git dep:

```clojure
io.github.clojure/tools.build {:git/tag "v0.10.3" :git/sha "15ead66"}
io.github.clojure/tools.build {:git/tag "v0.10.4" :git/sha "31388ff"}
```

As a Maven dep:

```clojure
io.github.clojure/tools.build {:mvn/version "0.10.3"}
io.github.clojure/tools.build {:mvn/version "0.10.4"}
```

# Developer Information
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.github.clojure</groupId>
<artifactId>tools.build</artifactId>
<version>0.10.4-SNAPSHOT</version>
<version>0.10.5-SNAPSHOT</version>
<name>tools.build</name>

<parent>
Expand Down
4 changes: 2 additions & 2 deletions src/main/clojure/clojure/tools/build/tasks/jar.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

(ns clojure.tools.build.tasks.jar
(:require
[clojure.java.io :as jio]
[clojure.tools.build.api :as api]
[clojure.tools.build.util.file :as file]
[clojure.tools.build.util.zip :as zip]
[clojure.string :as str])
(:import
[java.io FileOutputStream]
[java.util.jar Manifest JarOutputStream]))

(defn jar
Expand All @@ -31,5 +31,5 @@
"Build-Jdk-Spec" (System/getProperty "java.specification.version")}
main (assoc "Main-Class" (str/replace (str main) \- \_)))
mf-attr-strs))
(with-open [jos (JarOutputStream. (FileOutputStream. jar-file) manifest)]
(with-open [jos (JarOutputStream. (jio/output-stream jar-file) manifest)]
(zip/copy-to-zip jos class-dir-file)))))
13 changes: 6 additions & 7 deletions src/main/clojure/clojure/tools/build/tasks/uber.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
[clojure.tools.build.util.file :as file]
[clojure.tools.build.util.zip :as zip])
(:import
[java.io File InputStream FileInputStream BufferedInputStream IOException
OutputStream FileOutputStream BufferedOutputStream ByteArrayOutputStream]
[java.io File InputStream IOException OutputStream ByteArrayOutputStream]
[java.nio.file Files]
[java.nio.file.attribute FileAttribute FileTime]
[java.util.jar JarEntry JarInputStream JarOutputStream Manifest]))
Expand Down Expand Up @@ -111,7 +110,7 @@
out-file (jio/file out-dir path)]
(if string
(spit out-file string :append ^boolean append)
(copy-stream! ^InputStream stream (BufferedOutputStream. (FileOutputStream. out-file ^boolean append)) buffer))
(copy-stream! ^InputStream stream (jio/output-stream out-file :append append) buffer))
(Files/setLastModifiedTime (.toPath out-file) last-modified-time)))

(defn- handle-conflict
Expand Down Expand Up @@ -158,7 +157,7 @@
;; write new file, parent dir exists for writing
(ensure-dir (.getParentFile out-file) out-file)
(do
(copy-stream! ^InputStream is (BufferedOutputStream. (FileOutputStream. out-file)) buffer)
(copy-stream! ^InputStream is (jio/output-stream out-file) buffer)
(Files/setLastModifiedTime (.toPath out-file) last-modified-time)
state)

Expand All @@ -173,7 +172,7 @@
state

(str/ends-with? (.getPath lib-file) ".jar")
(with-open [jis (JarInputStream. (BufferedInputStream. (FileInputStream. lib-file)))]
(with-open [jis (JarInputStream. (jio/input-stream lib-file))]
(loop [the-state state]
(if-let [entry (.getNextJarEntry jis)]
(let [path (.getName entry)
Expand Down Expand Up @@ -297,7 +296,7 @@
(.exists (jio/file working-dir "META-INF" "versions")) (assoc "Multi-Release" "true"))
mf-attr-strs))
(file/ensure-dir (.getParent uber-file))
(with-open [jos (JarOutputStream. (FileOutputStream. uber-file) manifest)]
(with-open [jos (JarOutputStream. (jio/output-stream uber-file) manifest)]
(zip/copy-to-zip jos working-dir)))
(finally
(file/delete working-dir)))))
(file/delete working-dir)))))
6 changes: 3 additions & 3 deletions src/main/clojure/clojure/tools/build/tasks/zip.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

(ns clojure.tools.build.tasks.zip
(:require
[clojure.java.io :as jio]
[clojure.tools.build.api :as api]
[clojure.tools.build.util.file :as file]
[clojure.tools.build.util.zip :as zip])
(:import
[java.io FileOutputStream]
[java.util.zip ZipOutputStream]))

(set! *warn-on-reflection* true)
Expand All @@ -21,7 +21,7 @@
[{:keys [src-dirs zip-file] :as params}]
(let [zip-file (api/resolve-path zip-file)]
(file/ensure-dir (.getParent zip-file))
(with-open [zos (ZipOutputStream. (FileOutputStream. zip-file))]
(with-open [zos (ZipOutputStream. (jio/output-stream zip-file))]
(doseq [zpath src-dirs]
(let [zip-from (file/ensure-dir (api/resolve-path zpath))]
;(println "Zipping from" (.getPath zip-from) "to" (.getPath zip-file))
Expand All @@ -32,4 +32,4 @@
(let [{:keys [zip-file target-dir]} params
ret (zip/unzip (api/resolve-path zip-file) (api/resolve-path target-dir))]
(when-not ret
(throw (ex-info (format "Zip file does not exist: %s" zip-file) {})))))
(throw (ex-info (format "Zip file does not exist: %s" zip-file) {})))))
11 changes: 5 additions & 6 deletions src/main/clojure/clojure/tools/build/util/zip.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
[clojure.tools.build.util.file :as file]
[clojure.string :as str])
(:import
[java.io File InputStream BufferedInputStream FileInputStream
OutputStream BufferedOutputStream FileOutputStream]
[java.io File InputStream OutputStream]
[java.nio.file Files LinkOption]
[java.nio.file.attribute BasicFileAttributes]
[java.util.zip ZipFile ZipInputStream ZipOutputStream ZipEntry]
Expand All @@ -33,7 +32,7 @@
(.setLastModifiedTime (.lastModifiedTime attrs)))]
(.putNextEntry output-stream entry)
(when-not dir
(with-open [fis (BufferedInputStream. (FileInputStream. file))]
(with-open [fis (jio/input-stream file)]
(jio/copy fis output-stream)))

(.closeEntry output-stream)))
Expand Down Expand Up @@ -84,17 +83,17 @@

(defn unzip
[^String zip-path ^String target-dir]
(let [buffer (byte-array 1024)
(let [buffer (byte-array 4096)
zip-file (jio/file zip-path)]
(if (.exists zip-file)
(with-open [zis (ZipInputStream. (BufferedInputStream. (FileInputStream. zip-file)))]
(with-open [zis (ZipInputStream. (jio/input-stream zip-file))]
(loop []
(if-let [entry (.getNextEntry zis)]
;(println "entry:" (.getName entry) (.isDirectory entry))
(let [out-file (jio/file target-dir (.getName entry))]
(jio/make-parents out-file)
(when-not (.isDirectory entry)
(with-open [output (BufferedOutputStream. (FileOutputStream. out-file))]
(with-open [output (jio/output-stream out-file)]
(copy-stream! zis output buffer)
(Files/setLastModifiedTime (.toPath out-file) (.getLastModifiedTime entry))))
(recur))
Expand Down

0 comments on commit cd3a7fd

Please sign in to comment.