This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-06-30
Channels
- # admin-announcements (19)
- # announcements (4)
- # beginners (22)
- # boot (76)
- # cider (92)
- # clojure (235)
- # clojure-berlin (3)
- # clojure-germany (1)
- # clojure-italy (8)
- # clojure-japan (18)
- # clojure-russia (26)
- # clojure-sg (1)
- # clojure-uk (25)
- # clojurescript (55)
- # code-reviews (7)
- # core-async (53)
- # datomic (13)
- # euroclojure (63)
- # jobs (39)
- # ldnclj (45)
- # off-topic (9)
- # om (7)
- # onyx (6)
- # reading-clojure (1)
- # reagent (5)
- # yada (22)
Is there an idiomatic way to use pods? How many/few should I use? I’m writing an internal tool (equivalent to a lein plugin) with boot tasks, with 2 unrelated namespaces that have different deps/etc. Should each use a pod? Should the tool share a pod? Does it matter?
@andrewmcveigh: Yes, they should use pods. Doesn't matter much is they use separate or shared pod. If one odesn't depend on another, should be possible and good idea to use separate pods.
@juhoteperi: Thanks, I have them in 2 separate pods atm. They don’t depend on each other, but one task might need to call into both.
I guess I should just use whatever is simpler.
So now that 1.7 is official, is there any good resource/project that shows how migrate from cljx to cljc? Possibly with boot?
I’m not sure boot
is the cause, but I’ll ask here anyway 😛
I’m working on an app that uses the ptaoussanis/sente
and everything works fine until I add core.match
as a dependency. I don’t even need to use require it in any namespace. Just add the dependency.
@samflores: my guess is a dependency problem related to tools.analyzer, which is brought in by core.match directly and sente indirectly (through core.async)
@samflores: you could start with boot -d com.taoensso/sente:1.5.0 -d org.clojure/core.match:0.3.0-alpha4 show -p
to see the selections maven is making for you, and pick some tactical exclusions
@samflores: this appears to compute: (set-env! :dependencies '[[org.clojure/core.match "0.3.0-alpha4" :exclusions [org.clojure/tools.analyzer.jvm]] [com.taoensso/sente "1.5.0"]])
That was really a great tip. I’ve tried running boot show -p
in my project directory and got the same error. Didn’t remember I could run boot without a build.boot
and give it the parameters. 😄
haha no prob
From the context of a task, can I modify other tasks options? I'm trying to build a test task which alters the pom task's version using a version parsed from the git tag. (task-options! pom {:version version})
doesn't seem to be doing it... there's magic in the pom symbol that I haven't figured out yet.
I have four tightly coupled lein projects that are version controlled together. At present we use https://github.com/cvillecsteele/lein-git-version to coordinate versions across the subprojects. In evaluating boot I figured it'd be a good exercise to port that sort of task to boot.
(ns factual.boot-git-version
{:boot/export-tasks true}
(:refer-clojure :exclude [test])
(:require [boot.pod :as pod]
[boot.core :as core]
[ :as io]
[clojure.java.shell :refer [sh]]))
(defn get-git-version
[]
(->> (sh "git" "describe" "--match" "v*.*" "--abbrev=4" "--dirty=**DIRTY**")
:out
clojure.string/trim
rest
(apply str)))
(defn get-git-ref
[]
(->> (sh "git" "rev-parse" "--verify" "HEAD")
:out
clojure.string/trim
rest
(apply str)))
(core/deftask git-version
[v version-file bool "Create a version statement file."
p version-ns-prefix string "Namespace where the version defs will be written"]
(let [version (get-git-version)
ref (get-git-ref)]
;; If appropriate, build and install a version file
(when version-file
(let [temp-dir (core/tmp-dir!)
pname (name (get (core/get-env core/pom) :project))
temp-file (io/file temp-dir pname "version.clj")]
;; Write the file
(spit temp-file
(format
(str ";; Do not edit. Generated by factual/boot-git-version.\n"
"(ns %s)\n"
"(def version \"%s\")\n"
"(def gitref \"%s\")\n")
ns version ref))
;; Add it to the fileset
(core/with-pre-wrap fileset
(-> fileset
(core/add-source temp-dir)
(core/commit!)))))
;; Set the POM version
(task-options! core/pom {:version version})))
basically your task should return middleware that can be composed by the user into a pipeline
another thng you can do is if a task almost does what you want, but for some reason isn't compatible, you can just use the underlying functions that task uses
instead of having your task compute the path to the version.clj file, you can use file extensions for this
then in your task do (->> fileset core/input-files (core/by-name ["version.clj.edn"]))
to get the file
it could take that file and know the path to the generated file (i.e. remove the .edn extension or whatever)