This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-22
Channels
- # announcements (13)
- # babashka (22)
- # beginners (22)
- # biff (17)
- # calva (6)
- # clerk (20)
- # clj-kondo (25)
- # clj-together (5)
- # clj-yaml (20)
- # cljdoc (16)
- # cljs-dev (1)
- # clojure (42)
- # clojure-brasil (1)
- # clojure-europe (26)
- # clojure-nl (6)
- # clojure-norway (24)
- # clojure-turkiye (3)
- # clojure-uk (5)
- # clojurescript (37)
- # core-async (7)
- # core-logic (2)
- # datalevin (7)
- # datomic (43)
- # events (2)
- # fulcro (7)
- # gratitude (1)
- # hyperfiddle (7)
- # java (7)
- # jobs (3)
- # lsp (4)
- # off-topic (16)
- # pathom (18)
- # polylith (1)
- # portal (27)
- # reitit (4)
- # releases (3)
- # shadow-cljs (47)
- # tools-build (14)
- # tools-deps (16)
- # yamlscript (11)
Does tools-build
require the :src-dir
to be in the project root? I've got some code I don't want to package with the JAR (though if there's good reasons not to take this approach I'm open to them). Consequently, I have my root src
directory with a handful of subdirectories, and I only wish to package one of those. That has roughly this structure:
- src
- com
- me
a-file.clj
but when I load the JAR it can't find a-file.clj
Is it because the file name uses a -
rather than _
no, that's a poor choice of example on my part I suppose, the file is named api.clj
If I pass in the directory I want as my :src-dir
the outputted classes
directory contains a file named api.clj
but even clj-kondo complains about the namespace mismatch and then I can't load the ns in the REPL
which task are we talking about?
are you copying src dirs or compiling clj to classes?
if the former, you can selectively copy whatever you want. if the latter, you can selectively compile whatever you want
I think I figured it out but I suppose it would be both/either of b/write-pom
and b/copy-dir
. Should my POM also be modified in <sourceDirectory>
?
write-pom just write stuff in the META-INF, so this seems likely a completely different question than prior. the pom template is assumed to be in <root>/pom.xml but you can specify it to read from wherever you want
if you are only including a subset of your source, you may find it helpful for your sanity to split that into separate directory roots
I see. I thought b/write-pom
had some bearing on the root pom.xml
but TIL.
https://clojure.github.io/tools.build/clojure.tools.build.api.html#var-write-pom
reads template from :src-pom
, modifies based on basis and other args, writes to :class-dir
Thanks for the clarification 🙏:skin-tone-2: I'll have to play around, really have not turned any tools-build knobs yet