void () { final String file = createFile("file.txt"); final JpsArtifact a1 = addArtifact("a1", root().dir("dir").fileCopy(file)); final JpsArtifact a2 = addArtifact("a2", root().dir("dir2").fileCopy(file)); buildAll(); buildArtifacts(a1); assertUpToDate(); buildArtifacts(a2); assertUpToDate(); buildAllAndAssertUpToDate(); change(file); buildArtifacts(a1); assertDeletedAndCopied("out/artifacts/a1/dir/file.txt", "file.txt"); buildArtifacts(a1); assertUpToDate(); buildArtifacts(a2); assertDeletedAndCopied("out/artifacts/a2/dir2/file.txt", "file.txt"); buildArtifacts(a2); assertUpToDate(); buildArtifacts(a1); assertUpToDate(); buildAllAndAssertUpToDate(); }