This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-21
Channels
- # beginners (38)
- # boot (88)
- # cljs-dev (142)
- # cljsrn (2)
- # clojars (1)
- # clojure (107)
- # clojure-berlin (2)
- # clojure-italy (8)
- # clojure-russia (76)
- # clojure-spec (325)
- # clojure-taiwan (3)
- # clojure-uk (28)
- # clojurescript (80)
- # clojurewest (2)
- # core-async (36)
- # core-logic (1)
- # cursive (21)
- # datomic (16)
- # dirac (18)
- # docs (2)
- # emacs (1)
- # euroclojure (3)
- # garden (3)
- # gsoc (2)
- # hoplon (3)
- # immutant (4)
- # jobs-discuss (16)
- # lein-figwheel (5)
- # liberator (17)
- # lumo (19)
- # off-topic (2)
- # om (20)
- # onyx (28)
- # pedestal (50)
- # planck (4)
- # re-frame (5)
- # reagent (3)
- # ring-swagger (13)
- # spacemacs (1)
- # specter (43)
- # testing (3)
- # timbre (3)
- # uncomplicate (1)
- # vim (2)
- # yada (4)
@mobileink sadly it seems it does… try running boot repl watch
then once you're in the repl you can do boot.user=> (def p (future (boot (watch) (doit))))
I guess my mistake was to try to run everything in one repl process, thought of making it easier for others
btw, I think I asked this before, but now I don’t remember the correct answer: what’s the difference between (comp (watch) (dev))
and (comp (watch) (boot (dev)))
?
for some reason if I don’t wrap it in boot
like this:
(deftask start []
(comp
(repl :server true)
(watch :verbose true)
(boot (dev))))
I would end up having 4 repls in CIDERyeah, sometimes I end up with 4 repls (instead of 2 in CIDER). I’m gonna try to throw wait
with -t in front of dev
nope, still getting 4 repls in CIDER when I do cider-jack-in-clojurescript
with cider-boot-parameters
set to “start"
removing (repl) did the trick:
(deftask start []
(comp
(watch :verbose true)
(dev)))
but now for some reason it does things twice - compiles cljs two times, two times notifies, etc.What is the equivalent of this in Boot? (.exists (io/file <filename>))
I'm just trying to check to see if file exists. To give full context I am bootifying this Gist. https://gist.github.com/rauhs/ac6349dd20f1799982a1906f9a59e7d6
ok. I probably just have the file in the wrong area in the file structure then.
Does it need to be inside a task to check?
How do I get to the filest inside the repl?
(show :fileset)
is what the only thing I can think of. but it's also asking for a value to be supplied.
I'm trying to use the repl so I can fish around the fileset or whatever I need to be looking at to find where the file is.
heist
So I did a boot dev show -f
in one terminal. Then I booted up another terminal and ran boot repl
doing (.exists (
which was clearly at the top level of the fileset. It says false. I'm not quite sure how I can just reach into the fileset normally for basic reads without doing some tricky stuff with a task to dump the fileset in an atom. But then if I did that the referenced fileset for reading wouldn't stay in sync??
but of course whenever you call commit!
on a fileset in a task the underlying files change
Yea I've basically wrapped my head around doing tasks. Just modifying this Gist is seeming a bit more complicated than I expected.
Perhaps that was a bad example with the index.html
. It seems to be a clj
file that he used as a dump for an atom with all teh styles.
Ah yes that's probably the way for me to go.
The main part I am looking at is
(def db-file
"The db will receive e a dump of the styles-atom below. This is needed
since otherwise the styler would lose previously generated styles when figwheel
restarts.
Give it the special name \"false\" to disable dumping the db."
(or (System/getProperty "styler.db") "vbn/cache/styler-db.clj"))
and then.
(def styles-atom (atom
(if (and (not mem-only?) (.exists (io/file db-file)))
(do
(println "Loading db-file: " db-file)
(read-string (slurp db-file)))
(do
(println "Couldn't find file (or mem-only): " db-file)
{}))))
The rest of the file spitting throughout the code I think I can manage myself.
I'm also not sure what is happening with the System/getProperty
without there being anyway for it to be set. But for the moment I just want to get the new Gist working in Boot as it should stop me having to restart boot almost every style change due to the munging the class names.Having trouble seeing how to pick apart the atom with tasks.
Ok. I think I will hit the hammock for my poor head a little bit and come back to this in half an hour. Then start picking it apart with some tasks and see how I go 🙂
Doubt 1: Can someone explain the use of :asset-paths in the boot environment? boot.user=> (get-env :asset-paths "none") gives "#{}"
https://github.com/boot-clj/boot/wiki/Filesets explains the different filesets & their purposes
Doubt 2: What tasks are typically performed in pre-processing and post-processing in a user-defined task?
hey guys, is there any way to compile java sources using boot? I have a mix of clojure & java stuff in the same project and I'm wondering how to build it all.
@michal there’s a javac
task that should help with that 🙂
@martinklepsch thanks, I just found Alan's sample repository which makes use of this task.
Hey folks, does anyone know about a sub-reddit for boot? If there isn't any, how about starting one?
there is http://hoplon.discoursehosting.net/ but it's pretty low traffic
and... not specific to boot
i think github broke our readme with their new markdown parser 😦
is there an easy way to determine the type of a tmpfile? i.e. source/resource? i’m building some boot tasks that transform files in the fileset which may be of different types, and i don’t want to change the type of the files. i don’t see how to find the type of a tmpfile tho. i also don’t see how to get a list of just resource or source files, only input files.
https://github.com/boot-clj/boot/wiki/Filesets#fileset-components input role = sources and resources
@esp1 you can use set operations, like this: resource_files = intersection(input_files, output_files)
And this is necessary because tmp-files don't know their types, only if they have input/output role
actually tmp files don’t even know what role they are in, which is the problem. only tmp dirs know their roles
right
i’m thinking it’d be useful to have a source-files
fn to list just the source files, or a resource-files
fn to list just the resource files. i could make one using the set ops like you said, but it seems like it’d be nicer and more performant to have dedicated methods for these that use get-files
under the covers, or if the get-files
fn were exposed so i could make them myself
@esp1 you mean like transform an xml file into another xml file? if you're translating an input file to an output file, you're creating a new file, "changing the type" is not meaningful, because of inmutability. you want to preserve the type thru the xform?
@esp1 get-dirs + get-files is ~8 lines of code, you can copy them to your codebase and modify so that it supports selecting source and resource files
probably the performance difference between this and set operations is quite small
howsabout a new core fn, exclusive filter? e.g. (filter-fs :in fileset) returns source-path stuff, (filter-fs :inout fileset) returns resource-path stuff. etc.
Perhaps, I've been thinking about similar tasks which would preserve the role. But this won't happen right away so if one needs this now, they way is to copy functions or use set operations.