mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix Android test running under linux
This commit is contained in:
@@ -74,17 +74,18 @@ public class AndroidRootUtil {
|
||||
@Nullable
|
||||
public static VirtualFile getFileByRelativeModulePath(Module module, String relativePath, boolean lookInContentRoot) {
|
||||
String moduleDirPath = new File(module.getModuleFilePath()).getParent();
|
||||
if (moduleDirPath == null) return null;
|
||||
String absPath = FileUtil.toSystemIndependentName(moduleDirPath + relativePath);
|
||||
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(absPath);
|
||||
if (file != null) {
|
||||
return file;
|
||||
if (moduleDirPath != null) {
|
||||
String absPath = FileUtil.toSystemIndependentName(moduleDirPath + relativePath);
|
||||
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(absPath);
|
||||
if (file != null) {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
if (lookInContentRoot) {
|
||||
for (VirtualFile contentRoot : ModuleRootManager.getInstance(module).getContentRoots()) {
|
||||
absPath = FileUtil.toSystemIndependentName(contentRoot.getPath() + relativePath);
|
||||
file = LocalFileSystem.getInstance().findFileByPath(absPath);
|
||||
String absPath = FileUtil.toSystemIndependentName(contentRoot.getPath() + relativePath);
|
||||
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(absPath);
|
||||
if (file != null) {
|
||||
return file;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user