I'm ashamed to ask at this point but how do you ty...
# intellij
m
I'm ashamed to ask at this point but how do you typically exclude your
build
folders from search results? I've browsed a bunch of stack overflow answers and the easiest way seems to be to add
build
to the list of ignored folders. But this has a number of drawbacks like the fact that it seems to be a global and also more importantly removes
build
from the project explorer completely so it's not possible to go in generated files for an example. How do you do this?
3
w
If you ever find out, please let me know 😛 What I do for now is a custom
Exclude generated code
scope:
Copy code
!file:*build//*&&!file:*intermediates//*&&!file:*generated//*&&!lib:*..*&&(file:*.kt||file:*.xml)
but while it works, it’s often not selected by default. Also for some reason generated/build files often appear in my search even though the project is still indexing
👀 1
It feels like at some point IJ started treating kapt build directories as regular sources (solving issues with generated code not being indexed at all btw). But it feels backwards, and while I can’t bring up any examples, I don’t recall my current inconveniences around generated files happening for Java projects back couple of years ago
m
My main issue right now is I have more and more JS files and these... well contain all the gazillions symbols from the projects, very often on a single line 😅 So it's not super convenient to have them in search results
I'll try the
exclude scope
, see how that goes, thanks for the hint 🙏
s
In one of our projects we have some code in the root
build.gradle.kts
which uses the Gradle IDEA plugin to try and exclude a bunch of directories, like:
Copy code
idea {
    module {
        excludeDirectories(...
But I didn’t write that code and I’m not 100% sure if it actually works or not…
👀 1