Search in sources :

Example 16 with CustomCommandLine

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

the class CustomCommandLineTest method testCustomMultiArgs.

@Test
public void testCustomMultiArgs() {
    CustomCommandLine cl = CustomCommandLine.builder().add(new CustomMultiArgv() {

        @Override
        public ImmutableList<String> argv() {
            return ImmutableList.of("--arg1", "--arg2");
        }
    }).build();
    assertEquals(ImmutableList.of("--arg1", "--arg2"), cl.arguments());
}
Also used : CustomCommandLine(com.google.devtools.build.lib.analysis.actions.CustomCommandLine) CustomMultiArgv(com.google.devtools.build.lib.analysis.actions.CustomCommandLine.CustomMultiArgv) Test(org.junit.Test)

Example 17 with CustomCommandLine

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

the class CustomCommandLineTest method testPathArgs.

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

Example 18 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 19 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 20 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)

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