use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class RebuildArtifactOnConfigurationChangeTest method testAddRoot.
public void testAddRoot() {
String dir1 = PathUtil.getParentPath(createFile("dir1/a.txt", "a"));
String dir2 = PathUtil.getParentPath(createFile("dir2/b.txt", "b"));
JpsArtifact a = addArtifact(root().dirCopy(dir1));
buildAll();
assertOutput(a, fs().file("a.txt", "a"));
a.getRootElement().addChild(JpsPackagingElementFactory.getInstance().createDirectoryCopy(dir2));
buildAll();
assertOutput(a, fs().file("a.txt", "a").file("b.txt", "b"));
assertDeletedAndCopied("out/artifacts/a/a.txt", "dir1/a.txt", "dir2/b.txt");
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class RebuildArtifactOnConfigurationChangeTest method testChangeOutput.
public void testChangeOutput() {
String file = createFile("dir/a.txt");
JpsArtifact a = addArtifact(root().parentDirCopy(file));
buildAll();
String oldOutput = a.getOutputPath();
assertNotNull(oldOutput);
assertOutput(oldOutput, fs().file("a.txt"));
String newOutput = PathUtil.getParentPath(oldOutput) + "/a2";
a.setOutputPath(newOutput);
buildAll();
assertOutput(newOutput, fs().file("a.txt"));
assertOutput(oldOutput, fs());
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class CleanArtifactOutputOnRebuildTest method testCleanArtifactOutputIfItIsIncludedIntoAnotherArtifact.
public void testCleanArtifactOutputIfItIsIncludedIntoAnotherArtifact() {
JpsArtifact included = addArtifact("b", root().fileCopy(createFile("a.txt")));
JpsArtifact a = addArtifact(root().artifact(included));
buildArtifacts(a, included);
createFileInArtifactOutput(included, "b.txt");
assertOutput(included, fs().file("a.txt").file("b.txt"));
rebuildAllModulesAndArtifacts();
assertOutput(included, 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 testAddFileToArchive.
public void testAddFileToArchive() {
String file = createFile("dir/a.txt");
JpsArtifact a = addArtifact("a", archive("a.jar").parentDirCopy(file));
buildAll();
assertOutput(a, fs().archive("a.jar").file("a.txt"));
createFile("dir/b.txt");
buildAll();
assertOutput(a, fs().archive("a.jar").file("a.txt").file("b.txt"));
assertCopied("dir/a.txt", "dir/b.txt");
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class IncrementalArtifactBuildingTest method testDeleteFileAndRebuildIncludedArtifact.
public void testDeleteFileAndRebuildIncludedArtifact() {
String file1 = createFile("d/1.txt");
createFile("d/2.txt");
JpsArtifact included = addArtifact("i", root().parentDirCopy(file1));
JpsArtifact a = addArtifact(root().artifact(included));
buildAllModulesAndArtifacts();
assertOutput(included, fs().file("1.txt").file("2.txt"));
assertOutput(a, fs().file("1.txt").file("2.txt"));
delete(file1);
//to trigger rebuild only for 'i'
delete(included.getOutputPath());
//doBuild(CompileScopeTestBuilder.rebuild().artifact(included)).assertSuccessful();
doBuild(CompileScopeTestBuilder.make().artifact(included)).assertSuccessful();
assertOutput(included, fs().file("2.txt"));
assertOutput(a, fs().file("1.txt").file("2.txt"));
buildAllModulesAndArtifacts();
assertOutput(a, fs().file("2.txt"));
}
Aggregations