Search in sources :

Example 76 with JpsArtifact

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

the class ArtifactBuilderTest method testCopyExcludedFolder.

public void testCopyExcludedFolder() {
    //explicitly added excluded files should be copied (e.g. compile output)
    final String file = createFile("xxx/excluded/a.txt");
    createFile("xxx/excluded/CVS");
    final String excluded = PathUtil.getParentPath(file);
    final String dir = PathUtil.getParentPath(excluded);
    final JpsModule module = addModule("myModule");
    module.getContentRootsList().addUrl(JpsPathUtil.pathToUrl(dir));
    module.getExcludeRootsList().addUrl(JpsPathUtil.pathToUrl(excluded));
    final JpsArtifact a = addArtifact(root().dirCopy(excluded));
    buildAll();
    assertOutput(a, fs().file("a.txt"));
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 77 with JpsArtifact

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

the class ArtifactBuilderTest method testCopyLibrary.

public void testCopyLibrary() {
    final JpsLibrary library = addProjectLibrary("lib", getJUnitJarPath());
    final JpsArtifact a = addArtifact(root().lib(library));
    buildAll();
    assertOutput(a, fs().file("junit.jar"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact) JpsLibrary(org.jetbrains.jps.model.library.JpsLibrary)

Example 78 with JpsArtifact

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

the class ArtifactBuilderTest method testPackExtractedDirectory.

public void testPackExtractedDirectory() {
    final JpsArtifact a = addArtifact("a", root().archive("a.jar").extractedDir(getJUnitJarPath(), "/junit/textui/"));
    buildAll();
    assertOutput(a, fs().archive("a.jar").file("ResultPrinter.class").file("TestRunner.class"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 79 with JpsArtifact

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

the class ArtifactBuilderTest method testDoNotCreateEmptyArchiveInsideArchive.

public void testDoNotCreateEmptyArchiveInsideArchive() {
    String file = createFile("dir/a.txt");
    JpsArtifact a = addArtifact(archive("a.jar").archive("inner.jar").parentDirCopy(file));
    delete(file);
    buildAll();
    assertEmptyOutput(a);
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 80 with JpsArtifact

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

the class ArtifactBuilderTest method testArchive.

public void testArchive() {
    final JpsArtifact a = addArtifact(root().archive("xxx.zip").fileCopy(createFile("X.class", "data")).dir("dir").fileCopy(createFile("Y.class")));
    buildAll();
    assertOutput(a, fs().archive("xxx.zip").file("X.class", "data").dir("dir").file("Y.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