Fork me on GitHub
#polylith
<
2024-01-03
>
namenu02:01:23

We have java classes to interop, and polylith warns about this as 'Non top namespace'. for example:

(ns example.user.core
 (:import [com.external.Module M]))

;; M.class is under /components/user/classes/com/external/Module
I suspect this is a false alarm, but I was wondering if it is possible to turn off the warning for this file only.

tengstrand05:01:09

If you move the Java files to resources and the test code to test-resources then you will get rid of the warning.

namenu10:01:59

thanks, it works. is this because polylith considers resources exceptional?

tengstrand11:01:06

It doesn't consider what's in resources as source code, so these files will not be checked.

Daniel Shriki11:01:14

Hi guys. for medium-size polylith project- I’m trying to create a test-utils component to be used across the project. so I put all the relevant namespaces under test directory (not src) and on deps.edn added it only under :test :extra-path , but when I’m running poly test it seems not to recognize the new component’s path. any ideas? tnx 🙏

tengstrand12:01:57

You can have a look at the https://github.com/polyfy/polylith/tree/master/components/test-helper in the polylith workspace. It stores the source code in src but are used by a couple of other components from their test context.

👍 2
Daniel Shriki13:01:36

Nice! thanks a lot 🙏

👍 1