Search in sources :

Example 21 with CustomCommandLine

use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.

the class CustomCommandLineTest method testStringArgs.

@Test
public void testStringArgs() {
    CustomCommandLine cl = CustomCommandLine.builder().add("--arg1").add("--arg2").build();
    assertEquals(ImmutableList.of("--arg1", "--arg2"), cl.arguments());
}
Also used : CustomCommandLine(com.google.devtools.build.lib.analysis.actions.CustomCommandLine) Test(org.junit.Test)

Example 22 with CustomCommandLine

use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.

the class CustomCommandLineTest method testAddNulls.

@Test
public void testAddNulls() {
    CustomCommandLine cl = CustomCommandLine.builder().add("--args", null).addExecPaths(null, ImmutableList.of(artifact1)).addExecPath(null, null).build();
    assertEquals(ImmutableList.of(), cl.arguments());
}
Also used : CustomCommandLine(com.google.devtools.build.lib.analysis.actions.CustomCommandLine) Test(org.junit.Test)

Example 23 with CustomCommandLine

use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.

the class CustomCommandLineTest method testPathsArgs.

@Test
public void testPathsArgs() {
    CustomCommandLine cl = CustomCommandLine.builder().addPaths("%s:%s", artifact1.getExecPath(), artifact1.getRootRelativePath()).build();
    assertEquals(ImmutableList.of("dir/file1.txt:dir/file1.txt"), cl.arguments());
}
Also used : CustomCommandLine(com.google.devtools.build.lib.analysis.actions.CustomCommandLine) Test(org.junit.Test)

Example 24 with CustomCommandLine

use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.

the class CustomCommandLineTest method testNestedSetArtifactExecPathsArgs.

@Test
public void testNestedSetArtifactExecPathsArgs() {
    CustomCommandLine cl = CustomCommandLine.builder().addExecPaths(NestedSetBuilder.<Artifact>stableOrder().add(artifact1).add(artifact2).build()).build();
    assertEquals(ImmutableList.of("dir/file1.txt", "dir/file2.txt"), cl.arguments());
}
Also used : CustomCommandLine(com.google.devtools.build.lib.analysis.actions.CustomCommandLine) Test(org.junit.Test)

Example 25 with CustomCommandLine

use of com.google.devtools.build.lib.analysis.actions.CustomCommandLine in project bazel by bazelbuild.

the class CustomCommandLineTest method testArtifactJoinExecPathArgs.

@Test
public void testArtifactJoinExecPathArgs() {
    CustomCommandLine cl = CustomCommandLine.builder().addJoinExecPaths("--path", ":", ImmutableList.of(artifact1, artifact2)).build();
    assertEquals(ImmutableList.of("--path", "dir/file1.txt:dir/file2.txt"), cl.arguments());
}
Also used : CustomCommandLine(com.google.devtools.build.lib.analysis.actions.CustomCommandLine) Test(org.junit.Test)

Aggregations

CustomCommandLine (com.google.devtools.build.lib.analysis.actions.CustomCommandLine)28 Test (org.junit.Test)22 Artifact (com.google.devtools.build.lib.actions.Artifact)6 TreeFileArtifact (com.google.devtools.build.lib.actions.Artifact.TreeFileArtifact)5 SpecialArtifact (com.google.devtools.build.lib.actions.Artifact.SpecialArtifact)3 TransitiveInfoCollection (com.google.devtools.build.lib.analysis.TransitiveInfoCollection)3 ParameterFileWriteAction (com.google.devtools.build.lib.analysis.actions.ParameterFileWriteAction)3 ToolchainInvocation (com.google.devtools.build.lib.rules.proto.ProtoCompileActionBuilder.ToolchainInvocation)3 SpawnAction (com.google.devtools.build.lib.analysis.actions.SpawnAction)2 LazyString (com.google.devtools.build.lib.util.LazyString)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 FilesToRunProvider (com.google.devtools.build.lib.analysis.FilesToRunProvider)1 CustomArgv (com.google.devtools.build.lib.analysis.actions.CustomCommandLine.CustomArgv)1 CustomMultiArgv (com.google.devtools.build.lib.analysis.actions.CustomCommandLine.CustomMultiArgv)1 NestedSetBuilder (com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder)1 AppleConfiguration (com.google.devtools.build.lib.rules.apple.AppleConfiguration)1 Platform (com.google.devtools.build.lib.rules.apple.Platform)1 DotdFile (com.google.devtools.build.lib.rules.cpp.CppCompileAction.DotdFile)1 PathFragment (com.google.devtools.build.lib.vfs.PathFragment)1 HashSet (java.util.HashSet)1