use of org.jetbrains.jps.model.artifact.JpsArtifact in project android by JetBrains.
the class AndroidJpsUtil method getAndroidArtifactsToBuild.
@NotNull
public static List<JpsArtifact> getAndroidArtifactsToBuild(@NotNull CompileContext context) {
final List<JpsArtifact> artifacts = JpsArtifactService.getInstance().getArtifacts(context.getProjectDescriptor().getProject());
final List<JpsArtifact> result = new ArrayList<JpsArtifact>();
for (JpsArtifact artifact : artifacts) {
if (artifact.getArtifactType() instanceof AndroidApplicationArtifactType && context.getScope().isAffected(new ArtifactBuildTarget(artifact))) {
result.add(artifact);
}
}
return result;
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class ArtifactBuilderOverwriteTest method testOverwriteFileByArchive.
public void testOverwriteFileByArchive() {
final String xFile = createFile("x.txt", "1");
final String jarFile = createFile("lib/junit.jar", "123");
JpsArtifact a = addArtifact(root().archive("junit.jar").fileCopy(xFile).end().parentDirCopy(jarFile));
buildAll();
assertOutput(a, fs().archive("junit.jar").file("x.txt", "1"));
buildAllAndAssertUpToDate();
change(xFile, "2");
buildAll();
assertDeletedAndCopied("out/artifacts/a/junit.jar", "x.txt");
assertOutput(a, fs().archive("junit.jar").file("x.txt", "2"));
buildAllAndAssertUpToDate();
change(jarFile, "321");
buildAllAndAssertUpToDate();
delete(jarFile);
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class ArtifactBuilderOverwriteTest method testOverwriteArchiveByFile.
public void testOverwriteArchiveByFile() {
final String xFile = createFile("d/x.txt", "1");
final String jarFile = createFile("lib/jdom.jar", "123");
JpsArtifact a = addArtifact(root().parentDirCopy(jarFile).archive("jdom.jar").parentDirCopy(xFile));
buildAll();
assertOutput(a, fs().file("jdom.jar", "123"));
buildAllAndAssertUpToDate();
change(xFile, "2");
buildAllAndAssertUpToDate();
change(jarFile, "321");
buildAll();
assertDeletedAndCopied("out/artifacts/a/jdom.jar", "lib/jdom.jar");
assertOutput(a, fs().file("jdom.jar", "321"));
buildAllAndAssertUpToDate();
delete(xFile);
buildAllAndAssertUpToDate();
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class ArtifactBuilderOverwriteTest method testOverwriteExtractedFileByCopied.
public void testOverwriteExtractedFileByCopied() {
String file = createFile("x.txt", "1");
String jar = createArchive("x.jar", "x.txt", "2");
JpsArtifact a = addArtifact(root().fileCopy(file).extractedDir(jar, ""));
buildAll();
assertOutput(a, fs().file("x.txt", "1"));
buildAllAndAssertUpToDate();
delete(jar);
createArchive("x.jar", "x.txt", "3");
buildAll();
assertOutput(a, fs().file("x.txt", "1"));
delete(file);
buildAll();
assertOutput(a, fs().file("x.txt", "3"));
}
use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.
the class ArtifactBuilderOverwriteTest method testOverwriteNestedArchive.
public void testOverwriteNestedArchive() {
final String cFile = createFile("c.txt", "c");
final String eFile = createFile("e.txt", "e");
final JpsArtifact a = addArtifact(root().archive("a.jar").archive("b.jar").fileCopy(cFile).end().end().archive("a.jar").archive("d.jar").fileCopy(eFile));
buildAll();
assertOutput(a, fs().archive("a.jar").archive("b.jar").file("c.txt", "c"));
buildAllAndAssertUpToDate();
change(eFile, "e2");
buildAllAndAssertUpToDate();
change(cFile, "c2");
buildAll();
assertDeletedAndCopied("out/artifacts/a/a.jar", "c.txt");
assertOutput(a, fs().archive("a.jar").archive("b.jar").file("c.txt", "c2"));
buildAllAndAssertUpToDate();
delete(eFile);
buildAllAndAssertUpToDate();
}
Aggregations