void () { final String firstFile = createFile("d1/xxx.txt", "1"); final String secondFile = createFile("d2/xxx.txt", "2"); final JpsArtifact a = addArtifact("a", root().dir("ddd").dirCopy(PathUtil.getParentPath(firstFile)).parentDirCopy(secondFile).fileCopy(createFile("y.txt")) ); buildAll(); assertOutput(a, fs().dir("ddd").file("xxx.txt", "1").file("y.txt")); delete(firstFile); buildAll(); assertDeletedAndCopied("out/artifacts/a/ddd/xxx.txt", "d2/xxx.txt"); assertOutput(a, fs().dir("ddd").file("xxx.txt", "2").file("y.txt")); buildAllAndAssertUpToDate(); delete(secondFile); buildAll(); assertDeleted("out/artifacts/a/ddd/xxx.txt"); assertOutput(a, fs().dir("ddd").file("y.txt")); }