The IDE keeps indexing the excluded build folder Follow
I have a project that that uses Gradle. (It's a multiplatform Kotlin project). When I run `gradle war` (from a shell or from within IntelliJ) it creates some files in the `build` folder (as expected) and then IntelliJ starts churning, indexing something in that folder (see screenshot). But `build` is invisible in my project navigator and marked as "excluded" in my module settings, as it should be. Is this a bug? IntelliJ should not be indexing the build output, correct?
Please sign in to leave a comment.
What IDE version do you use?
Could you show screenshot with the build/web directory expanded in Project tool window after you run gradle war task?
Please check also 2019.2 EAP from https://www.jetbrains.com/idea/nextversion (can be installed and run together with 2019.1.X versions).
I think your question has pointed to the answer. My Project window was not showing excluded files, but when I show them, I see that something (I don't know what) has put a module in the build folder.
I know what the those first 6 modules (commonMain to jvmTest) are doing there, but I'm not sure what part of my gradle build created the 'main' and 'test'. I may try deleting them, though if they are coming from gradle they will probably reappear...
>I'm not sure what part of my gradle build created the 'main' and 'test'. I may try deleting them, though if they are coming from gradle they will probably reappear...
Yes, in Gradle each source set has a separate classpath hence IDE creates separate module for each Gradle source set, so you see main and test modules in IDE interface.
Looks like some Gradle plugin that you use creates the static web root in build output and sets it up as a Web Resource Directories for the module. You can check it in the Web facets of your project:
Yes, it's the war plugin and my attempt to change the `war` task to get it to work with the multiplatform plugin. I have no way to package and deploy code to Tomcat currently.
Actually, even when I remove by attempts to configure the war task, the war plugin by itself causes this:
Frustrating. IntelliJ and Kotlin (the language) are great, but trying to setup a non-trivial multiplatform web app has been miserable. I'll go ask around on Kotlin boards if anyone knows how to do this...
Seems that there is some Gradle configuration that generates the js files into build directory which are then used in project? Could be an expected behavior, but I'm actually not familiar with Kotlin JS specifics and Kotlin MPP Gradle configuration.
If problem remains can you provide a sample project and submit an issue at https://youtrack.jetbrains.com/issues/KT YouTrack? Thanks.
You could also try asking in Kotlin community forum https://discuss.kotlinlang.org/