       :license     {"Eclipse Public License"
                     "http://www.eclipse.org/legal/epl-v10.html"}}
  ;; This might not be generally warranted.
- ;; Then again...it seems like it only matters for "real" releases.
  push {:ensure-branch nil})
 
 (require '[adzerk.bootlaces :refer [bootlaces! build-jar push-snapshot push-release]]

  "Publish"
  []
  (comp (set-version) (javac) (build-jar) (push-release)))

(deftask from-snapshot
  "Allow publishing a snapshot version"
  ;; TODO: Split this into 2 tasks.
  ;; One to wrap, pushing/popping options without updating the
  ;; fileset.
  ;; The other should do the actual changes in the pipeline
  []

  (let [old-version (deduce-version-from-git)
        version (str old-version "-SNAPSHOT")
        ;old-pom-options pom
        old-push-options push
        ]
    (comp
     ;; Q: Should fileset be a vector like this?
     ;; (it doesn't seem to make any difference. I've seen examples
     ;; both ways)
     (with-pre-wrap fileset
       (println "Setting bootlaces to publish version" version)
       ;; Note that this is really just setting the options to
       ;; push, which is part of boot.task.built-in.
       ;; Actually, the bootlaces task is just a wrapper around
       ;; that.
       (task-options! )
       ;(task-options! pom {:version version})
       (bootlaces! version :dont-modify-paths? true)
       fileset)
     (with-post-wrap fileset
       (bootlaces! old-version :dont-modify-paths? true)
       ;(task-options! pom old-pom-options)
       (task-options! push old-push-options)))))

(deftask run
  "Run the project."
  [f file FILENAME #{str} "Application arguments passed to main."]
  ;; This is a leftover template from another project that I
  ;; really just copy/pasted over.
  ;; Q: Does it make any sense to keep it around?
  (require '[frereth-cp.server :as app])
  (apply (resolve 'app/-main) file))


(def default-version
  "Really just for running inside docker w/out git tags"
  "0.0.4-???-dirty")

(defn deduce-version-from-git
  "Avoid another decade of pointless, unnecessary and error-prone
  fiddling with version labels in source code.
