From 415c8156ec59da0e8532fae3b2664fc893e62584 Mon Sep 17 00:00:00 2001 From: oakes Date: Sat, 23 Mar 2019 15:14:49 -0600 Subject: [PATCH] Improve read-deps-edn fn and change target dir --- deps.edn | 2 +- {target => dev-resources}/.gitignore | 0 dev.cljs.edn | 4 ++-- prod.clj | 16 ++++++++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) rename {target => dev-resources}/.gitignore (100%) diff --git a/deps.edn b/deps.edn index e312e7d..2acd7e6 100644 --- a/deps.edn +++ b/deps.edn @@ -4,5 +4,5 @@ dynadoc {:mvn/version "RELEASE"} com.bhauman/figwheel-main {:mvn/version "0.2.0"} orchestra {:mvn/version "2018.12.06-2"}} - :extra-paths ["target"]} + :extra-paths ["dev-resources"]} :prod {:extra-deps {leiningen {:mvn/version "2.9.0"}}}}} diff --git a/target/.gitignore b/dev-resources/.gitignore similarity index 100% rename from target/.gitignore rename to dev-resources/.gitignore diff --git a/dev.cljs.edn b/dev.cljs.edn index b6f28c1..18a19e1 100644 --- a/dev.cljs.edn +++ b/dev.cljs.edn @@ -1,5 +1,5 @@ {:main iglu.dev :optimizations :none - :output-to "target/dynadoc-extend/main.js" - :output-dir "target/dynadoc-extend/main.out" + :output-to "dev-resources/dynadoc-extend/main.js" + :output-dir "dev-resources/dynadoc-extend/main.out" :asset-path "/main.out"} diff --git a/prod.clj b/prod.clj index 6b77bc6..a63079f 100644 --- a/prod.clj +++ b/prod.clj @@ -1,4 +1,5 @@ (require + '[clojure.string :as str] '[leiningen.core.project :as p :refer [defproject]] '[leiningen.install :refer [install]] '[leiningen.deploy :refer [deploy]]) @@ -22,14 +23,25 @@ vals (mapcat :extra-deps) (into deps) + (map (fn parse-coord [coord] + (let [[artifact info] coord + s (str artifact)] + (if-let [i (str/index-of s "$")] + [(symbol (subs s 0 i)) + (assoc info :classifier (subs s (inc i)))] + coord)))) (reduce (fn [deps [artifact info]] (if-let [version (:mvn/version info)] (conj deps (transduce cat conj [artifact version] - (select-keys info [:scope :exclusions]))) + (select-keys info [:exclusions :classifier]))) deps)) - []))] + [])) + paths (->> (select-keys aliases aliases-to-include) + vals + (mapcat :extra-paths) + (into paths))] {:dependencies deps :source-paths [] :resource-paths paths}))