Fork me on GitHub
#boot
<
2016-02-22
>
martinklepsch12:02:09

In deraen/boot-sass should a file app.main.sass create a app.css or a app.main.css file?

martinklepsch12:02:28

It does the latter for me but all documentation I find seems to indicate the former.

mitchelkuijpers12:02:06

@martinklepsch: deraen/boot-less also does the former so that looks like a bug

mitchelkuijpers12:02:36

I have a main.main.less and that becomes main.css

juhoteperi13:02:19

Hmm, I'm trying to remember if there was a idea that sass4clj should work more like other sass tools

juhoteperi13:02:47

partial files start with _ and other files are "main files"

dominicm13:02:25

^^ Yes there is.

dominicm13:02:39

I mean that this is implemented. Partially.

dominicm13:02:45

And the .main.scss is no longer needed.

juhoteperi13:02:07

find-mainfiles should be changed a bit then

juhoteperi13:02:14

and the documentation

juhoteperi13:02:53

it already filters out files starting with _

juhoteperi13:02:57

so only the docs are wrong

martinklepsch13:02:18

oh ok, so the main.sass thing isn't a thing any more really?

martinklepsch13:02:24

(makes sense I guess)

martinklepsch13:02:28

@juhoteperi: task docstring also mentions main.sass

juhoteperi13:02:28

@martinklepsch: Should be fixed & deployed.

pandeiro15:02:26

Speaking of boot-sass, is enabling source maps support possible currently?

nberger15:02:55

Any boot-test maintainer around? There's a PR to avoid an unexpected exception when there are no namespaces to test: https://github.com/adzerk-oss/boot-test/pull/23, usually not a major issue but it would be great if it gets merged

martinklepsch16:02:22

@nberger: seems safe to merge, will merge and cut a release

martinklepsch16:02:58

@nberger: [adzerk/boot-test "1.1.1"]

mobileink16:02:14

hello. i'm trying to get a simple compojure app running with boot-http and the classpath isn't giving me any love. all my static resources are in target/, and all my .class and .clj files are in target/classes. how can I control the classpath used by boot-http's server?

martinklepsch16:02:47

@mobileink: where are the files you want to have on the classpath?

mobileink16:02:10

target/classes

martinklepsch16:02:34

@mobileink: are these static files and you put them into target yourself?

mobileink16:02:40

i may be misunderstanding the server - I'm following the way servlet containers do it, static resources are not on the cp

mobileink17:02:05

no, my .clj source go in target/classpath.

martinklepsch17:02:42

you don't have a src directory?

mobileink17:02:44

some of my source files (used for runtime config) are autogenned by a boot task

martinklepsch17:02:10

what are you setting :source-paths and :resource-paths to?

juhoteperi17:02:24

@pandeiro: No source-map support currectly, there were some problems with paths or something, haven't had time to look into it. PR welcome.

mobileink17:02:25

my build process copies from src/ to target/classes. this is a requirement for GAE; I'm trying to make one process that works for gae, jetty, etc.

mobileink17:02:01

@martinklepsch: i've tried lots of different things - it still isn't clear to me what they should be

martinklepsch17:02:50

a common setting is :source-paths #{"src"} and :resource-paths #{"resources"}

martinklepsch17:02:36

@mobileink: anyways what does your ring handler look like if you're trying to serve from target/classes?

mobileink17:02:25

i'm using the minimal example from lein new compojure. I added hiccup, and I'm trying to access a namespace where I have config info

mobileink17:02:37

you might be able to get an idea if you look at https://github.com/mobileink/boot-bowdlerize

martinklepsch17:02:52

you want to require the namespace or respond with the contents of its file? what do you mean by "config info"

mobileink17:02:06

the idea is that the files in the config/ dir are processed by bowdlerize/install and bowdlerize/config. the former wraps bower and installs. the latter generates .clj source that is then used at runtime

juhoteperi17:02:19

@pandeiro: This issue has very short description of the problem: https://github.com/Deraen/sass4clj/issues/1

mobileink17:02:38

