use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class CleanArtifactOutputOnRebuildTest method testDoNotCleanIfContainsArtifactRoot.
public void testDoNotCleanIfContainsArtifactRoot() {
JpsModule m = addModule("m");
String resDir = PathUtil.getParentPath(createFile("res/a.txt"));
m.getContentRootsList().addUrl(JpsPathUtil.pathToUrl(resDir));
JpsArtifact a = addArtifact(root().dirCopy(resDir));
a.setOutputPath(resDir);
buildArtifacts(a);
assertOutput(a, fs().file("a.txt"));
createFile("res/b.txt");
rebuildAllModulesAndArtifacts();
assertOutput(a, fs().file("a.txt").file("b.txt"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class CleanArtifactOutputOnRebuildTest method testDoNotCleanOnRebuildIfOptionIsSwitchedOff.
public void testDoNotCleanOnRebuildIfOptionIsSwitchedOff() {
JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(myProject).setClearOutputDirectoryOnRebuild(false);
JpsArtifact a = addArtifact(root().fileCopy(createFile("a.txt")));
buildArtifacts(a);
createFileInArtifactOutput(a, "b.txt");
rebuildAllModulesAndArtifacts();
assertOutput(a, fs().file("a.txt").file("b.txt"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class CleanArtifactOutputOnRebuildTest method testCleanOutput.
public void testCleanOutput() {
JpsArtifact a = addArtifact(root().fileCopy(createFile("a.txt")));
buildArtifacts(a);
createFileInArtifactOutput(a, "b.txt");
assertOutput(a, fs().file("a.txt").file("b.txt"));
rebuildAllModulesAndArtifacts();
assertOutput(a, fs().file("a.txt").file("b.txt"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testOneFileInTwoArtifacts.
public void testOneFileInTwoArtifacts() {
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();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testTwoArtifactsWithSameOutput.
//IDEA-51910
public void testTwoArtifactsWithSameOutput() throws Exception {
final String res1 = PathUtil.getParentPath(createFile("res1/a.txt", "1"));
final String res2 = PathUtil.getParentPath(createFile("res2/a.txt", "2"));
final JpsArtifact a1 = addArtifact("a1", root().dirCopy(res1));
final JpsArtifact a2 = addArtifact("a2", root().dirCopy(res2));
a2.setOutputPath(a1.getOutputPath());
assertEquals(a1.getOutputPath(), a2.getOutputPath());
buildArtifacts(a1);
assertOutput(a1, fs().file("a.txt", "1"));
assertOutput(a2, fs().file("a.txt", "1"));
buildArtifacts(a1);
assertUpToDate();
buildArtifacts(a2);
assertOutput(a2, fs().file("a.txt", "2"));
}
Aggregations