Fork me on GitHub
#polylith
<
2023-08-21
>
jasonjckn04:08:34

can I suppress specific warning codes?

tengstrand05:08:11

Which warnings do you want to suppress?

jasonjckn05:08:34

probably just for a couple months, but i need to transition a large codebase, it's not going to happen overnight, and more generally i'm not sure that I want to strictly follow ALL polylith guidelines, its very opinionated, maybe like 90%, TBD

tengstrand05:08:15

Code that doesn't live under a top namespace, will not be recognised by the poly tool, and a consequence of this is that it will not recognise changes of your code either, which means that your code may not be tested properly, and it will also not appear in the info command. A dirty solution is to create a src directory in a project, and then move all your code there. The poly tool doesn't check code that lives in projects (and that is why the documentation says you should avoid putting code there). With this "trick" you can start to extract your code into bricks from there, without the 205 warning. With that said, my advice is still that you try to move all your code into components and bases.

👍 2
jasonjckn06:08:55

any example build.clj files that AOT projects as well as their transitive bricks, the example in docs only AOTs the main ns

jasonjckn06:08:44

i think i sort of get the gist of it,

(mapcat (fn [[k v]]
                  (if (:local/root v)
                    (:paths v)))
                (:libs basis))

seancorfield16:08:40

The poly project itself does this with a "lifted basis" - see the build.clj file on GitHub

🙏 2
seancorfield16:08:18

Oh, wait, lifted basis is for source for jar file inclusion

seancorfield16:08:35

You don't need any tricks for AOT - it is transitive

seancorfield16:08:18

At work we just aot the main ns

jasonjckn16:08:43

you need to pass the right src-dirs (?) and a list of all namespaces to ns-compile (?) to b/compile-clj before calling b/uber

jasonjckn16:08:05

hence the code snippet above

seancorfield16:08:39

If code is on the classpath, you only need to specify the main ns.

seancorfield16:08:05

You only need src-dirs if you ask it to AOT everything -- but since it is transitive, there's no point in doing that.

seancorfield16:08:38

Unless you are dynamically loading certain nses -- and even there you can just specific those to be AOT'd along with you main entry ns.

jasonjckn16:08:49

ah ok gotcha

seancorfield16:08:53

Again, see the build.clj in the poly project.

👍 2
jasonjckn16:08:13

yah i’m using juxt clip which specifies a system of components in a edn file so there may be some extra logic i’ll need

jasonjckn16:08:23

that explains it

seancorfield16:08:25

With the JAR file -- for a library -- you have to "lift" the basis so that you gather up all the source from the project since there's no transitive compile. But you also have to decide whether to include git deps (since the generated pom.xml can't refer to those).