boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
2018-05-22T00:10:54.000113Z

hello folks, how can i tell in a deftask of build.boot to compile the js assets into a single file instead?

2018-05-22T00:11:17.000267Z

(task-options! cljs ... <-- what parameters to pick here?

martinklepsch 2018-05-22T09:52:40.000531Z

You mean :optimizations :advanced?

2018-05-22T21:33:14.000285Z

Tried that, still comes in fragmented js files

2018-05-22T22:02:41.000267Z

(deftask build
  []
  (comp
    (cljs)
    (target)))

(deftask production
  []
  (boot.util/info (str "Building for production ..."))
  (task-options! cljs {:optimizations    :advanced
                       :compiler-options {:compiler-stats  true
                                          :closure-defines {"goog.DEBUG" false}}})
  identity)

(deftask prod
  "Simple alias to build production artifacts"
  []
  (comp (production)
        (build)))

2018-05-22T22:04:02.000103Z

that’s the code. running $ boot prod still puts fragmented js files in the target folder. only want one js file. any clues?

martinklepsch 2018-05-23T06:50:05.000129Z

@michael.heuberger the cljs compiler creates intermediary files, you only need the one you specified as :output-to

2018-05-23T21:27:52.000169Z

ah - that was the confusing part. wish the intermediary files were somewhere else, in a temp directory for less confusion.

arohner 2018-05-22T14:28:16.000067Z

Are there any libraries for using boot in a monorepo? (multiple subprojects in the same github repo, with potential source dependencies between them). Do they work well?

danm 2018-05-22T14:48:20.000444Z

I don't know about libraries, but it's what we're doing and it seems to work just fine

arohner 2018-05-22T14:48:53.000780Z

Do you use a new boot file in each subproject?

danm 2018-05-22T14:50:13.000268Z

Yeah

arohner 2018-05-22T14:51:59.000593Z

Can you call one boot task from another? like if I wanted to run test in all subprojects, how does that work?

arohner 2018-05-22T14:52:15.000600Z

(apologies, I haven’t found docs on this. If there are some, please point me at them!)

danm 2018-05-22T14:57:58.000218Z

We're possibly a different pattern. We have microservices and libraries, so although we might have multiple microservices depending on a lib, we generally don't want to build everything as one big project. We integration test the libs locally using boot build install and referencing them in the build.boot for the microservice they're being altered for, then push them to our repo before we build the microservice out to live

danm 2018-05-22T14:59:08.000260Z

We do have a Jenkins job which runs the unit tests for every project in the repo, which it just does via a shell find looking for build.boot files, and triggering an exec of boot test in each directory one is found in

arohner 2018-05-22T15:00:32.000288Z

Ah. So I have a git repo with multiple microservices, and several shared libs. We want to be able to e.g. modify a shared lib, then test it, build the service that depends on it, and test the service, ideally without a PR + deploy in the middle

arohner 2018-05-22T15:01:03.000728Z

I think I can manage it if I could find an API to load the bootfile from a subproject and call tasks in it, maybe from a separate pod

danm 2018-05-22T15:12:23.000480Z

Yeah, similar to us. But our pattern would be 1) Edit the lib (including ensuring unit tests pass) 2) Run boot build install to install the new version of the lib locally (we actually use semver to ensure we build a -SNAPSHOT version for this) 3) Edit build.boot of the microservice to ref the snapshot of the lib. Work on that until it also passes unit tests 4) Push new version of lib to repo (without -SNAPSHOT tag) 5) Remove ref to -SNAPSHOT tag from microservice build.boot 6) Push new version of microservice

danm 2018-05-22T15:13:20.000754Z

If we really needed to test the lib functionality with more than just unit tests, in line with other microservices or with interaction with external systems like dynamodb, we'd build the microservice uberjar locally with the -SNAPSHOT version of the lib and then push that up to the component running the microservice in our INT environment

flyboarder 2018-05-22T16:27:17.000076Z

@arohner there is multi-boot

flyboarder 2018-05-22T16:27:35.000705Z

But I would recommend just running multiple terminal windows which is what I do

flyboarder 2018-05-22T16:28:07.000153Z

and then using boot :checkouts within my microservices

arohner 2018-05-22T16:29:52.000186Z

@flyboarder link? Search is failing me

flyboarder 2018-05-22T16:30:09.000602Z

one sec

flyboarder 2018-05-22T16:31:33.000083Z

@arohner https://github.com/micha/multi-module-build

flyboarder 2018-05-22T16:32:00.000178Z

it’s out of date but the wiring should still work

arohner 2018-05-22T16:32:07.000481Z

thanks

flyboarder 2018-05-22T16:35:31.000504Z

I would think tho that building SNAPSHOT versions of your libraries and then using the built in mechanism via :checkouts would be a faster solution

arohner 2018-05-22T17:12:44.000646Z

I’ve seen that at previous jobs, and really hated it. I find it tedious, and error prone when you forget to bump versions

😅 2
2018-05-22T17:35:17.000029Z

is there a reason not to keep all the code in the same repo, and produce the same jar, but have different entrypoints, like perhaps different arguments or main classes depending on service?

2018-05-22T17:39:24.000472Z

i guess i can think of at least one, different services need conflicting deps

arohner 2018-05-22T19:19:17.000210Z

that’s one of my proposals. We’ll see if the team goes for it 🙂