This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-23
Channels
- # admin-announcements (1)
- # arachne (3)
- # aws (1)
- # bangalore-clj (2)
- # beginners (209)
- # boot (81)
- # capetown (2)
- # cider (16)
- # clara (13)
- # cljsjs (16)
- # cljsrn (6)
- # clojure (217)
- # clojure-czech (1)
- # clojure-greece (4)
- # clojure-italy (3)
- # clojure-korea (3)
- # clojure-russia (3)
- # clojure-sg (3)
- # clojure-spec (104)
- # clojure-uk (23)
- # clojurescript (7)
- # component (7)
- # cursive (18)
- # datomic (12)
- # devcards (34)
- # dirac (17)
- # editors (3)
- # emacs (1)
- # events (1)
- # hoplon (62)
- # immutant (12)
- # incanter (1)
- # jobs (1)
- # klipse (2)
- # ldnclj (1)
- # luminus (1)
- # mount (1)
- # off-topic (8)
- # om (50)
- # onyx (46)
- # parinfer (5)
- # pedestal (4)
- # perun (2)
- # reagent (1)
- # rum (1)
- # schema (5)
- # specter (30)
- # untangled (5)
- # vim (46)
ANN: I released a new boot library, boot-asset-fingerprint for adding cache-busting fingerprints to asset urls: https://github.com/AdamFrey/boot-asset-fingerprint
@adamfrey: bootiful!
Overdue overhaul on this little convenience task https://github.com/crisptrutski/boot-cljs-test
Particularly interested in hearing happy upgrade stories from users before I cut the release
Hi folks 👋 I’m having what seems to be a familiar issue with boot and loading resources (via
$ tree
.
├── boot.properties
├── build.boot
├── resources
│ └── config.edn
├── src
│ └── fleeckr
│ ├── core.clj
│ ├── db.clj
│ ├── downloader.clj
│ └── flickr.clj
└── target
└── fleeckr.jar
$ cat build.boot
(set-env!
:source-paths #{"src"}
:resource-paths #{"resources" "src"}
:dependencies '[[org.clojure/clojure "1.9.0-alpha14"]
[com.github.scribejava/scribejava-apis "3.2.0"]
[org.clojure/data.xml "0.0.8"]
[org.clojure/core.async "0.2.395"]
[com.taoensso/nippy "2.12.2"]
[clj-http "3.4.1"]])
(deftask build []
(comp
(aot :namespace '#{fleeckr.core})
(javac)
(pom :project 'fleeckr
:version "0.1.0")
(uber)
(jar :main 'fleeckr.core
:file "fleeckr.jar")
(sift :include #{#"fleeckr.jar"})
(target)))
$ unzip -l target/fleeckr.jar | grep config.edn
82 11-07-2016 10:43 config.edn
config.edn is in the uberjar, but when loading it I get the following in the backtrace
Caused by: java.lang.IllegalArgumentException: Not a file: jar:file:/Users/kenneth/Code/kennethkalmer/fleeckr/target/fleeckr.jar!/config.edn
at $fn__12275.invokeStatic(io.clj:61)
at $fn__12275.invoke(io.clj:44)
at $fn__12249$G__12231__12254.invoke(io.clj:35)
at $file.invokeStatic(io.clj:424)
at $file.invoke(io.clj:418)
at fleeckr.flickr__init.load(Unknown Source)
at fleeckr.flickr__init.<clinit>(Unknown Source)
I’m a bit lost, I’ve tried many different combinations of :source-paths
& :resource-paths
and I’ve tried playing with (sift :to-resource)
and (sift :add-resource)
as well
The snippet of clojure trying to load the edn file is simply:
(def config (edn/read-string (slurp (io/file (io/resource "config.edn")))))
@kennethkalmer try doing this in the repl:
think i’m following along
thanks for the guidance, will play around a bit more later!
yeah, playing with it now in the repl I’m seeing it is pointing somewhere to boot’s cache, so it might not even be loading the file I’m thinking it does
oh no, it does
anyhoo, thanks again! lots of learning to be had
thought magic would make it so! completely new to this jar world
have to relocate, thanks again!
.. it can be quite jarring? (sorry guys)
Considering to bump to 5.21. Should I expect the latter move to be easy or a little more effort?
@deas hey 🙂 are you talking about the cljsjs package?
@deas should be relatively straightforward — maybe try and see if you end up blocked/confused? There's also #cljsjs to ask questions but here is ok too.
Well the build succeeded, but other than moving codemirror.js to src, looks like they introduced a whole lot more in src.
@deas they = cljsjs?
@deas with cljsjs packages the actual source is never part of the git tree, but instead downloaded at build time.
If you have an externs fix I suggest you do that first and increment the -N
increment
@martinklepsch I understand. I am already working on cljsjs/codemirror.
Turns out 5.21 does not ship a built codemirror.js. Is there build.boot using npm I could look at?
@deas maybe you can try downloading from NPM, they seem to include the built JS there
@martinklepsch Ok, thanks so far. Got to go to the barber now. 😉
enjoy 😄
@crisptrutski i gave boot-cljs-test 0.3.0-SNAPSHOT a quick test on a project where i was using 0.2.0-SNAPSHOT before, and ran into this error:
$ boot test-cljs
Adding: ([adzerk/boot-cljs "1.9.293"] [doo "0.1.7"]) to :dependencies
clojure.lang.ExceptionInfo: Could not find artifact adzerk:boot-cljs:jar:1.9.293 in clojars ( )
@dave thanks! updated snapshot
getting my cljs and boot-cljs’s confused 🙂
@crisptrutski is there a new snapshot? i tried deleting 0.3.0-SNAPSHOT locally and pulling it back down, but i’m getting the same error
I have some CLI tests I'd like to run via boot... what's the best (canonical) way to 1) set an env var, 2) run an executable, 3) have boot exit with the error code of the process ? Seems like https://github.com/danielsz/boot-shell isn't quite enough
Is there an easy way to get the relative paths of all the directories in a fileset? I know I can get it of the files by using tmp-path
.
@vikeri not sure I understand correctly but I think there's a :directories
key in the FS that points to the different directories (usually four or so for the different roles files can have in the fileset)
@martinklepsch There is a key called :dirs
but I couldn’t see what I was looking for there. What I would like to get is, if I have the following files:
”src/hej.clj” “src/hopp.clj” “assets/image.png”
I would like to extract
”src” “assets”
@tmarble there is a great library for doing shell stuff in clojure: https://github.com/Raynes/conch in fact, if you’re running your tests from boot, you don’t even have to include the dependency, it’s included as part of boot: https://github.com/boot-clj/boot/blob/master/boot/pod/src/boot/from/me/raynes/conch.clj
there is an exit-code
function that waits for the process to complete and returns the exit code
@dave .. yep i've just discovered boot.util/dosh which runs a command, throws an exception... now just need to set the envvar
@vikeri I see. So either regex or you get all directories inside that are inside the directories listed in :dirs
@vikeri roughly this new File("/your/path/").listFiles(File::isDirectory);
for each directory in :dirs
— this may contain duplicate entries.
@martinklepsch But don’t they have the absolute path to boot?
they will but that should be solvable with (.getName f)
(or the equiv. for dirs if it's not the same)
@dave .. and btw there is no System/setenv 🙂 http://docs.oracle.com/javase/8/docs/api/java/lang/System.html http://stackoverflow.com/questions/318239/how-do-i-set-environment-variables-from-java
@vikeri all that said, if you want src
and added src
as :source-paths
then this won't work
@vikeri do you want the directories inside the directories you entered as :source-paths
etc or the directories specified as :source-paths
etc
wow, it’s unbelievable the amount of java you have to write to set an environment variable for the current process
@martinklepsch The directories inside, src was a stupid example name 😛
hmm, looks like conch can do it https://github.com/Raynes/conch/blob/38c0857e46c83b8da301a7b9d60d1339ffe97d40/src/me/raynes/conch/low_level.clj#L10-L11
@adamfrey oh nice, I was just about to ask if there was some prior art on asset fingerprinting with boot
@mattly there's a bunch of stuff on the wiki as well