Fork me on GitHub
#boot
<
2016-12-05
>
grounded_sage04:12:51

I'm struggling a little bit with working on filesets. I can't seem to figure out how to add a specific file to the fileset.

grounded_sage04:12:09

I'm wanting to add my template.html file to the fileset so that I can turn that into multiple html files by changing the name and doing a str/replace on parts of the html.

alandipert04:12:00

@grounded_sage https://github.com/adzerk-oss/boot-template would be something to look at, it substitutes strings in a file

alandipert04:12:18

1. find file in fileset, 2. get its contents, 3. create a temp directory to put output into, 4. using the file's contents make the files you want and put in temp directory, 5. add temp directory to fileset, 6. (optional) rm original file from fileset 6. commit! fileset

alandipert04:12:31

^ basic recipe

grounded_sage04:12:31

Thanks @alandipert I will take a look. I'm still relatively new to Clojure and programming in general. I am getting there. Been trying to look at documentation, source and play in REPL but really struggling with filesets. I just realised that :resource-paths 'resources means it is already in the fileset. But not sure how to capture the fileset as a value to then play with it with the Fileset and Tmp dirs API

alandipert04:12:56

cool, yeah the key to getting a fileset value is making and running a task

grounded_sage04:12:20

ok thanks for that clarification.

martinklepsch11:12:12

Current status: tracking down a bug that only happens every now and then by running the tests half a dozen times

boot test test test test test test test

martinklepsch11:12:23

❤️ boot pipeline

pesterhazy11:12:15

boot repeat -n 10 test

pesterhazy11:12:42

could be a possible task 😉

donaldball16:12:18

Hey, I asked this Friday night but that’s probably a terrible time for it, so once more before I roll my own: is there an idiomatic way in boot to group and exclude tests, e.g. those that integrate with stateful services?

micha16:12:43

@donaldball how are you running your tests?

donaldball16:12:13

In this case, boot test on circleci

donaldball16:12:58

But I have a couple of new integration tests that I’d like to skip. In leiningen, one would mark them via ^:integration metadata and set up some test mode rules.

micha16:12:19

there is the :filters/`--filters` option to boot-test

micha16:12:47

> The --filters option specifies Clojure expressions that are evaluated with % > bound to a Var in a namespace under test. All must evaluate to true for a Var > to be considered for testing by clojure.test/test-vars.

micha16:12:16

it's a set of forms

micha16:12:03

(boot (test :filters '#{(constantly true)}))

donaldball16:12:22

So like (comp (complement :integration) meta) or something along those lines

donaldball16:12:35

Solid, thanks

micha16:12:46

it will bind % to the var in question

micha16:12:37

so like (->> % meta :integration not) or something

fadrian17:12:56

I am a newbie to boot. I am trying to run through the example in the tutorial modern-cljs, which seems to be a good introduction to both Boot and Clojurescript. While running tutorial 2, I am attempting to bring up a ring server using pandeiro.boot-http, but when I attempt to run the boot task boot boot-http -h , I get the following error:

fadrian17:12:09

` results: [#object[org.sonatype.aether.resolution.ArtifactResult 0x19976a65 "adzerk:boot-cljs:jar:1.7.170-3 < clojars (https://clojars.org/repo/, releases+snapshots)"] #object[org.sonatype.aether.resolution.ArtifactResult 0x4bc222e "null < null"]] org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact pandeiro.boot-http:pandeiro.boot-http:jar:jar in clojars (https://clojars.org/repo/) artifact: #object[org.sonatype.aether.util.artifact.DefaultArtifact 0x56dc1551 "pandeiro.boot-http:pandeiro.boot-http:jar:jar"] repository: #object[org.sonatype.aether.repository.RemoteRepository 0x7c921dc0 "clojars (https://clojars.org/repo/, releases+snapshots)"] org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap WagonRepositoryConnector.java: 947`

fadrian17:12:14

This error seems to indicate an inability to locate the proper version of the code in the repository. However, when I search the repo via browser, the specific version I'm asking for is there (and all the auxiliary info looks fine).

fadrian17:12:49

Here's my build.boot:

fadrian17:12:55

(set-env! :source-paths #{"src/cljs"} :resource-paths #{"html"} :dependencies '[[adzerk/boot-cljs "1.7.170-3"] [pandeiro.boot-http]] ) (require '[adzerk.boot-cljs :refer [cljs]] '[pandeiro.boot-http :refer :all]) (deftask dev [] (comp (cljs) (target :dir #{"target"})))

fadrian17:12:04

Any ideas?

pesterhazy17:12:01

is your boot up to date?

fadrian17:12:50

Yes. I ran a boot -u before I did this stuff.

fadrian17:12:58

I've tried adding an explicit version to the boot-http reference (0.7.6), but that didn't seem to help either.

pesterhazy17:12:08

uhh you need to specify the boot-http version

pesterhazy17:12:42

boot requires you to specify versions explicitly (better safe than sorry)

fadrian17:12:07

I've updated my dependencies:

fadrian17:12:08

(set-env! :source-paths #{"src/cljs"} :resource-paths #{"html"} :dependencies '[[adzerk/boot-cljs "1.7.170-3"] [pandeiro.boot-http "0.7.6"]] )

fadrian17:12:30

I get the same error message, albeit talking about that specific version.

fadrian17:12:24

org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact pandeiro.boot-http:pandeiro.boot-http:jar:0.7.6 in clojars (https://clojars.org/repo/)

micha18:12:28

@fadrian i can't reproduce that

micha18:12:01

i see the problem

micha18:12:18

you have [pandeiro.boot-http "0.7.6"]

micha18:12:30

you want [pandeiro/boot-http "0.7.6"]

micha18:12:41

the error message is how i saw that

micha18:12:42

the format it's showing in the error message is <group-id>:<artifact-id>:<artifact>:<version>

micha18:12:08

it's showing pandeiro.boot-http as both the group and artifact ids

fadrian18:12:09

Hmm... I changed it to pandeiro/boot-http and am still getting the same error: artifact: #object[org.sonatype.aether.util.artifact.DefaultArtifact 0x56dc1551 "pandeiro.boot-http:pandeiro.boot-http:jar:0.7.6"]

fadrian18:12:50

Never mind. I did something wrong...

micha18:12:30

that looks like it's still with the .

fadrian18:12:51

Yes. I finally fixed the correct place in the code. It's working now. Thanks for your help. I am, as I said, a boot newbie and my cluelessness is deep.

micha18:12:09

ah you changed the require part?

micha18:12:15

instead o fthe other place?

micha18:12:28

that can be confusing

fadrian18:12:51

Yes. I'm still a bit surprised I didn't get more of an error message about that.

micha18:12:19

the good news is that the issues you just ran into are just clojure issues

fadrian18:12:53

Yes. I like boot for that.

fadrian18:12:29

The recipes for tasks seem fairly clear, too.

micha18:12:57

have you had good results googling stackoverflow etc?

fadrian18:12:59

To be honest, I didn't find much, which means boot probably does pretty much what people expect. The main thing I gather is that the tutorial I'm using is pretty buggy (when my typing isn't already causing problems), so I am having to make changes as I go along. I figure I'm probably learning better due to this, anyhow.

micha18:12:49

hopefully stack overflow will eventually have more answers and questions