Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generating stubs fails #1529

Open
henryw374 opened this issue Sep 15, 2016 · 14 comments
Open

generating stubs fails #1529

henryw374 opened this issue Sep 15, 2016 · 14 comments

Comments

@henryw374
Copy link

I have this project where a folder with some clj files are not part of the lein project.

generating stubs failed with a message that it couldnt find a class generated from one of those files. deleting the directory temporarily, the stubs generated fine.

@henryw374
Copy link
Author

in another project, I get this error:

Error generating stubs for module : WARNING: Inst already refers to: #'clojure.core/Inst in namespace: schema.core, being replaced by: #'schema.core/Inst
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer.utils, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/boolean?
WARNING: bounded-count already refers to: #'clojure.core/bounded-count in namespace: clojure.core.async, being replaced by: #'clojure.core.async/bounded-count
WARNING: boolean? already refers to: #'clojure.core/boolean? in namespace: medley.core, being replaced by: #'medley.core/boolean?
WARNING: pos-int? already refers to: #'clojure.core/pos-int? in namespace: taoensso.encore, being replaced by: #'taoensso.encore/pos-int? (show balloon)

@cursive-ide
Copy link
Owner

The second one there is #1515. For the original issue, can you describe a bit more what the project layout is? Why do you have clj files outside your project? How are they normally used by your project?

@henryw374
Copy link
Author

henryw374 commented Sep 19, 2016

Well it's a bit of a long story... This is a repo we have that has one shared module and 2 applications. we are not using lein-modules as we don't want versioning of the shared module.

so, we use a custom lein middleware that basically munges the shared module project.clj with an
application's project.clj. That doesn't work in Cursive (#1390) so I use lein to pre-generate other project files ...

Anyway, trying to cut this short, I have 2 cursive projects, each one excludes (intellij feature) the app it doesn't need to see and uses a generated project.clj that looks at the source dirs of the shared module and the app.

@cursive-ide
Copy link
Owner

So I think that should still work. If I understand correctly, each Cursive project should have source dirs (blue folders in the project view) corresponding to the shared source, is that right? Have you manually added an extra content root to handle the fact that those source folders will be outside the content root of the project (see #324)?

@henryw374
Copy link
Author

yes cursive has the right source dirs.

but instead of having the project at the level of the app, the project
roots are above the apps, and in each I am using the intellij 'exclude
directory' feature to ignore the other project/app.

I may have tried the extra content root thing before, but I think I found
lein would be happy with source dirs located at '../somewhere-else'

On Tue, Sep 20, 2016 at 5:51 AM, Colin Fleming [email protected]
wrote:

So I think that should still work. If I understand correctly, each Cursive
project should have source dirs (blue folders in the project view)
corresponding to the shared source, is that right? Have you manually added
an extra content root to handle the fact that those source folders will be
outside the content root of the project (see #324
#324)?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1529 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC7ZDFAQCwLAVRvd1c-5NiW4BXeSUfx5ks5qr2ZugaJpZM4J99GR
.

@henryw374

@cursive-ide
Copy link
Owner

With that configuration, how do you manage to have the two projects with their root in the same directory? Do you check your repo out in two different locations and then override the project.clj in the root for each project?

@henryw374
Copy link
Author

I did have it checked out twice for a while, although that was a bit of a
pain as you can imagine with the shared module and testing it all before
pushing.

so now, one app is like this below, and the other one is similar but uses a
soft link to the repo

App-A (generated project.clj)

repo

shared
App-A
App-B (excluded)

On Tue, Sep 20, 2016 at 10:37 AM, Colin Fleming [email protected]
wrote:

With that configuration, how do you manage to have the two projects with
their root in the same directory? Do you check your repo out in two
different locations and then override the project.clj in the root for
each project?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1529 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC7ZDNeHp3d5z4rkvN1uiD1Nf5oEgdTAks5qr6lQgaJpZM4J99GR
.

@henryw374

@cursive-ide
Copy link
Owner

Ok, and under the root App-A, the source dirs are something like [repo/shared/src repo/App-A/src]?

@henryw374
Copy link
Author

yes

On Tue, Sep 20, 2016 at 10:45 AM, Colin Fleming [email protected]
wrote:

Ok, and under the root App-A, the source dirs are something like [repo/shared/src
repo/App-A/src]?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1529 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC7ZDAbFmnbYOyas9Ss2qh16l_UbkWrFks5qr6sxgaJpZM4J99GR
.

@henryw374

@cursive-ide
Copy link
Owner

Ok. I'll try to set up a test project with a structure like this and see if I can reproduce your problem. How was the class that it couldn't find defined, and how was it referenced in the App-A source code?

@henryw374
Copy link
Author

Cool. On generating stubs from App-A, the error was about a file located
like this:

App-B/src/com/blah/xyz.clj

and that file is referenced only from App-B. The error message was like
where lein cannot find a :main ns and is searching for either the clj or
class equivalent.

On Tue, Sep 20, 2016 at 10:54 AM, Colin Fleming [email protected]
wrote:

Ok. I'll try to set up a test project with a structure like this and see
if I can reproduce your problem. How was the class that it couldn't find
defined, and how was it referenced in the App-A source code?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1529 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC7ZDFOg-OvyR7pB_4hMsxw75UJMll0oks5qr61sgaJpZM4J99GR
.

@henryw374

@cursive-ide
Copy link
Owner

Ok, I'll do my best to reproduce this. If not, I might have to ask you to try to come up with a simple repro case. Hopefully I'll get to this tomorrow.

@cursive-ide
Copy link
Owner

One question, actually - in your App-A, does it also have repo/App-B/src in the source dirs of your generated project.clj, and then that is excluded in IntelliJ?

@henryw374
Copy link
Author

no, just App-A and the shared source are in the source dirs.

The repo/App-B directory is excluded.

On Tue, Sep 20, 2016 at 11:20 AM, Colin Fleming [email protected]
wrote:

One question, actually - in your App-A, does it also have repo/App-B/src
in the source dirs of your generated project.clj, and then that is
excluded in IntelliJ?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1529 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AC7ZDLMcPEKBabJI2yN267qzUDnVIp90ks5qr7N3gaJpZM4J99GR
.

@henryw374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants