Skip to content

Commit

Permalink
(PE-37713) Remove useless copy of additional directory to resources dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rileynewton committed Jun 10, 2024
1 parent 4ea92de commit add0017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
## [Unreleased]

## [2.6.1]
* Complete the ability to add a resources directory to a project with :include-dir by copying the resources to the staging directory.
* Fix the ability to add a resources directory to a project with :include-dir by copying the resources to the staging directory directly.

## [2.6.0]
* Add the ability to add a directory for project resources (such as build templates) by specifying the :include-dir option under {:lein-ezbake {:resources :include-dir "resources"}}.
Expand Down
27 changes: 2 additions & 25 deletions src/leiningen/ezbake_core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@
jar-file-path resource-path))
(deputils/cp-files-from-jar jar-entries jar-file resource-path)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Resource Directory Type Helpers
(defn copy-dir [src-dir dest-dir]
(let [src (io/file src-dir)
dest (io/file dest-dir)]
(if (.exists src)
(if (.isDirectory src)
(do
(.mkdirs dest)
(doseq [file (.listFiles src)]
(copy-dir (.getPath file) (str (io/file dest (.getName file))))))
(do
(lein-main/info (format "Copying lein-ezbake resources from included directory: %s to %s."
src-dir dest-dir))
(io/copy src dest)))
(throw (RuntimeException. (format "Resource directory %s does not exist." (str src-dir)))))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Consumable API

Expand All @@ -63,15 +46,9 @@
(let [template-type (get-in project [:lein-ezbake
:resources
:type]
:jar)
include-resource-dir (get-in project [:lein-ezbake
:resources
:include-dir]
nil)]
:jar)]
(case template-type
:git (throw (RuntimeException.
(format "Resource type, %s, not implemented."
(str template-type))))
:jar (copy-jar-resources core/resource-prefix core/resource-path))
(when (some? include-resource-dir)
(copy-dir include-resource-dir core/resource-path))))
:jar (copy-jar-resources core/resource-prefix core/resource-path))))

0 comments on commit add0017

Please sign in to comment.