This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-06
Channels
- # admin-announcements (2)
- # boot (51)
- # bristol-clojurians (1)
- # capetown (14)
- # cider (4)
- # cljs-dev (3)
- # cljsrn (23)
- # clojure (76)
- # clojure-gamedev (2)
- # clojure-germany (2)
- # clojure-greece (2)
- # clojure-hk (5)
- # clojure-poland (1)
- # clojure-quebec (3)
- # clojure-russia (19)
- # clojure-spec (7)
- # clojure-sweden (10)
- # clojure-uk (77)
- # clojurescript (42)
- # clojurex (5)
- # core-async (40)
- # cursive (12)
- # datomic (58)
- # editors (1)
- # events (1)
- # heroku (1)
- # hoplon (4)
- # jobs (6)
- # jobs-discuss (1)
- # ldnclj (2)
- # lein-figwheel (1)
- # leiningen (5)
- # om (66)
- # onyx (51)
- # other-languages (80)
- # proton (20)
- # protorepl (12)
- # quil (3)
- # re-frame (3)
- # reagent (18)
- # spacemacs (14)
- # untangled (78)
- # yada (16)
For the intrepid and very curious, I create a boot task (with my conventions, sorry) for cider-diet
:
https://gist.github.com/arichiardi/86ccc450e243e9964e723d73f2f1db2c
Usage: boot fast-repl
Improvements are more then welcome š
I will maybe end up in lambone, I will be testing it in these days (it feels like 8 seconds startup time)
first flaw found, env vars are not visible in the inner process
I'm using a tenzing template. (serve) seems to use the resources
directory. I would prefer it to use resources/public
. What do I need to change to tell boot to use the subdirectory?
boot serve --help
@timothypratley
You'll need to move the .cljs.edn
file as well then š
ok thanks
So adding a :dir option to serve worked, in that I can load index.html
(deftask development []
(task-options! cljs {:optimizations :none :source-map true}}
reload {:on-jsload 'voterx.main/render}
serve {:dir "resources/public"})
identity)
But trying to set the cljs compiler output-dir in app.cljs.edn didn't:
{:require [voterx.main]
:init-fns [voterx.main/init]
:compiler-options {:output-to "resources/public/js/compiled/main.js"
:output-dir "resources/public/js/compiled/out"
:asset-path "js/compiled/out"}}
WARNING: Replacing ClojureScript compiler option :output-dir with automatically set value.
WARNING: Replacing ClojureScript compiler option :output-to with automatically set value.
JS is not served (probably it is not under public)@timothypratley: I was actually thinking of
-r, --resource-root ROOT Set the root prefix when serving resources from classpath to ROOT
By using --resource-root you keep relying on the classpath for serving assets which integrates well with Boot
the --dir option requires that you write files to some separate directory than what boot manages after each run
Hmmm my whole intention is to write to a separate directory (perhaps my intentions are bad?) Because I want to deploy stuff. To deploy stuff I use boot target
so I can get my assets, but I don't want everything from resources
in there because there are build resources and there are built resources, I only want to deploy the built resources. Using a different resource root doesn't seem to buy me anything. Using the --dir allows me to serve the "things I want to deploy" but I can't actually build those š Obviously I'm doing it all wrong lol.
you can use sift
to remove stuff from what target
outputs
I think it's sometimes hard to see how all things fit together so it takes some time
This might help as well: https://github.com/adzerk-oss/boot-cljs/wiki/Serving-files @timothypratley
also this might be interesting to improve your understanding: https://github.com/boot-clj/boot/wiki/Filesets#roles-of-files
Ah right I think I want to do something similar as timothypratley in the end.
Ie. copy/move a few compiled js files out of target
to use them on another folder containing a website
Whatās the best way for a task to determine the version of the project itās being invoked in?
Ok, looks like boot.pod/pom-properties-map
might be the best best, based on what I see in (deftask jar)
.
Although I just had a look at the following:
(core/deftask pom
"Create project pom.xml file.
The project and version must be specified to make a pom.xml."
[p project SYM sym "The project id (eg. foo/bar)."
v version VER str "The project version.ā
Which seems to suggest that project
and version
arguments are āmagicā arguments that are supplied by the values in the build.boot.@clem what is your goal?
just read a version string?
ok so one way to do that is use boot-semver
to read/write a version.properties file, you can then use get-version
in your build.boot
what type of artifact are you looking to build?
Iām creating a task that uses pandoc to create a document. I need the version string to both add to the document and to compose the filename.
boot doesnt manage versions at all
boot-semver
should be all you need š
Ok, Iāll give that a look. So, typically, versions are stored separately in version.properties
and not in build.boot
? Would a version stored in there be used by jar
and pom
?
well you can (generally) do it however you want to, i dont think version strings have a place in config files, since you cant change your build.boot file while a pipeline is running, so I cant update my version string (without boot-semver
)
you can then use a options map to set the version for the tasks which need itā¦. one sec ill throw up a demoā¦.
correct but they are applied to all the instances of it, so keep out things you are going to specify multiple times in multiple build pipes
or (def +version+ (get-version))
you can also use a default for when the file doesnāt exists (get-version ā0.1.0")
but yes, task-options!
are applied wherever you use that task
you can even override them in a task during your task contruction
in a future version iāll give the option to override standard tasks like pom when the version task updates the string
itās on my list š
let me know if you need help getting it working :thumbsup: