Refresh local file system to update content of the jar
This commit is contained in:
@@ -187,9 +187,9 @@ public class KotlinRuntimeLibraryUtil {
|
|||||||
return kotlinRuntimeJar;
|
return kotlinRuntimeJar;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void replaceFile(File updatedFile, VirtualFile replacedFile) {
|
static void replaceFile(File updatedFile, VirtualFile replacedJarFile) {
|
||||||
try {
|
try {
|
||||||
String localPath = com.intellij.util.PathUtil.getLocalPath(replacedFile);
|
String localPath = com.intellij.util.PathUtil.getLocalPath(replacedJarFile);
|
||||||
assert localPath != null;
|
assert localPath != null;
|
||||||
|
|
||||||
File libraryJarPath = new File(localPath);
|
File libraryJarPath = new File(localPath);
|
||||||
@@ -199,11 +199,14 @@ public class KotlinRuntimeLibraryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileUtil.copy(updatedFile, libraryJarPath);
|
FileUtil.copy(updatedFile, libraryJarPath);
|
||||||
|
|
||||||
|
VirtualFile localFile = JarFileSystem.getInstance().getLocalVirtualFileFor(replacedJarFile);
|
||||||
|
if (localFile != null) {
|
||||||
|
localFile.refresh(false, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
replacedFile.refresh(true, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user