Loading android/rule_builder.go +9 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,15 @@ func (c *RuleBuilderCommand) FlagWithArg(flag, arg string) *RuleBuilderCommand { return c.Text(flag + arg) } // FlagForEachArg adds the specified flag joined with each argument to the command line. The result is identical to // calling FlagWithArg for argument. func (c *RuleBuilderCommand) FlagForEachArg(flag string, args []string) *RuleBuilderCommand { for _, arg := range args { c.FlagWithArg(flag, arg) } return c } // FlagWithArg adds the specified flag and list of arguments to the command line, with the arguments joined by sep // and no separator between the flag and arguments. The flag and arguments 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 @@ -117,6 +117,14 @@ func ExampleRuleBuilderCommand_FlagWithArg() { // ls --sort=time } func ExampleRuleBuilderCommand_FlagForEachArg() { fmt.Println(NewRuleBuilder().Command(). Tool("ls"). FlagForEachArg("--sort=", []string{"time", "size"})) // Output: // ls --sort=time --sort=size } func ExampleRuleBuilderCommand_FlagForEachInput() { fmt.Println(NewRuleBuilder().Command(). Tool("turbine"). Loading Loading
android/rule_builder.go +9 −0 Original line number Diff line number Diff line Loading @@ -294,6 +294,15 @@ func (c *RuleBuilderCommand) FlagWithArg(flag, arg string) *RuleBuilderCommand { return c.Text(flag + arg) } // FlagForEachArg adds the specified flag joined with each argument to the command line. The result is identical to // calling FlagWithArg for argument. func (c *RuleBuilderCommand) FlagForEachArg(flag string, args []string) *RuleBuilderCommand { for _, arg := range args { c.FlagWithArg(flag, arg) } return c } // FlagWithArg adds the specified flag and list of arguments to the command line, with the arguments joined by sep // and no separator between the flag and arguments. The flag and arguments 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 @@ -117,6 +117,14 @@ func ExampleRuleBuilderCommand_FlagWithArg() { // ls --sort=time } func ExampleRuleBuilderCommand_FlagForEachArg() { fmt.Println(NewRuleBuilder().Command(). Tool("ls"). FlagForEachArg("--sort=", []string{"time", "size"})) // Output: // ls --sort=time --sort=size } func ExampleRuleBuilderCommand_FlagForEachInput() { fmt.Println(NewRuleBuilder().Command(). Tool("turbine"). Loading