mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
follow symlinks when initializing FS state for a build target (IDEA-202775)
This commit is contained in:
@@ -8,6 +8,9 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
||||
import static com.intellij.util.io.TestFileSystemItem.fs;
|
||||
@@ -38,4 +41,17 @@ public class JavaCompilerBasicTest extends BaseCompilerTestCase {
|
||||
make(module);
|
||||
assertOutput(module, fs().file("B.class"));
|
||||
}
|
||||
|
||||
|
||||
public void testSymlinksInSources() throws IOException {
|
||||
final VirtualFile file = createFile("src/A.java", "public class A {}");
|
||||
VirtualFile srcRoot = file.getParent();
|
||||
final File linkFile = new File(srcRoot.getParent().getPath(), "src-link");
|
||||
FileUtil.delete(linkFile); // ensure the link does not exist
|
||||
final Path symlink = Files.createSymbolicLink(linkFile.toPath(), FileSystems.getDefault().getPath(srcRoot.getPath()));
|
||||
|
||||
final Module module = addModule("a", srcRoot.getParent().findChild(symlink.getFileName().toString()));
|
||||
make(module);
|
||||
assertOutput(module, fs().file("A.class"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user