Loading android/rule_builder.go +9 −0 Original line number Diff line number Diff line Loading @@ -284,6 +284,15 @@ func (c *RuleBuilderCommand) Flag(flag string) *RuleBuilderCommand { return c.Text(flag) } // Flags adds the specified raw text to the command line. The text should not contain input or output paths or the // rule will not have them listed in its dependencies or outputs. func (c *RuleBuilderCommand) Flags(flags []string) *RuleBuilderCommand { for _, flag := range flags { c.Text(flag) } return c } // FlagWithArg adds the specified flag and argument text to the command line, with no separator between them. The flag // and argument should not contain input or output paths or the rule will not have them listed in its dependencies or // outputs. Loading android/rule_builder_test.go +8 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ func ExampleRuleBuilderCommand_Flag() { // ls -l } func ExampleRuleBuilderCommand_Flags() { ctx := pathContext() fmt.Println(NewRuleBuilder().Command(). Tool(PathForSource(ctx, "ls")).Flags([]string{"-l", "-a"})) // Output: // ls -l -a } func ExampleRuleBuilderCommand_FlagWithArg() { ctx := pathContext() fmt.Println(NewRuleBuilder().Command(). Loading Loading
android/rule_builder.go +9 −0 Original line number Diff line number Diff line Loading @@ -284,6 +284,15 @@ func (c *RuleBuilderCommand) Flag(flag string) *RuleBuilderCommand { return c.Text(flag) } // Flags adds the specified raw text to the command line. The text should not contain input or output paths or the // rule will not have them listed in its dependencies or outputs. func (c *RuleBuilderCommand) Flags(flags []string) *RuleBuilderCommand { for _, flag := range flags { c.Text(flag) } return c } // FlagWithArg adds the specified flag and argument text to the command line, with no separator between them. The flag // and argument should not contain input or output paths or the rule will not have them listed in its dependencies or // outputs. Loading
android/rule_builder_test.go +8 −0 Original line number Diff line number Diff line Loading @@ -171,6 +171,14 @@ func ExampleRuleBuilderCommand_Flag() { // ls -l } func ExampleRuleBuilderCommand_Flags() { ctx := pathContext() fmt.Println(NewRuleBuilder().Command(). Tool(PathForSource(ctx, "ls")).Flags([]string{"-l", "-a"})) // Output: // ls -l -a } func ExampleRuleBuilderCommand_FlagWithArg() { ctx := pathContext() fmt.Println(NewRuleBuilder().Command(). Loading