void () { final String firstFile = createFile("d1/xxx.txt", "first"); final String secondFile = createFile("d2/xxx.txt", "second"); final String fooFile = createFile("d3/xxx.txt", "foo"); final JpsArtifact a = addArtifact( root().dir("ddd") .dirCopy(PathUtil.getParentPath(firstFile)) .dirCopy(PathUtil.getParentPath(fooFile)).parentDirCopy(secondFile).end() ); buildAll(); assertOutput(a, fs().dir("ddd").file("xxx.txt", "first")); buildAllAndAssertUpToDate(); change(firstFile, "first2"); buildAll(); assertDeletedAndCopied("out/artifacts/a/ddd/xxx.txt", "d1/xxx.txt"); assertOutput(a, fs().dir("ddd").file("xxx.txt", "first2")); buildAllAndAssertUpToDate(); change(secondFile); buildAllAndAssertUpToDate(); change(fooFile); buildAllAndAssertUpToDate(); delete(fooFile); buildAllAndAssertUpToDate(); delete(secondFile); buildAllAndAssertUpToDate(); }