IDEA-75727 Gradle: support library dependencies that don't point to *.jar files

This commit is contained in:
Denis.Zhdanov
2011-10-21 15:17:57 +04:00
parent 9e88933413
commit 71147efe86
@@ -441,14 +441,19 @@ public class GradleModulesImporter {
GradleLog.LOG.warn(String.format("Can't find %s of the library '%s' at path '%s'", pathType, gradleLibrary.getName(), path));
continue;
}
VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(virtualFile);
if (jarRoot == null) {
GradleLog.LOG.warn(String.format(
"Can't parse contents of the jar file at path '%s' for the library '%s''", path, gradleLibrary.getName()
));
continue;
if (virtualFile.isDirectory()) {
model.addRoot(virtualFile, pathType.getRootType());
}
else {
VirtualFile jarRoot = JarFileSystem.getInstance().getJarRootForLocalFile(virtualFile);
if (jarRoot == null) {
GradleLog.LOG.warn(String.format(
"Can't parse contents of the jar file at path '%s' for the library '%s''", path, gradleLibrary.getName()
));
continue;
}
model.addRoot(jarRoot, pathType.getRootType());
}
model.addRoot(jarRoot, pathType.getRootType());
}
}
}