cursive icon indicating copy to clipboard operation
cursive copied to clipboard

resolving "deep" extra-paths

Open takaczapka opened this issue 4 years ago • 3 comments

Hi,

We've got a multi-module project (a monorepo really) where top deps.edn file contains definition of all extra paths required (ie. for testing). The problem is that Cursive can't resolve extra paths (using "Aliases" checkbox) which point to directory tree deeper than 1. In other words :extra-paths ["dev"] works ok, while :extra-paths ["module/dev"] does not, hence in IntelliJ it won't appear as a source/test folder.

Here's the example alias we use:

:aliases {
  :module-test {
    :extra-paths ["core/test" "core/resources"
                           "module/test" "module/test-resources"
                           "module/dev"]}}

takaczapka avatar Jun 02 '21 13:06 takaczapka

I can't reproduce this. Here's an example project setup:

Screen Shot 2021-10-28 at 13 50 22

Here the two folders are marked as source roots in the project view. Is there something else about your project that might cause this?

cursive-ghost avatar Oct 28 '21 00:10 cursive-ghost

I'm seeing this with a project using the following directory structure, which is inspired by the luminus template.

├── deps.edn
├── env
│   ├── dev
│   │   └── clj
│   │       └── user.clj
│   ├── prod
│   │   └── clj
│   │       └── user.clj
│   └── test
│       └── clj
│           └── user.clj
├── resources
│   └── sql
├── scaffold.iml
├── src
│   └── clj
│       └── app.clj
└── test
    └── clj
        └── app_test.clj

and the following in my deps.edn

{:paths   ["src/clj" "classes" "resources"]
 :deps    {org.clojure/clojure {:mvn/version "1.10.2"}}
 :aliases {:dev  {:extra-paths ["env/dev/clj" "env/dev/resources"]}
           :test {:extra-paths ["env/test/clj" "env/test/resources" "test/clj"]}
           :prod {:extra-paths ["env/prod/clj" "env/prod/resources"]}}}

Additionally, I can mark env/dev/clj as a source root but that gets reset every time I import changes from my deps.edn.

Here's the repo for my example https://github.com/skoestler/scaffold.

skoestler avatar Feb 25 '22 02:02 skoestler