Rebuild package

Answered

Hello, is there a way to rebuild the package of the current file without select it ?

Because when you create a tests folder (marked as Tests in the project settings) and inside a package per test, when you execute the main class of a test the expected behavior can be to rebuild all modified files (a test can be independent), but in this particular case it is not done and there is always errors "cannot find symbol", thus the sole solution is to rebuild the entire project, or select the package and rebuild it because CTRL+F9 is dynamic.

0
5 comments

Hi, do you have "Rebuild module on dependency change" in Compiler settings?

0

Yes, this setting is checked.

0

Could you please provide a project example to reproduce the problem?

0

After some investigations with a new project it seems that this problem occur when the main class use another class in the same package (for instance A a = new A()), if i do "rebuild target" (CTRL F9) in the main class an error "cannot find symbol class A" appears, and each time after that.

But now if i select the package and do "rebuild target" on it, delete the "out" directory, or edit the A class, the problem don't occur.

 

0

Why don't you use "Build Module" action? It's an expected behavior that "Compile <file>" doesn't recompile dependencies:  https://youtrack.jetbrains.com/issue/IDEA-168938

0

Please sign in to leave a comment.