Search in sources :

Example 11 with JpsArtifact

use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.

the class ArtifactBuilderOverwriteTest method testFileOrder.

public void testFileOrder() {
    final String firstFile = createFile("d1/xxx.txt", "first");
    final String secondFile = createFile("d2/xxx.txt", "second");
    final String fooFile = createFile("d3/xxx.txt", "foo");
    final JpsArtifact a = addArtifact(root().dir("ddd").dirCopy(PathUtil.getParentPath(firstFile)).dirCopy(PathUtil.getParentPath(fooFile)).parentDirCopy(secondFile).end());
    buildAll();
    assertOutput(a, fs().dir("ddd").file("xxx.txt", "first"));
    buildAllAndAssertUpToDate();
    change(firstFile, "first2");
    buildAll();
    assertDeletedAndCopied("out/artifacts/a/ddd/xxx.txt", "d1/xxx.txt");
    assertOutput(a, fs().dir("ddd").file("xxx.txt", "first2"));
    buildAllAndAssertUpToDate();
    change(secondFile);
    buildAllAndAssertUpToDate();
    change(fooFile);
    buildAllAndAssertUpToDate();
    delete(fooFile);
    buildAllAndAssertUpToDate();
    delete(secondFile);
    buildAllAndAssertUpToDate();
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 12 with JpsArtifact

use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.

the class ArtifactBuilderTest method testFileCopy.

public void testFileCopy() {
    final JpsArtifact a = addArtifact(root().fileCopy(createFile("file.txt", "foo")));
    buildAll();
    assertOutput(a, fs().file("file.txt", "foo"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 13 with JpsArtifact

use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.

the class ArtifactBuilderTest method testRepackNonExistentJarFile.

public void testRepackNonExistentJarFile() {
    JpsArtifact a = addArtifact(archive("a.jar").extractedDir("this-file-does-not-exist.jar", "/").fileCopy(createFile("a.txt")));
    buildAll();
    assertOutput(a, fs().archive("a.jar").file("a.txt"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 14 with JpsArtifact

use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.

the class ArtifactBuilderTest method testArtifactContainingSelfIncludingArtifactWithoutOutput.

public void testArtifactContainingSelfIncludingArtifactWithoutOutput() {
    final JpsArtifact a = addArtifact("a", root());
    LayoutElementTestUtil.addArtifactToLayout(a, a);
    final JpsArtifact b = addArtifact("b", root().artifact(a));
    a.setOutputPath(null);
    assertBuildFailed(b);
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 15 with JpsArtifact

use of org.jetbrains.jps.model.artifact.JpsArtifact in project intellij-community by JetBrains.

the class ArtifactBuilderTest method testArchiveInArchive.

public void testArchiveInArchive() {
    final JpsArtifact a = addArtifact(root().archive("a.jar").archive("b.jar").fileCopy(createFile("xxx.txt", "foo")));
    buildAll();
    assertOutput(a, fs().archive("a.jar").archive("b.jar").file("xxx.txt", "foo"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Aggregations

JpsArtifact (org.jetbrains.jps.model.artifact.JpsArtifact)85 File (java.io.File)10 JpsModule (org.jetbrains.jps.model.module.JpsModule)10 JarFile (java.util.jar.JarFile)4 ZipFile (java.util.zip.ZipFile)4 IOException (java.io.IOException)3 NotNull (org.jetbrains.annotations.NotNull)3 CompilerMessage (org.jetbrains.jps.incremental.messages.CompilerMessage)3 JpsCompositePackagingElement (org.jetbrains.jps.model.artifact.elements.JpsCompositePackagingElement)3 THashSet (gnu.trove.THashSet)2 JpsAndroidModuleExtension (org.jetbrains.jps.android.model.JpsAndroidModuleExtension)2 JpsElement (org.jetbrains.jps.model.JpsElement)2 JpsPackagingElement (org.jetbrains.jps.model.artifact.elements.JpsPackagingElement)2 JpsLibrary (org.jetbrains.jps.model.library.JpsLibrary)2 BuildFileProperty (com.intellij.lang.ant.config.impl.BuildFileProperty)1 SmartList (com.intellij.util.SmartList)1 HashMap (com.intellij.util.containers.HashMap)1 HashSet (com.intellij.util.containers.HashSet)1 MultiMap (com.intellij.util.containers.MultiMap)1 TIntObjectHashMap (gnu.trove.TIntObjectHashMap)1