Warning in compiler if annotations path does not exist.

This commit is contained in:
Evgeny Gerashchenko
2013-03-04 15:28:56 +04:00
parent 0e85fdd2cf
commit 4213eec2a5
@@ -119,7 +119,7 @@ public class JetCoreEnvironment {
addToClasspath(path);
}
for (File path : configuration.getList(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY)) {
addExternalAnnotationsRoot(PathUtil.jarFileOrDirectoryToVirtualFile(path));
addExternalAnnotationsRoot(path);
}
for (String path : configuration.getList(CommonConfigurationKeys.SOURCE_ROOTS_KEY)) {
addSources(path);
@@ -145,8 +145,12 @@ public class JetCoreEnvironment {
return projectEnvironment.getProject();
}
private void addExternalAnnotationsRoot(VirtualFile root) {
annotationsManager.addExternalAnnotationsRoot(root);
private void addExternalAnnotationsRoot(File path) {
if (!path.exists()) {
report(WARNING, "Annotations path entry points to a non-existent location: " + path);
return;
}
annotationsManager.addExternalAnnotationsRoot(PathUtil.jarFileOrDirectoryToVirtualFile(path));
}
private void addSources(File file) {