Search in sources :

Example 71 with JpsArtifact

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

the class ArtifactBuilderTest method testDir.

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

Example 72 with JpsArtifact

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

the class ArtifactBuilderTest method testCircularInclusion.

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

Example 73 with JpsArtifact

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

the class ArtifactBuilderTest method testCopyResourcesFromModuleOutput.

public void testCopyResourcesFromModuleOutput() {
    String file = createFile("src/a.xml", "");
    JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(myProject).addResourcePattern("*.xml");
    JpsModule module = addModule("a", PathUtil.getParentPath(file));
    JpsArtifact artifact = addArtifact(root().module(module));
    buildArtifacts(artifact);
    assertOutput(artifact, fs().file("a.xml"));
}
Also used : JpsModule(org.jetbrains.jps.model.module.JpsModule) JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 74 with JpsArtifact

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

the class ArtifactBuilderTest method testClearOutputOnRebuild.

public void testClearOutputOnRebuild() throws IOException {
    String file = createFile("d/a.txt");
    JpsArtifact a = addArtifact(root().parentDirCopy(file));
    buildAll();
    createFileInArtifactOutput(a, "b.txt");
    buildAllAndAssertUpToDate();
    assertOutput(a, fs().file("a.txt").file("b.txt"));
    rebuildAllModulesAndArtifacts();
    assertOutput(a, fs().file("a.txt").file("b.txt"));
}
Also used : JpsArtifact(org.jetbrains.jps.model.artifact.JpsArtifact)

Example 75 with JpsArtifact

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

the class ArtifactBuilderTest method testIgnoredFile.

public void testIgnoredFile() {
    final String file = createFile("a/.svn/a.txt");
    createFile("a/svn/b.txt");
    final JpsArtifact a = addArtifact(root().parentDirCopy(PathUtil.getParentPath(file)));
    buildAll();
    assertOutput(a, fs().dir("svn").file("b.txt"));
}
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