use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testCopyChangedFile.
public void testCopyChangedFile() {
String file1 = createFile("dir/a.txt", "aaa");
createFile("dir/b.txt", "bbb");
final JpsArtifact a = addArtifact(root().parentDirCopy(file1));
buildAll();
assertOutput(a, fs().file("a.txt", "aaa").file("b.txt", "bbb"));
buildAllAndAssertUpToDate();
change(file1, "xxx");
buildAll();
assertDeletedAndCopied("out/artifacts/a/a.txt", "dir/a.txt");
assertOutput(a, fs().file("a.txt", "xxx").file("b.txt", "bbb"));
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testNonExistentDirectoryRoot.
public void testNonExistentDirectoryRoot() throws IOException {
String dir = getAbsolutePath("d");
JpsArtifact a = addArtifact(root().dirCopy(dir));
buildArtifacts(a);
assertEmptyOutput(a);
buildAllAndAssertUpToDate();
FileUtil.createIfDoesntExist(new File(dir, "a.txt"));
buildArtifacts(a);
assertOutput(a, fs().file("a.txt"));
buildAllAndAssertUpToDate();
delete(dir);
buildArtifacts(a);
assertEmptyOutput(a);
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testNonExistentFileRoot.
public void testNonExistentFileRoot() throws IOException {
String file = getAbsolutePath("a.txt");
JpsArtifact a = addArtifact(root().fileCopy(file));
buildArtifacts(a);
assertEmptyOutput(a);
buildAllAndAssertUpToDate();
FileUtil.createIfDoesntExist(new File(file));
buildArtifacts(a);
assertOutput(a, fs().file("a.txt"));
buildAllAndAssertUpToDate();
delete(file);
buildArtifacts(a);
assertEmptyOutput(a);
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class RebuildArtifactOnConfigurationChangeTest method testRemoveRoot.
public void testRemoveRoot() {
String file1 = createFile("dir1/a.txt", "a");
String file2 = createFile("dir2/b.txt", "b");
JpsArtifact a = addArtifact(root().parentDirCopy(file1).parentDirCopy(file2));
buildAll();
assertOutput(a, fs().file("a.txt", "a").file("b.txt", "b"));
a.getRootElement().removeChild(a.getRootElement().getChildren().get(0));
buildAll();
assertOutput(a, fs().file("b.txt", "b"));
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class RebuildArtifactOnConfigurationChangeTest method testChangeConfiguration.
public void testChangeConfiguration() {
String file = createFile("d/a.txt", "a");
JpsArtifact a = addArtifact(root().parentDirCopy(file));
buildAll();
assertOutput(a, fs().file("a.txt", "a"));
a.setRootElement(root().dir("dir").parentDirCopy(file).buildElement());
buildAll();
assertOutput(a, fs().dir("dir").file("a.txt", "a"));
buildAllAndAssertUpToDate();
}
Aggregations