external build: add jps plugins to classpath when IDEA is started by a plugin run configuration

This commit is contained in:
nik
2012-12-03 19:23:49 +04:00
parent c876d45c35
commit e2406d740b
@@ -73,9 +73,14 @@ public class CompileServerClasspathManager {
else if (baseFile.isDirectory()) {
for (String relativePath : StringUtil.split(serverPlugin.getClasspath(), ";")) {
final File jarFile = new File(new File(baseFile, "lib"), relativePath);
File classesDir = new File(baseFile, "classes");
if (jarFile.exists()) {
classpath.add(jarFile.getPath());
}
else if (classesDir.isDirectory()) {
//'plugin run configuration': all module output are copied to 'classes' folder
classpath.add(classesDir.getPath());
}
else {
//development mode: add directory out/classes/production/<jar-name> to classpath, assuming that jar-name is equal to module name
final String moduleName = FileUtil.getNameWithoutExtension(PathUtil.getFileName(relativePath));