void () { VirtualFile file2 = createFile("1.txt", "a"); final Artifact a = addArtifact(root().dir("dir").file(file2)); make(a); assertOutput(a, fs().dir("dir").file("1.txt")); VirtualFile file = createFile("2.txt", "a"); WriteAction.runAndWait(() -> { ModifiableArtifactModel model = getArtifactManager().createModifiableModel(); CompositePackagingElement<?> rootElement = model.getOrCreateModifiableArtifact(a).getRootElement(); DirectoryPackagingElement element = (DirectoryPackagingElement) rootElement.getChildren().get(0); element.addFirstChild(PackagingElementFactory.getInstance().createFileCopy(file.getPath(), null)); model.commit(); }); make(a); assertOutput(a, fs().dir("dir").file("1.txt").file("2.txt")); }