NetBeans ignores sourceSets specs #184
Comments
Exclude and include patterns are currently ignored by the plugin. Also, currently class path detection will ignore this info as well. This is most likely fixable. If you write me a method which determines if a file (or directory) is in a source root (given the source root path, exclude and include rules), I will make the plugin consider exclude and include patterns. Otherwise, this is a low priority issue because you are the first one requesting it. By the way, instead of writing |
Thanks for the quick reply and the advise you gave me about improving my build.gradle file. I understand it is a low prio issue and I'll consider looking into the method you requested. |
Should be fixed in master. Can you verify it works for you? (i.e., clean and build the project and install the created nbm).If it doesn't work, try clearing NetBeans' cache folder. |
@kelemen Thanks! This is priceless! |
Only files are filtered and not directories. The reason for this is because you can - in theory - create complex rules to reinclude subfolders/files and the only way to check it is to check all the files in the source which would extremly inefficient (though there could be some rule of thumbs to detect common patterns). As for |
I think, I might add some optimization if there are no "include" rules, if that is what you want. |
or if there are only include rules. |
I though all files are checked anyway. I'm afraid that without a complete understanding of how the plugin works it's not easy to follow this explanation.
In my case, there are only include rules. But again, out of curiosity, you are already testing for all include and exclude patterns (at least, that is what |
Originally, the plugin did not support these patterns. To keep the same performance, I have to instantiate different classes if there are no rules. The one you need, is an additional check (and maybe an additional classpath, etc. implementation). |
I'm almost giving up: I have found how the plugin updates the sources ( So far, so good. From my observations, for my project I have a So my question: where does NB test if a resource belongs under the corresponding sourceSet tree node? I must be looking at the wrong place! |
Those are only for the classpath and not for displaying the source nodes. For displaying the sources in the project view (I believe) the only thing that matters is |
Thank you! |
Now I understand your comments. And no, the solution doesn't seem to be very straightforward. |
according to current filter behaviour to set the fundations for fixing kelemen#184 directory filtering.
For historic reasons all source code files in my projects reside inside the src directory. However, all test classes are inside /test subdirectories (yuck, I know...).
I added a sourceSets definition in the build.gradle file which gets respected when building and testing with Gradle, both from the command line and from within NetBeans. However, the Projects tab shows all source files both in the Source Packages and Test Packages trees. This is how I defined the sourceSets:
The text was updated successfully, but these errors were encountered: