Test files have different target directories than program files when compiled (flycheck) #151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When compiling a test file its target directory is normally something bellow "test-classes". Regular classes are compiled to "classes" directory. Thus regular classes and test classes have different jdee-compile-option-directory in the same project.
A solution to this issue is to make jdee-compile-option-directory a buffer local variable and set its value accordingly in prj.el . But flycheck cannot known where to put the compiled file, so the solution I propose is to copy jdee-compile-option-directory value from original buffer if it was set.
The greater goal here is to have the compiled file in the right place as maven/ant would do, without compiling it twice (one for check, other the "real" compilation).
Thanks