Resource not copied to build folder during Make IJ13

Background (on my setup):
Intellij compiles into "build/classes", and copies the resources into this folder, this folder is used as classPath when running.
our Gradle also compiles into "build/classes", but copies resources into "build/resources/main/", and uses both fileTrees in the classPath.

When I run a clean + classes in gradle, my build folder is deleted, then created without resources in (as gradle puts them elswhere). When I later run a Main from within Intellij, it appears to run a Make, but it doesn't copy the resources into my build folder (perhaps because all the class files are already there).

Is it a bad idea to have gradle and intellij compile to the same output directory? We were hoping it would save some time, because we alternate between running from Gradle and IntelliJ.
I don't know if this is a bug, or if sharing compile output folder between gradle and intellij is not a supported usecase.

any advice is welcome.
/Klaus

5 comments
Comment actions Permalink

It appers that the Make process is flawed.

If I delete my classes folder, intellij correctly compiles (run annotation processors), and copies the resources into build/classes - And my Main program and tests work.
If I then delete a subfolder of classes, like com.x.y.z (which contains my Main class), the deleted files are not recreated when i try to rerun my program. Looking at the bottom toolbar, it looks like IJ is performing a Make, but the files

This looks like a bug to me.

0
Comment actions Permalink

In fact IDEA doesn't watch for changes in output folders performed by external tools. So if you modify contents of an output folder (delete *.class
files by hand or call gradle tasks) you need to invoke Build | 'Rebuild Project' instead of 'Make Project'. If the output folder itself is deleted
IDEA will invoke 'Rebuild' instead of 'Make' automatically.

--
Nikolay Chashnikov
Software Developer
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

We use Ant to do our command line builds. It deletes the destination directory as you suggest. We then do the build using ant and
when entering idea 13, we do a make which results in a long list of cannot find symbol errors. A rebuild gets us back to where we
want. This is a fairly new issue for us. We had idea 12 and on occasion saw this issue. Idea 13 seems to have made this a consistent issue.

I checked the logs files that are generated. We see that the initial start up of idea13 after a "clean build" says there are compile errors. Is there any additional logging information we can enable to understand why it sees a need to compile?

Thanks.

0
Comment actions Permalink

If output folders have been modified by an external tool (Ant build, Gradle task, whatever) 'Make Project'/'Make Module' actions in IDEA aren't
guaranteed to work properly. You need to invoke Build | 'Rebuild Project'.

--
Nikolay Chashnikov
Software Developer
JetBrains
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

If that is what we have to do we will do the rebuild project. The issue only appeared after we moved to idea12.

Thanks.

0

Please sign in to leave a comment.