Search in sources :

Example 1 with SpecialArtifact

use of com.google.devtools.build.lib.actions.Artifact.SpecialArtifact in project bazel by bazelbuild.

the class TreeArtifactMetadataTest method createTreeArtifact.

private Artifact createTreeArtifact(String path) throws IOException {
    PathFragment execPath = new PathFragment("out").getRelative(path);
    Path fullPath = root.getRelative(execPath);
    Artifact output = new SpecialArtifact(fullPath, Root.asDerivedRoot(root, root.getRelative("out")), execPath, ALL_OWNER, SpecialArtifactType.TREE);
    actions.add(new DummyAction(ImmutableList.<Artifact>of(), output));
    FileSystemUtils.createDirectoryAndParents(fullPath);
    return output;
}
Also used : Path(com.google.devtools.build.lib.vfs.Path) SpecialArtifact(com.google.devtools.build.lib.actions.Artifact.SpecialArtifact) DummyAction(com.google.devtools.build.lib.actions.util.TestAction.DummyAction) PathFragment(com.google.devtools.build.lib.vfs.PathFragment) SpecialArtifact(com.google.devtools.build.lib.actions.Artifact.SpecialArtifact) Artifact(com.google.devtools.build.lib.actions.Artifact) TreeFileArtifact(com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact)

Example 2 with SpecialArtifact

use of com.google.devtools.build.lib.actions.Artifact.SpecialArtifact in project bazel by bazelbuild.

the class FilesystemValueCheckerTest method createTreeArtifact.

private Artifact createTreeArtifact(String relPath) throws IOException {
    Path outputDir = fs.getPath("/bin");
    Path outputPath = outputDir.getRelative(relPath);
    outputDir.createDirectory();
    Root derivedRoot = Root.asDerivedRoot(fs.getPath("/"), outputDir);
    return new SpecialArtifact(outputPath, derivedRoot, derivedRoot.getExecPath().getRelative(outputPath.relativeTo(derivedRoot.getPath())), ArtifactOwner.NULL_OWNER, SpecialArtifactType.TREE);
}
Also used : RootedPath(com.google.devtools.build.lib.vfs.RootedPath) Path(com.google.devtools.build.lib.vfs.Path) Root(com.google.devtools.build.lib.actions.Root) SpecialArtifact(com.google.devtools.build.lib.actions.Artifact.SpecialArtifact)

Example 3 with SpecialArtifact

use of com.google.devtools.build.lib.actions.Artifact.SpecialArtifact in project bazel by bazelbuild.

the class TreeArtifactBuildTest method createTreeArtifact.

private Artifact createTreeArtifact(String name) {
    FileSystem fs = scratch.getFileSystem();
    Path execRoot = fs.getPath(TestUtils.tmpDir());
    PathFragment execPath = new PathFragment("out").getRelative(name);
    Path path = execRoot.getRelative(execPath);
    return new SpecialArtifact(path, Root.asDerivedRoot(execRoot, execRoot.getRelative("out")), execPath, ALL_OWNER, SpecialArtifactType.TREE);
}
Also used : Path(com.google.devtools.build.lib.vfs.Path) FileSystem(com.google.devtools.build.lib.vfs.FileSystem) SpecialArtifact(com.google.devtools.build.lib.actions.Artifact.SpecialArtifact) PathFragment(com.google.devtools.build.lib.vfs.PathFragment)

Example 4 with SpecialArtifact

use of com.google.devtools.build.lib.actions.Artifact.SpecialArtifact in project bazel by bazelbuild.

the class ActionTemplateExpansionFunctionTest method createTreeArtifact.

private Artifact createTreeArtifact(String path) {
    PathFragment execPath = new PathFragment("out").getRelative(path);
    Path fullPath = rootDirectory.getRelative(execPath);
    return new SpecialArtifact(fullPath, Root.asDerivedRoot(rootDirectory, rootDirectory.getRelative("out")), execPath, ArtifactOwner.NULL_OWNER, SpecialArtifactType.TREE);
}
Also used : Path(com.google.devtools.build.lib.vfs.Path) SpecialArtifact(com.google.devtools.build.lib.actions.Artifact.SpecialArtifact) PathFragment(com.google.devtools.build.lib.vfs.PathFragment)

Example 5 with SpecialArtifact

use of com.google.devtools.build.lib.actions.Artifact.SpecialArtifact in project bazel by bazelbuild.

the class ArtifactFunctionTest method createDerivedTreeArtifactOnly.

private Artifact createDerivedTreeArtifactOnly(String path) {
    PathFragment execPath = new PathFragment("out").getRelative(path);
    Path fullPath = root.getRelative(execPath);
    return new SpecialArtifact(fullPath, Root.asDerivedRoot(root, root.getRelative("out")), execPath, ALL_OWNER, SpecialArtifactType.TREE);
}
Also used : Path(com.google.devtools.build.lib.vfs.Path) SpecialArtifact(com.google.devtools.build.lib.actions.Artifact.SpecialArtifact) PathFragment(com.google.devtools.build.lib.vfs.PathFragment)

Aggregations

SpecialArtifact (com.google.devtools.build.lib.actions.Artifact.SpecialArtifact)5 Path (com.google.devtools.build.lib.vfs.Path)5 PathFragment (com.google.devtools.build.lib.vfs.PathFragment)4 Artifact (com.google.devtools.build.lib.actions.Artifact)1 TreeFileArtifact (com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact)1 Root (com.google.devtools.build.lib.actions.Root)1 DummyAction (com.google.devtools.build.lib.actions.util.TestAction.DummyAction)1 FileSystem (com.google.devtools.build.lib.vfs.FileSystem)1 RootedPath (com.google.devtools.build.lib.vfs.RootedPath)1