my handler requires e.g. [hello.scripts :as scripts], [hello.styles :as styles])) then my hiccup code can do e.g. [:link {:type "text/css" :rel="stylesheet" :href (:uri styles/materialize)]

mobileink17:02:41

except without the '=' simple_smile

mobileink17:02:40

the basic idea is use the same information for both build-time tasks (e.g. bower install a Polymer component) and runtime tasks (e.g. generate a URL for the Polymer component).

mobileink17:02:32

with gae's devserver, src/ is not in the runtime cp; you have to copy your sources into target (or whatever you call it) and then tell the server that target is your webapp root. but i gather jetty doesn't normally work that way.

juhoteperi17:02:13

@mobileink: What is your use case for using bower?

laforge4917:02:58

@mobileink I had similar problems. What are you using for serve? I was using boot-jetty, which does not handle static resources. Switched to boot-http and all is well.

mobileink17:02:16

not to mention lots of other webdev resources; bower seems to be a pretty good pkg manager, and boot makes it easy to wrap it.

juhoteperi17:02:41

Hmh, my expereince with Bower is that it is super bad package manager

mobileink17:02:45

@laforge49: trying to get boot-http working.

juhoteperi17:02:58

And I'm asking because all bower packages are already available in webjars maven repository

laforge4917:02:09

--it is a bit complicate when using windows. simple_smile

mobileink17:02:17

@juhoteperi: maybe so, but i don't really have a choice

laforge4917:02:25

But I added a wiki page about it in boot-http.

mobileink17:02:52

@juhoteperi: didn't know that, maybe i do have a choice.

laforge4917:02:19

For myself, I was just using a .js file in the root of another jar, so I did not need to set up any routes.

mobileink17:02:39

anyway the drawback is that then your static files are in a jar. with a servlet i don't think you want that, you want the servlet container to deliver stuff straight off the disk

laforge4917:02:44

boot-http is at least configurable.

juhoteperi17:02:24

@mobileink: With boot it is easy thing to copy files from dependencies into fileset and to disk

mobileink17:02:04

d'oh! of course it is, why didn't i think of that.

mobileink17:02:04

anyway the more the merrier, boot-bowdlerize is about as far as I'm going to take it, and i could probably adapt it to use webjars.

mobileink17:02:56

what it really does is generate config data from bower metadata, that's the main use case. maybe some could be done with webjars metadata

mobileink17:02:05

@laforge49: thanks, i'll take a look

mobileink17:02:40

well, no matter where I put my bower_components dir, and how I set my :*-paths in build.boot, I always get the ol' 404 on e.g. http://localhost:3000/bower_components/Materialize/bin/materialize.js

mobileink17:02:38

no doubt it's something simple but i can think of anything else to try

mobileink18:02:46

never mind - it's a problem with hiccup. sorry about the noise

mobileink18:02:42

I knew it would turn out to be something stupidly obvious: (route/files "/" [:root "target"]) makes it go.

mobileink18:02:22

another item for my ever-expanding fails list

richiardiandrea18:02:04

Hello guys! is there an equivalent to lein run -m namespace

martinklepsch18:02:07

should be easy to write yourself though simple_smile

richiardiandrea18:02:40

yeah true that, just require the namespace and launch -main 😄

laforge4919:02:20

Having aot in library issue

laforge4919:02:26

this works fine:

laforge4919:02:12

but aot in this seems to do nothing:

laforge4919:02:32

So how do I get the aot'd library classes into the jar file with boot? Never had a problem with this with lein.

micha19:02:48

did you look at the aot task docs?

micha19:02:55

boot aot -h

micha19:02:02

or (doc aot) in the repl

laforge4919:02:08

or rather , what I could find.

micha19:02:18

you need to tell it which namespaces to compile

laforge4919:02:34

aot {:namespace '#{aadurable.core}})

micha19:02:56

i don't see it in the thing you pasted

laforge4919:02:11

ture, I put it in the task-options

micha19:02:26

perhaps you have a typo in there

micha19:02:38

and aadurable.core is on the classpath?

micha19:02:00

like you can do (require 'aadurable.core) from boot repl

micha20:02:10

do boot repl

micha20:02:21

and then in there do (require 'aadurable.core)

micha20:02:48

if that throws an exception then you won't be able to AOT the namespace until you get it onto the classpath

laforge4920:02:05

no exception

laforge4920:02:22

I have it on my resource-paths

micha20:02:25

ok so now in the target directory there should be a jar file

micha20:02:49

if you do jar tf target/projct.jar |grep aadurable

micha20:02:53

what do you see

laforge4920:02:09

the only aadurable is a .clj file.

laforge4920:02:41

there should be a .class file, yes?

micha20:02:48

more than one

micha20:02:52

most probably

micha20:02:05

so i see you have show -f in there

micha20:02:13

does that show the class files?

laforge4920:02:14

learning, yes

laforge4920:02:29

test-it works fine

micha20:02:16

hm no idea

micha20:02:25

maybe it's a windows bug

laforge4920:02:48

here's the files

micha20:02:54

i can't really believe that the aot task can know whether it's being followed by run-tests or build-jar

micha20:02:38

there must be something else

micha20:02:45

because you have

micha20:02:00

(comp
  (aot)
  (show :fileset trye)
  ...

micha20:02:03

in both cases

micha20:02:19

so there is no way you will see different output from show -f

laforge4920:02:27

could you run it on your system to confirm windows bug? https://github.com/aatree/aadurable/

micha20:02:29

regardless of what follows

micha20:02:46

i'll take a crack at it this evening

laforge4920:02:48

but I do see a difference

micha20:02:03

yeah you must be clobbering something somewhere

micha20:02:10

because that makes no sense

micha20:02:40

i think you must be mutating things inside the pipeline somewhere

micha20:02:44

mutating some global state

laforge4920:02:07

I'm just starting this project. so there is no anyplace where I do anything.

laforge4920:02:13

very very tiny.

micha20:02:20

i mean if you get different results from the same tasks, something is definitely wrong

micha20:02:39

you need to bisect the problem i guess

micha20:02:54

remove things until you see what the minimum change is to make the problem manifest

micha20:02:03

then zero in on the problem

laforge4920:02:19

it is allready there

laforge4920:02:29

it is pretty minimal

laforge4920:02:32

I just started this and first thing was to test aot.

micha20:02:15

boot -BP -r src/clj -r src/cljc aot -n aadurable.core jar target -d target

micha20:02:50

then do jar tf target/project.jar |grep aadurable

laforge4920:02:15

don't have grep

laforge4920:02:37

I usuallyjust convert .zip to.jar and look at it

micha20:02:51

sure whatever works

laforge4920:02:09

there are 2 folders, aadurable and META-INF

micha20:02:24

well were the class files in there though

laforge4920:02:35

aadurable contains fun.clj

micha20:02:59

maybe cljc files are the problem

laforge4920:02:06

and META-INF contains MANIFEST.MF only

laforge4920:02:37

I'll delete it

micha20:02:38

well maybe

micha20:02:45

but perhaps

micha20:02:44

~/git/aatree/aadurable master
barp $ BOOT_VERSION=2.5.5 boot -BP -r src/clj -r src/cljc aot -n aadurable.core jar target
Compiling 1/1 aadurable.core...
123
Writing project.jar...
Writing target dir(s)...
~/git/aatree/aadurable master
barp $ jar tf target/
aadurable/   project.jar  
~/git/aatree/aadurable master
barp $ jar tf target/project.jar |grep aadurable
aadurable/
aadurable/core.cljc
aadurable/fun.clj
aadurable/core$prxx.class
aadurable/core$loading__5569__auto____64.class
aadurable/core$fn__66.class
aadurable/core__init.class

laforge4920:02:44

made a change and it is working for me.

laforge4920:02:37

I changed core.cljc to core.clj which still did not work, but then I added fun namespace to aot and it worked.

micha20:02:47

it works fine with cljc

micha20:02:53

as you can see in my paste

micha20:02:11

i just ignored your build.boot

laforge4920:02:35

took fun out of the aot namespaces and it works

laforge4920:02:39

restored core.clj to core.cljc and it works

laforge4920:02:50

never mind, but thanks

laforge4920:02:20

something was sticking somewhere.

micha20:02:18

that command line i pasted is how you can bisect the problem

micha20:02:30

that paste shows that the aot task and jar task etc work fine

micha20:02:36

so the problem is in your build.boot somewhere

micha20:02:44

that's how you can debug these things

micha20:02:59

rather than randomly typing

laforge4921:02:37

I believe the issue was with my ide not saving the build.boot file. A guess anyway. But I found a configuration setting that might prevent this in the future. It was auto-saving after 15 sec of idle. changed it to 1 sec.