Loading android/bazel_handler.go +9 −2 Original line number Diff line number Diff line Loading @@ -1103,7 +1103,7 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) { } // Register bazel-owned build statements (obtained from the aquery invocation). func createCommand(cmd *RuleBuilderCommand, buildStatement bazel.BuildStatement, executionRoot string, bazelOutDir string, ctx PathContext) { func createCommand(cmd *RuleBuilderCommand, buildStatement bazel.BuildStatement, executionRoot string, bazelOutDir string, ctx BuilderContext) { // executionRoot is the action cwd. cmd.Text(fmt.Sprintf("cd '%s' &&", executionRoot)) Loading @@ -1122,7 +1122,14 @@ func createCommand(cmd *RuleBuilderCommand, buildStatement bazel.BuildStatement, } // The actual Bazel action. if len(buildStatement.Command) > 16*1024 { commandFile := PathForBazelOut(ctx, buildStatement.OutputPaths[0]+".sh") WriteFileRule(ctx, commandFile, buildStatement.Command) cmd.Text("bash").Text(buildStatement.OutputPaths[0] + ".sh").Implicit(commandFile) } else { cmd.Text(buildStatement.Command) } for _, outputPath := range buildStatement.OutputPaths { cmd.ImplicitOutput(PathForBazelOut(ctx, outputPath)) Loading android/bazel_handler_test.go +2 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,8 @@ func TestInvokeBazelPopulatesBuildStatements(t *testing.T) { } cmd := RuleBuilderCommand{} createCommand(&cmd, got[0], "test/exec_root", "test/bazel_out", PathContextForTesting(TestConfig("out", nil, "", nil))) ctx := builderContextForTests{PathContextForTesting(TestConfig("out", nil, "", nil))} createCommand(&cmd, got[0], "test/exec_root", "test/bazel_out", ctx) if actual, expected := cmd.buf.String(), testCase.command; expected != actual { t.Errorf("expected: [%s], actual: [%s]", expected, actual) } Loading Loading
android/bazel_handler.go +9 −2 Original line number Diff line number Diff line Loading @@ -1103,7 +1103,7 @@ func (c *bazelSingleton) GenerateBuildActions(ctx SingletonContext) { } // Register bazel-owned build statements (obtained from the aquery invocation). func createCommand(cmd *RuleBuilderCommand, buildStatement bazel.BuildStatement, executionRoot string, bazelOutDir string, ctx PathContext) { func createCommand(cmd *RuleBuilderCommand, buildStatement bazel.BuildStatement, executionRoot string, bazelOutDir string, ctx BuilderContext) { // executionRoot is the action cwd. cmd.Text(fmt.Sprintf("cd '%s' &&", executionRoot)) Loading @@ -1122,7 +1122,14 @@ func createCommand(cmd *RuleBuilderCommand, buildStatement bazel.BuildStatement, } // The actual Bazel action. if len(buildStatement.Command) > 16*1024 { commandFile := PathForBazelOut(ctx, buildStatement.OutputPaths[0]+".sh") WriteFileRule(ctx, commandFile, buildStatement.Command) cmd.Text("bash").Text(buildStatement.OutputPaths[0] + ".sh").Implicit(commandFile) } else { cmd.Text(buildStatement.Command) } for _, outputPath := range buildStatement.OutputPaths { cmd.ImplicitOutput(PathForBazelOut(ctx, outputPath)) Loading
android/bazel_handler_test.go +2 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,8 @@ func TestInvokeBazelPopulatesBuildStatements(t *testing.T) { } cmd := RuleBuilderCommand{} createCommand(&cmd, got[0], "test/exec_root", "test/bazel_out", PathContextForTesting(TestConfig("out", nil, "", nil))) ctx := builderContextForTests{PathContextForTesting(TestConfig("out", nil, "", nil))} createCommand(&cmd, got[0], "test/exec_root", "test/bazel_out", ctx) if actual, expected := cmd.buf.String(), testCase.command; expected != actual { t.Errorf("expected: [%s], actual: [%s]", expected, actual) } Loading