                      :dev   {:dependencies [[clj-stacktrace                  "0.2.8"]
                                             [figwheel                        "0.2.2-SNAPSHOT"]
                                             [spellhouse/clairvoyant          "0.0-48-gf5e59d3"]]
-                             :plugins      [[lein-cljsbuild                  "1.0.4"]             ;; previously 1.0.4, 1.0.4-SNAPSHOT was in a state of flux
+                             :plugins      [[lein-cljsbuild                  "1.0.4"]
                                             [lein-figwheel                   "0.2.2-SNAPSHOT"]
                                             [lein-shell                      "0.4.0"]
                                             [com.cemerick/clojurescript.test "0.3.3"]]}}

  :figwheel         {:css-dirs ["run/resources/public/resources/css"]
                     :repl     true}

  :shell            {:commands {"runurl"      {:windows ["cmd" "/c" "start"]
                                               :linux   "xdg-open"}
                                }}

  :aliases          {;; *** DEMO ***
                     ;"build"          ["do"
                     ;                  ["clean"]
                     ;                  ;["figwheel" "demo"]         ;; Moved to debug below
                     ;                  ["cljsbuild" "once" "demo"]
                     ;                  ]

                     "run"            ["shell" "cmd" "/c" "start" "" "http://localhost:3449/index.html"] ;; TODO: Could report this as issue
                     "run-linux"      ["shell" "xdg-open" "http://localhost:3449/index.html"]

                     ;; TODO: Remove experiments
                     ;"run2"           ["shell" "runurl" "/c" "start" "http://localhost:3449/index.html"]
                     ;"run3"           ["shell" "runurl" "runurl-arg1" "runurl-arg2" "http://localhost:3449/index.html"]

                     ;"run-cb"         ["shell" "cmd" "/c" "start" "run/resources/public/index.html"]
                     ;"run-cb-linux"   ["shell" "xdg-open" "run/resources/public/index.html"]

                     "debug"          ["figwheel" "demo"]
                     ;"debug-cb"       ["cljsbuild" "auto" "demo"]

                     "build"           ["do"                ;; TODO: Linux version required
                                       ["clean"]
                                       ["run"]              ;; NOTE: run will initially fail, refresh browser once build complete
                                       ["debug"]]

                     ;"build-debug-cb" ["do"                 ;; TODO: Linux version required
                     ;                  ["build"]
                     ;                  ["run-cb"]
                     ;                  ["debug-cb"]]

                     ;; *** TEST - CLJSBUILD ***
                     "build-test"     ["do"
                                       ["clean"]
                                       ["cljsbuild" "once" "test"]]

                     "run-test"       ["shell" "cmd" "/c" "start" "run/resources/public/test.html"]
                     "run-test-linux" ["shell" "xdg-open" "run/resources/public/test.html"]

                     "debug-test"     ["cljsbuild" "auto" "test"]

                     "test"           ["do"                 ;; TODO: Linux version required
                                       ["build-test"]
                                       ["run-test"]
                                       ["debug-test"]]

                     ;; *** OTHERS ***
                     "build-all"      ["do"
                                       ["clean"]
                                       ["cljsbuild" "once"]]

                     "run-all"        ["do"                 ;; TODO: Linux version required
                                       ["run"]
                                       ["run-test"]]

                     "the-works"      ["do"
                                       ["build-all"]
                                       ["run-all"]
                                       ["debug"]
                                       ;["debug-test"]       ;; This command would only start running on exit from the above command (which is a loop)
                                       ]
                     }
  )

(require 'leiningen.core.eval)

(def os         (leiningen.core.eval/get-os))
(def server-url "http://localhost:3449/index.html")
(def file-url   "run/resources/public/index.html")
(def test-url   "run/resources/public/test.html")

(def command-lookups
  "Per os native commands"
  {"launch-server-url"     {:windows ["shell" "cmd" "/c" "start" server-url]
                            :macosx  ["shell" "open"             server-url]
                            :linux   ["shell" "xdg-open"         server-url]}

   "launch-file-url"       {:windows ["shell" "cmd" "/c" "start" file-url]
                            :macosx  ["shell" "open"             file-url]
                            :linux   ["shell" "xdg-open"         file-url]}

   "launch-test-url"       {:windows ["shell" "cmd" "/c" "start" test-url]
                            :linux   ["shell" "xdg-open"         test-url]
                            :macosx  ["shell" "open"             test-url]}})

(defn get-command-for-os
      "Return the os-dependent command"
      [cmd]
      (get-in command-lookups [cmd os]))

;; ---------------------------------------------------------------------------------------

(defproject         re-com "0.1.6"
  :description      "Reusable UI components for Reagent"
  :url              "https://github.com/Day8/re-com.git"

  :dependencies     [[org.clojure/clojure         "1.6.0"]
                     [org.clojure/clojurescript   "0.0-2665"]
                     [org.clojure/core.async      "0.1.346.0-17112a-alpha"]
                     [alandipert/storage-atom     "1.2.3"]
                     [reagent                     "0.5.0-alpha"]
                     [com.andrewmcveigh/cljs-time "0.3.0"]]

  ;:plugins          [[lein-unpack-resources "0.1.1"]]
