Fork me on GitHub
#boot
<
2016-03-24
>
domkm00:03:07

How would I use sift to move the directory "META-INF/resources/webjars/bootstrap-sass/3.3.6/assets/fonts/" to "fonts/"? I'm trying to output bootstrap fonts but can't seem to get it to work.

richiardiandrea00:03:15

I think siftand boot in general works for files only, so I wrote a rebase task: https://gist.github.com/arichiardi/45debef5d84934835555

richiardiandrea00:03:29

but you might need some adjustment

richiardiandrea00:03:17

sorry wait I will put it in a gist

domkm01:03:32

https://github.com/boot-clj/boot/issues/144 led me to believe that it would work with directories

richiardiandrea01:03:36

I fell in the trap too simple_smile

domkm01:03:47

Hah, I see

domkm01:03:39

(sift :move {#".*/fonts/bootstrap/(.*)$" "fonts/$1"}) works!

richiardiandrea01:03:13

good to know thanks!

richiardiandrea01:03:27

my use case was indeed a bit different

jaredly02:03:10

So I’m side-loading in a js file & then accessing it via js/GlobalName in my code. I now want to test stuff w/ boot-cljs-test, so I’m trying to side-load in this js file in node as well. I just can’t figure out how to get boot to copy the file into the directory where the tests are happening.

jaredly02:03:08

mmm nevermind, I went ahead and used foreign-libs

martinklepsch09:03:43

@juhoteperi: ^ this is a breaking change right?

juhoteperi09:03:01

Should only add a new option, doesn't change existing options

martinklepsch09:03:27

ah yeah, just saw now, sorry for the noise

mobileink13:03:12

morning booters. i'm about to start working on support for appengine modules in boot-gae and i want to make sure something along those lines hasn't been done already. fyi a gae module ends up as an independent war so its not really a subproject or submodule. when you build a webapp using modules each module gets compiled/prepared separately, then they all get combined into an EAR module. So you can compile and upload the whole thing, but you can also compile and upload modules separately. See https://cloud.google.com/appengine/docs/java/modules/#Java_Configuration. Anything like that available? Advice for how to do it?

Jon13:03:26

org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact org.clojure:clojure:jar:1.8.0 in clojars (https://clojars.org/repo/)

Jon13:03:06

hi, anyone got idea on this error message? I was trying to create a jar file, but it keeps throwing this

martinklepsch13:03:11

@jiyinyiyong: the relevant error was earlier in the paste you provided in #C03S1KBA2

martinklepsch13:03:28

cli: option dsl: expected optarg, got edn
                                  clojure.lang.ExceptionInfo:

martinklepsch13:03:54

not sure if this is whats causing the issue but probably not a bad idea to fix this first

martinklepsch13:03:16

Just the html-entry doesn't give enough context

dm313:03:48

I think org.clojure/clojure isn't present in Clojars

dm313:03:52

it's in maven central

tcrawley13:03:10

correct, none of org.clojure is on clojars

Jon13:03:10

clj
(set-env! :repositories [["clojars" {:url ""}]])

tcrawley13:03:27

you're overriding the default repos, which removes central

Jon13:03:56

I was trying to make sure I can push my package to Clojars..

tcrawley13:03:02

you shouldn't need to set :repositories at all unless you need to add custom ones, since clojars and central are in the default set

Jon13:03:44

removed the line and it worked

richiardiandrea17:03:17

a dumb question, how to set a system property or env variable in a boot task 😄

martinklepsch17:03:44

@richiardiandrea: (System/setProperty ...)

richiardiandrea17:03:40

I want to use it for adzerk-oss/cljs-console, very nice logging library

richiardiandrea17:03:01

thanks Martin you saved me some time

richiardiandrea18:03:42

is somebody here using CLJS_LOG_LEVEL in cljs-console ? shall I set it in build.boot for a ClojureScript app?

martinklepsch18:03:58

I'd check the adzerk.env docs, not using it myself so can't help

richiardiandrea18:03:36

it looks like it needs to be set in the code <- scratch this, it cannot be of course, it is at compile time for shizle 😄

laforge4920:03:35

putting some slides together for a meetup talk of the nyc clojure group. Found this in my build.boot file: (bootlaces! +version+ :dont-modify-paths? true) And what does it do again? I've forgotten!

laforge4920:03:07

It is not covered in the readme of bootlaces. And there is no wiki. google is failing me. And I can't figure out the code. 😮

laforge4920:03:21

This is the line I do not understand:

laforge4920:03:22

(merge-env! :resource-paths #{"src"})

micha20:03:01

it calls the function! simple_smile

micha20:03:24

there is a function named bootlaces! that does some initialization of the bootlaces library

micha20:03:54

the merge-env! line merges that resource-path into whatever resource paths you already have

laforge4920:03:58

so why wouldn't I want to modify paths?

micha20:03:27

how do you mean?

laforge4920:03:46

I have this line of code

laforge4920:03:58

(bootlaces! +version+ :dont-modify-paths? true)

laforge4920:03:07

in my build boot file.

laforge4920:03:26

yes, I am looking at that.

laforge4920:03:33

I do want to set the version.

micha20:03:43

if you don't want "src" added to :resource-paths you'd use that option

laforge4920:03:14

I also have this:

laforge4920:03:15

:resource-paths #{"src/client" "src/worker"}

laforge4920:03:35

so I am preventing duplication of the files?

micha20:03:35

so that explains it

micha20:03:53

yeah you don't want to add overlapping directories to :resource-paths

micha20:03:02

there will be a warning if you do

micha20:03:12

and things will behave unpredictably

micha20:03:17

many race conditions

laforge4920:03:28

ah. but I do want to specify resource-paths to make sure it all goes in my jar file.

micha20:03:43

"src" contains "src/foo" and "src/bar"

micha20:03:58

that would be bad if you had all 3 in your :resource-paths

micha20:03:30

behavior is undefined in that state

laforge4920:03:53

so in general, in a library when you want the source included in the jar file, you always set dont-modify-paths?, yes?

micha20:03:11

well the whole thing should be removed from bootlaces probably

micha20:03:17

so i recommend always setting it, yes

micha20:03:27

that was a bad decision in hindsight

laforge4920:03:39

gotta be able to field questions in this presentation.

micha20:03:12

yeah the core issue is when you have something like :resource-paths #{"src" "src/foo" "src/bar"}

micha20:03:29

you can imagine the race conditions that would create in the watch task for instance

micha20:03:41

and in general you'd have a lot of duplicate files in there

micha20:03:11

you already had :resource-paths #{"src/foo" "src/bar"}

laforge4920:03:24

So really, I am only using bootlaces to set the version of the jar file?

micha20:03:40

bootlaces wanted to add "src" to that, which would have made it be :resource-paths #{"src" "src/foo" "src/bar"}

laforge4920:03:56

ah it builds the jar

micha20:03:14

yeah i mean bootlaces doesn't really do much, it just adds some minor things that we found useful

micha20:03:24

it mostly just composes built-in tasks

micha20:03:11

it also does some things like looking in various places for credentials and stuff that probably isn't really necessary anymore now that we've merged in the changes that add similar functionality to boot itself

laforge4920:03:21

hard to see because I've got

laforge4920:03:22

'[adzerk.bootlaces :refer :all])

laforge4920:03:34

So it was not clear what I was using it for.

micha20:03:41

if you do boot -h you can see alll the things it exports

micha20:03:58

the output of boot -h is grouped by namespace

laforge4920:03:31

('scuze my pig spanish!)

dottedmag22:03:21

I have forked (temporarily) one library (say X) and pushed it to clojars. I use another library (say Y), which uses X. Is there a way to temporarily override X dependency in Y, without publishing changed Y on clojars as well?

micha22:03:33

(set-env :exclusions [X]) and then add your own forked version

micha22:03:37

although pushing a library containing someone else's namespaces to clojars is kind of setting us up for dependency hell

micha22:03:55

like if someone depends on your fork instead

dottedmag22:03:03

It's in org.clojars.$username

micha22:03:15

yeah but the namespaces in the jar

dottedmag22:03:15

AKA "Don't you ever touch it"

micha22:03:30

those are not org.clojars.username/core

micha22:03:35

i'm assuming

micha22:03:46

that's where the pain starts

micha22:03:04

because some transitive dependency brings that in, and now there is a conflict with the original library

micha22:03:14

which is broght in by a different transitive dependency

micha22:03:22

it's extremely difficult to debug that

micha22:03:34

because there is no indication in the dependencies that there is a conflict

dottedmag22:03:36

You mean "core" as Clojure standard library?

micha22:03:48

like for example

micha22:03:00

[hoplon "6.0.0"]

micha22:03:11

that jar contains hoplon.core namespace

micha22:03:20

suppose someone forks that

micha22:03:35

to org.clojars.foo/hoplon

micha22:03:38

or whatever

micha22:03:51

now suppose someone sees that one and depends on it

micha22:03:17

so that would be like [org.clojars.foo/hoplon "6.0.1"] or something

micha22:03:37

then if anything depends on the original hoplon you have a conflict

micha22:03:49

because the hoplon.core namespace is in the classpath twice

micha22:03:08

smuggled in via a false dependency, kind of

micha22:03:26

it's very painful to debug that

dottedmag22:03:34

Well, the answer is "don't do that". That's why org.clojars.$username is documented to be a scratch space.

micha22:03:03

people will still do it

micha22:03:14

and then we all have to deal with it at the build end

micha22:03:23

rather than at the repo end

dottedmag22:03:30

Well, then either this namespace should be removed completely or tooling should be changed.

dottedmag22:03:49

Also, https://github.com/clojars/clojars-web/wiki/Tutorial says "If you want to push your own version of somebody else’s jar you’ll have to put it under your group, to show it’s your version and not the official one. To do this, just qualify the project name by putting org.clojars.username/ in front of it in your project.clj."

micha22:03:27

interesting, i guess it's oficial

micha22:03:41

i did not know that was an established practice

dottedmag22:03:30

BTW, is there a better way to temporarily publish fixed libraries? Say, I have a bugfix and it's necessary for several other people to work on something. Author is yet to integrate/release new version.

micha22:03:17

for a temporary thing you could push to s3 for example, no?

dottedmag22:03:23

Ah, I didn't know it can be done this way. How do I refer to an arbitrary URL in :dependencies?

micha22:03:00

there are what they call "wagons" which provide the maven repository interface on various things

micha22:03:04

s3 is just one option

micha22:03:10

one sec there are docs

micha22:03:43

you can add an s3 bucket as a maven repo

micha22:03:55

this has additional benefit of being private if you want

micha22:03:57

there are "wagons" for all different protocols and storage backends