final VirtualFile virtualFile = psiFile.getVirtualFile();
if (virtualFile == null) {
LOGGER.warn("No virtual file for psi file: " + psiFile);
return null;
}
final CompilerModuleExtension moduleExtension = CompilerModuleExtension.getInstance(module);
if (moduleExtension == null) return null;
String classPath;
if (ProjectRootManager.getInstance(module.getProject()).getFileIndex().isInTestSourceContent(virtualFile)) {
final VirtualFile pathForTests = moduleExtension.getCompilerOutputPathForTests();
if (pathForTests == null) {
LOGGER.warn("No compiler test output path for:" + virtualFile);
return null;
}
classPath = pathForTests.getPath();
} else {
final VirtualFile compilerOutputPath = moduleExtension.getCompilerOutputPath();
if (compilerOutputPath == null) {
LOGGER.warn("No compiler output path for:" + virtualFile);
return null;
}
classPath = compilerOutputPath.getPath();