This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-12-18
Channels
- # admin-announcements (12)
- # adventofcode (2)
- # beginners (10)
- # boot (340)
- # cljs-dev (1)
- # cljsrn (30)
- # clojure (79)
- # clojure-germany (4)
- # clojure-japan (4)
- # clojure-nl (2)
- # clojure-russia (141)
- # clojurescript (125)
- # core-async (9)
- # datascript (2)
- # datavis (8)
- # datomic (9)
- # editors (5)
- # editors-rus (4)
- # hoplon (69)
- # ldnclj (63)
- # off-topic (1)
- # om (291)
- # parinfer (7)
- # portland-or (3)
- # proton (248)
- # rdf (3)
- # re-frame (14)
- # remote-jobs (4)
Hmm, so I created seancorfield/boot-expectations by copying bits of boot-test (thank you!). And I ran boot pom jar install
and it seems to have put an appropriate JAR file into my local .m2/repository
. I can add it as a dependency to my scratch project's build.boot
and I get no errors when I do boot repl
but as soon as I add a require
for it, I get an error that boot_expectations.clj
can't be found... I must be doing something stupid but I can't see it 😞
Here's what I have in my build.boot
file in the scratch project: `
Bah, don't have Slack configured right
(set-env!
:resource-paths #{"src"}
:source-paths #{"test"}
:dependencies '[[org.clojure/clojure "1.8.0-RC4"]
[seancorfield/boot-expectations "0.1.0-SNAPSHOT" :scope "test"]])
(require '[seancorfield/boot-expectations :refer :all])
And I thought my ns
was right in boot_expectations.clj
:
(ns seancorfield.boot-expectations
{:boot/export-tasks true}
(:require [boot.core :as core]
[boot.pod :as pod]))
looks like (require '[seancorfield/boot-expectations :refer :all]) should be (require '[seancorfield.boot-expectations :refer :all])
(happens to me frequently also!)
btw is today only your first day of booting and you made a test task? i think this is a new record, congrats 🏆 😄
@seancorfield: the testsare run in a separate pod, remember
if you're in the repl and you want to run tests you can do that also, but directly via clojure.test
how is incremental compile time in boot-cljs compared to cljsbuild these days, anyone have recent experience with both?
Argh! I can't believe I got that wrong again...
I'm so not used to having a require that isn't in ns
that I just don't make the right mental shift, esp. when I'm writing dependencies in code as well instead of a project map!
@seancorfield: You're doing great. Nice task you wrote there. Mental shift will follow by itself.
Thanks @danielsz ! Also thanks to @alandipert for spotting my stupid mistake!
I pushed it to GitHub here: https://github.com/seancorfield/boot-expectations
I'll get it up on Clojars "soon", once I've figured out boot push
(that will likely be easier on OS X than Windows)
@seancorfield: Guidelines for boot push
can be found here: https://github.com/boot-clj/boot/wiki/Repository-Credentials-and-Deploying
@danielsz: Followed those instructions and I get missing jar file or repo not found...
Presumably some additional options need to be set that are not shown on that page?
oh sorry, you need to make the jar too, boot doesn't keep any state between invocations
@seancorfield: If upgrading boot doesn't fix it, please git push your build.boot to the github repo so we can look at it.
@seancorfield: Also, you can look at a working build.boot to see what you need. Here's one: https://github.com/danielsz/boot-runit/blob/master/build.boot
So boot jar push
? Or boot pom jar push
?
What set of tasks are needed to push
then?
I tried boot pom jar install push
and still get that message
I assume I'd want my Clojars credentials in project.boot
and then .gitignore
that?
The build.boot
file is up in that repo: https://github.com/seancorfield/boot-expectations/blob/master/build.boot
I read that and followed the instructions.
Here's the project.boot
file (with credentials xxx'd):
(task-options! push {:repo "clojars"})
(set-env! :repositories [["clojars" {:url " "
:username ""
:password "xxxx"}]])
That's following the wiki page.
Hah, stupid attacks again!
So why is the project-specific boot file called profile.boot
?
Well, having the global one be profile.boot
makes sense...
I read the docs and my brain said "Ah, project.boot
! That makes sense!"
Hopefully I'll only make that mistake twice
(hey, I made the /
/ .
mistake twice in 24 hours!)
you can put (when (.exists (io/file "project.boot")) (load-file "project.boot"))
in your global profile.boot
...
OK, I'll consider Day 2 with Boot to be successful as well. Thank you!
Done!
And now I'm off for dinner with my wife (she got home from surgery yesterday so I've been on vacation looking after her).
good work, @seancorfield, and good recovery to your wife.
Thanks. She's doing really well. Full hysterectomy on Monday, home Wednesday, staples out Friday. Much faster than we expected!
@seancorfield: btw your lein frege plugin is pretty ripe for a boot task! i've only dabbled with langs like that but i did make a task for one, https://github.com/alandipert/boot-yeti/tree/master/example
found ML more palatable with a live reload dev flow
Does Boot have the equivalent of Leiningen's templates?
with boot we think there is a way to make composable templates, but work hasn't really progressed there
so other than that there isn't much to gain that isn't already working fine in lein templates
In response to Alan's comment, it would be weird to have a Leiningen template for a Frege project that then expected you to use Boot to build/run it
But I will say that I suspect a Boot task for Frege would be a lot easier to write than the Leiningen plugin for it...
it might be worthwhile to wrap the lein templates implementation in a boot task for that reason
@seancorfield: clearly what we need is a lein template... that also installs boot for you
@micha: You'd need it to be a built-in so once you have Boot installed, you could just say boot new mytemplate myapp
it wouldn't necessarily need to be built in... since deps with tasks in them can be added at the cli... at least if it's brevity we're optimizing for
boot -d boot/new -t mytemplate -a myapp
Ah, good point. Still haven't gotten used to that aspect of Boot yet
So it would need to be a version of lein-new
that looks for {name}/boot-template
...
(although I guess it could look for both?)
or perhaps it uses lein templates, by running lein core in a pod
So we might have a world with {name}/boot-template
and {name}/lein-template
and either/both could generate projects with project.clj
and/or build.boot
... that's certainly an interesting possibility.
Hi. Is there any quick documentation for filesets?
thanks @micha!
What I want to achieve is basically a TDD loop, or even more general thing like this: 1. Read arguments and prepare stuff, remember obtained data (call this "data") 2. On each file change (I'll be changing one data structure [call this "grammar"] which affects the results): 2.1 Apply "grammar" to "data" 2.2 Obtain (say, print out) the results
Operation (1) takes time (so does the (2.1) also in fact), and I don't want (1) to be run each time I change files
@micha: When that Filesets page talks about Jcp, it says it's the immutable classpath, but it seems like you can (set-env! :dependencies fn-that-adds-new-libs)
so the Jcp can differ before and after a task?
Am I misunderstanding what the page means?
(I notice it also talks about emitting files to the target directory -- which I guess is deprecated now?)
@andrewboltachev: tasks can have maintain state over multiple runs. Take a look at the tasks page, I think there is an example like that
ok thanks @martinklepsch Reading docs from beginning to end now
@andrewboltachev: just checked, there seems to be no such example
@andrewboltachev: one option is you have state in the namespace as done here: https://github.com/martinklepsch/boot-garden/blob/master/src/org/martinklepsch/boot_garden.clj#L9
@andrewboltachev: the alternative is to put it inside a let
that closes over with-pre-wrap
or the likes as done here: https://github.com/adzerk-oss/boot-cljs/blob/master/src/adzerk/boot_cljs.clj#L196
thanks @martinklepsch I'll check it out
Has anyone gotten boot to work with travis? I'm trying to set it up for my project, but the process gets killed while fetching boot dependencies.. I'm guessing due to resource usage.
@shwx84: are there no reasons provided by travis?
Here is the full commands / output if it is helpful: https://travis-ci.org/wicdmedia/halcyon
saw that boot-cljs-example used oraclejdk8, so I switched to that. Looks like that solved the problem
or perhaps just bad luck. Tried the old build for the third time, and it works now too.
@seancorfield: J_cp is called the "immutable classpath" there, but i guess it should really say "append only" or something
Java considers any jar on the classpath to be immutable, and you can't remove jars from a classloader
so if you go in and modify a jar that's already loaded into a classloader one of two things will happen: either the jar contents have already been read and cached and the modification will have no effect on the running JVM, or the JVM will segfault
@nha: the best way is to make a pod and add the dependency to the pod's environment when you create it
@nha: https://github.com/adzerk-oss/boot-template/blob/master/src/adzerk/boot_template.clj#L33-L36
Just make a cljs.edn
file under an appropriate path - https://github.com/adzerk-oss/boot-cljs#multiple-builds
Well, I guess it's just too obvious for people that are doing Clojure for a while that EDN is Clojure notation as a formalised file format and they didn't think it might not be.
Yeah, I can imagine; it's just that someone probably thought it's a thing an introduction to Clojure would talk about and didn't think to re-iterate that, like no-one would think to explain what a defn
is in a readme for a machine learning library for Clojure.
I need help with boot in windows. After downloading boot.exe and copying it on my c:\windows\system32 folder when I run boot -h
I got Error: Could not find or load main class boot.Loader
@robin: if it's your first time with Clojurescript, then maybe this could be helpful - https://github.com/magomimmo/modern-cljs/tree/master/doc/second-edition - walks you through creating a Clojurescript project with boot from A to Z.
@erlis: are you sure you're getting the right boot.exe
? like perhaps there is another one in your PATH
?
I've just recently learned there's where something
in Windows which is equivalent to which something
on nixes.
@magomimmo: yeah, it's a nice thing to be able to show people that start out with Clojure. Explaining how a build tool setup works step by step can be immensely helpful. I'm not entirely sold on introducing people to things like domina, but otherwise it's really solid.
Heh, I remember boot being a bit problematic to set up on Windows. I think it worked in the end, but not sure what had to be done.
I will be here for a while too! In lein, I would set :output-to somewhere in project.clj, but for boot Jaen adviced me to create a blah.cljs.edn somewhere, but what should contain in that file?
create a file at resources/public/assets/javascripts/application.cljs.edn
then you will get target/public/assets/javascripts/application.js
as your output.
copying the file into system32 will cause that file to be copied instead to a WOW64 folder and is not found, maybe the PATH doesn't contains that weird folder
@jaen: in 2012 domina was almost the only dom lib available. but in next tutorials I’ll show the react wrapper…my intention is to show react native as well
I’ve got an interesting issue with boot uber
in a current project. One dependency uses a folder for licenses (called license
), and others use LICENSE
with the text directly in it. boot uber
in 2.4.x used to issue a warning about an non-empty directory, but with 2.5 it is now erroring-out with java.nio.file.DirectoryNotEmptyException
What if I want the output to be somewhere completely elsewhere but still within the project?
@jaen: i really don’t know a bit about windows. I don’t even remember when it was the last time I used it at a customer site, something close to 20 years ago
But good job erlis, getting clojure working on windows, I can't even get things working properly on linux!
Well then, I guess I have to discard today's effort and move back to lein and figure out why my extern isn't working!
@magomimmo: yeah, I can understand why you chose domina originally, I'm just wondering if keeping it in a modern tutorial can be a bad idea, since it would suggest people it's a good way to create applications in Clojurescript, which it isn't. As for Windows - it wasn't directed at you, sorry for confusion.
@jaen: the only good thing of using domina in the tutorial, is that is pretty easy to understand and you can an idea about cljs without the complexities of other advanced features of the language
@robin: you can change the :target-path
(defaults to target/
)
(set-env! :target-path "static")
@robin: it's documented: https://github.com/boot-clj/boot/wiki/Boot-Environment#env-keys
@martinklepsch: wasn't there something about a target
task for > 2.5.0 menioned recently?
@jaen: yes. in the future the fileset will not be synced to a target dir by default but instead this will be handled by tasks
@jaen: but with 2.5.* the implicit target behavior is still present
@martinklepsch @micha Any thoughts about the uber
task problem I mentioned above? I don’t really care if all the tasks have embedded licenses in the jar I’m building anyway. I’d sift them out if I could
Ah so it is documented, what I really meant was, I googled for "boot cljs change target main.cljs" and got nothing direct.
@jgdavey: certainly sounds like something that should get fixed. Have you tried using the uber
tasks exclude option?
@robin: the js file will have the same name as the cljs.edn file
@robin: like I mentioned, do the cljs.edn
thing; your output will have the same name and relative path it has.
@jgdavey: be sure to copy the default from the docstring, I think otherwise it's reset
@jgdavey: sorry to bother, any thoughts about this - https://github.com/jgdavey/boot-middleman/issues/1?
@jgdavey: and probably good to log an issue
@jaen: while an out
option might be slightly more convenient this could also easily be achieved with sift
I think more people should know about/use sift
😛
@jgdavey: ok, let me push it. I imagine you want to keep "target/assets" as the default path?
I hadn’t considered configuring it from that side because middleman itself allows nested directories, but it’s a good idea
I got uber
to work. I had to change the default exclude on uber to add #"(?i)^META-INF/LICENSE$”
and #"(?i)^LICENSE$”
@robin: you have to require your main namespace there IIRC. Something like:
{:require [your.namespace]}
is probably the minimal example.@robin: take a look at the example in the readme, to be on the save side :require
should be specified
Also a good idea is to use :init-fns [your-namespace/your-init-fn!]
to call a function that initialises your application, but that is not required.
@robin: see the readme of boot-cljs
If your application has it's entry point at my.awesome-application.main
then you put that there.
@jgdavey: feel free to see if it's okay for you - https://github.com/jgdavey/boot-middleman/pull/2
Yeah, I can imagine how this can be a bit misleading. IMO showing that you can rely on an implicit cljs.edn
is probably a so-so idea.
@jaen: I agree about the implicit cljs.edn thing. I think we should transition to implicit + warning and explicit later
Thanks jaen and martin. Oh I also saw martin's video on youtube, that "lein new tenzing myproj" in the end really helped me to get boot going correctly.
@micha I think the docs should be updated to something like "copy the boot.exe to a folder on your PATH, i.e.: your %SystemRoot% folder."
very good, maybe you will be happy to hear that i'm inching towards ditching lein your competitor.
what I discovered is that system32 folder in 64 bits machine is not the folder I though it was. http://stackoverflow.com/a/1855051
Then 3 months later, it would be wrong! But at least you get a few cents in ad revenue.
Alright I'll stop messing about, I don't want to get banned. I appreciate all your help. I'll blog positive things.
just somewhere that google can crawl over. so people like me who treat google like siri can find answers
yeah, and perhaps either modify the default merge fn to check if the args are input streams or directories, and handle the logging in the mergefn?
@micha: wouldn't sift be useless in that case because the jars are all exploded during uber?