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
Plugin adds the generated folders from other sourceset to the main sourceset #334
Comments
Hi, I just stiumbled on this issue, I'm affected by this issue as I don't use it the same way. But I noticed the gradle config uses the HTH |
Not sure if either of you found an answer to this issue. Will summarize my investigation: From what I've been able to gather the issue is in You can see for both the proto sources and the generated code dirs, it uses a util method static void addToIdeSources(Project project, boolean isTest, File f) {
IdeaModel model = project.getExtensions().findByType(IdeaModel)
if (model != null) {
// TODO(zpencer): switch to model.module.generatedSourceDirs when that API becomes stable
// For now, just hint to the IDE that it's a source dir or a test source dir.
if (isTest) {
model.module.testSourceDirs += f
} else {
model.module.sourceDirs += f // <-- here
} This seems to depend on the I had a look at the idea-ext plug-in you mentioned @bric3 - but there is a corresponding issue there (JetBrains/gradle-idea-ext-plugin#22) so it doesn't look like that project supports this either. Given the outstanding issues on both of those projects I don't think there's likely to be a solution there soon, but I'm wondering if we can raise a PR on this one to at least prevent it from marking it as a source dir using the |
For The problem is that the IDEA plugin doesn't provide APIs for adding srcDirs to a specific custom source set, all it has are Realistically, this should only affect people compile with Intellij's compiler. But since you are delegating to Gradle, it shouldn't cause any compilation trouble right? If you really don't want to link sources not belonging to the specific source set (e.g., navigating code in custom source set jumps to code in |
You're correct that it doesn't cause any compilation trouble. But it does break IntelliJ features like code navigation (every reference to a generated class in a different sourceSet will appear as if it cannot be resolved, will be red in the editor, and won't support code-sense, navigation, analysis etc). I think I agree there's not much this plug-in could do to improve things without changes in the IDEA plug-in or IntelliJ gradle support. I think the best we can hope for is just a way to prevent this plug-in from interacting with IDEA plug-in entirely, so we can fix the paths ourselves. Would you be receptive to a PR for ability to disable that? |
Yeah, you can send us a PR if you can find a better solution. If there is a way to improve the user experience, we are happy to see it. But I don't think we want to completely disable IDEA integrations. I mean working in some extent is better than nothing. Most users do not create custom source sets, so they should be able to see the integration work nicely. |
Hi!. In the end I solved my problem in another way, I don't know if it could apply for you... but here it goes.. Since I didn't require integration tests for protos then I created a separated module only for protos with only two sourcesets main/test as it is supported, and others modules for protos consumers with any sourceset that I need, look the image: And If you need to separate your proto in many sourcesets, you could separate it in many modules. I hope it helps you. |
Hi, I'm creating another sourceSet to integration test module and the ide handle it wrong, someone can help me?.
Version: 0.8.10 con kotlin
My configuration:
The text was updated successfully, but these errors were encountered: