mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix tests: search for jars in IDEA_HOME/community/lib folder
This commit is contained in:
@@ -251,8 +251,7 @@ public class LibraryDownloader {
|
||||
if (url.startsWith(LIB_SCHEMA)) {
|
||||
indicator.setText2(IdeBundle.message("progress.locate.jar.text", getExpectedFileName(libraryInfo)));
|
||||
final String path = url.substring(LIB_SCHEMA.length()).replace('/', File.separatorChar);
|
||||
final String fullPath = PathManager.getLibPath() + File.separatorChar + path;
|
||||
final File file = new File(fullPath);
|
||||
final File file = PathManager.findFileInLibDirectory(path);
|
||||
downloadedFiles.add(Pair.create(libraryInfo, file));
|
||||
} else if (url.startsWith(LocalFileSystem.PROTOCOL_PREFIX)) {
|
||||
String path = url.substring(LocalFileSystem.PROTOCOL_PREFIX.length()).replace('/', File.separatorChar).replace('\\', File.separatorChar);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.SystemProperties;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
@@ -372,4 +373,12 @@ public class PathManager {
|
||||
|
||||
return systemPath + File.separator + PLUGINS_DIRECTORY;
|
||||
}
|
||||
|
||||
public static File findFileInLibDirectory(@NotNull String relativePath) {
|
||||
File file = new File(getLibPath() + File.separator + relativePath);
|
||||
if (file.exists()) {
|
||||
return file;
|
||||
}
|
||||
return new File(getHomePath() + File.separator + "community" + File.separator + "lib" + File.separator + relativePath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,7 @@ public class GlobalAntConfiguration implements ApplicationComponent, JDOMExterna
|
||||
}
|
||||
};
|
||||
AntInstallation.NAME.set(bundledAnt.getProperties(), BUNDLED_ANT_NAME);
|
||||
final File ideaLib = new File(PathManager.getLibPath());
|
||||
final File antHome = new File(ideaLib, ANT_FILE);
|
||||
final File antHome = PathManager.findFileInLibDirectory(ANT_FILE);
|
||||
AntInstallation.HOME_DIR.set(bundledAnt.getProperties(), antHome.getAbsolutePath());
|
||||
ArrayList<AntClasspathEntry> classpath = AntInstallation.CLASS_PATH.getModifiableList(bundledAnt.getProperties());
|
||||
File antLibDir = new File(antHome, LIB_DIR);
|
||||
|
||||
@@ -251,7 +251,7 @@ public final class PreviewFormAction extends AnAction{
|
||||
// 3. Now we are ready to launch Java process
|
||||
final JavaParameters parameters = new JavaParameters();
|
||||
parameters.getClassPath().add(tempPath);
|
||||
parameters.getClassPath().add(PathManager.getLibPath() + "/jgoodies-forms.jar");
|
||||
parameters.getClassPath().add(PathManager.findFileInLibDirectory("jgoodies-forms.jar").getAbsolutePath());
|
||||
final List<String> paths = sources.getPathList();
|
||||
for (final String path : paths) {
|
||||
parameters.getClassPath().add(path);
|
||||
|
||||
Reference in New Issue
Block a user