Search in sources :

Example 21 with JpsArtifact

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

the class ArtifactBuilderTest method testTwoDirsInArchive.

public void testTwoDirsInArchive() {
    final String dir1 = PathUtil.getParentPath(PathUtil.getParentPath(createFile("dir1/a/x.txt")));
    final String dir2 = PathUtil.getParentPath(PathUtil.getParentPath(createFile("dir2/a/y.txt")));
    final JpsArtifact a = addArtifact(root().archive("a.jar").dirCopy(dir1).dirCopy(dir2).dir("a").fileCopy(createFile("z.txt")));
    buildAll();
    assertOutput(a, fs().archive("a.jar").dir("a").file("x.txt").file("y.txt").file("z.txt"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 22 with JpsArtifact

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

the class ArtifactBuilderTest method testArtifactContainingSelfIncludingArtifact.

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

Example 23 with JpsArtifact

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

the class ArtifactBuilderTest method testSelfIncludingArtifact.

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

Example 24 with JpsArtifact

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

the class ArtifactBuilderTest method testIncludedArtifact.

public void testIncludedArtifact() {
    final JpsArtifact included = addArtifact("included", root().fileCopy(createFile("aaa.txt")));
    final JpsArtifact a = addArtifact(root().dir("dir").artifact(included).end().fileCopy(createFile("bbb.txt")));
    buildAll();
    assertOutput(included, fs().file("aaa.txt"));
    assertOutput(a, fs().dir("dir").file("aaa.txt").end().file("bbb.txt"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 25 with JpsArtifact

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

the class ArtifactBuilderTest method testExtractDirectory.

public void testExtractDirectory() {
    final JpsArtifact a = addArtifact("a", root().dir("dir").extractedDir(getJUnitJarPath(), "/junit/textui/"));
    buildAll();
    assertOutput(a, fs().dir("dir").file("ResultPrinter.class").file("TestRunner.class"));
}
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