Skip to content

Commit

Permalink
Target task should fall back to copying when hardlinks not possible
Browse files Browse the repository at this point in the history
- Fixes #373
  • Loading branch information
micha committed Dec 31, 2015
1 parent dd86f88 commit 150fb50
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changes

## 2.5.4

#### Fixed

- The `target` task falls back to copying when hardlinks aren't possible
[#373][373].
- Use a `ByteArrayInputStream` instead of a `StringBufferInputStream` when
parsing `pom.xml` strings.

[373]: https://github.com/boot-clj/boot/issues/373

## 2.5.3

#### Improved
Expand Down
5 changes: 4 additions & 1 deletion boot/core/src/boot/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,10 @@
(fn [fs & {:keys [link]}]
(let [link (when link :tmp)
[a b] [@prev (reset! prev (output-fileset fs))]]
(mapv deref (for [d @dirs] (future (fs/patch! (fs/mkfs d) a b :link link))))))))
(doseq [d @dirs :let [p! (partial fs/patch! (fs/mkfs d) a b :link)]]
(future (try (p! link)
(catch Throwable t
(if-not link (throw t) (p! nil))))))))))

(defn- run-tasks
"Given a task pipeline, builds the initial fileset, sets the initial build
Expand Down
4 changes: 2 additions & 2 deletions boot/worker/src/boot/pom.clj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[clojure.data.zip.xml :refer [attr text xml-> xml1->]])
(:import
[java.util Properties]
[java.io StringBufferInputStream]
[java.io ByteArrayInputStream]
[java.util.jar JarEntry JarOutputStream]))

;;; elements ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand All @@ -25,7 +25,7 @@
;;; private ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn pom-xml-parse-string [xml-str]
(let [z (-> xml-str StringBufferInputStream. parse xml-zip)
(let [z (-> xml-str .getBytes ByteArrayInputStream. parse xml-zip)
gid (util/guard (xml1-> z :groupId text))
aid (util/guard (xml1-> z :artifactId text))]
{:project (util/guard (if (= gid aid) (symbol aid) (symbol gid aid)))
Expand Down

0 comments on commit 150fb50

Please sign in to comment.