Add RuleBuilder.Installs().String()
Add a RuleBuilderInstalls type for a slice of RuleBuilderInstalls, and give it a String() method that returns the list of installs in the format that is convenient for passing to Make. Test: rule_builder_test.go Change-Id: I2e9cd9abf4dfb0ad312d0a6662f1567baf9cd222
This commit is contained in:
@@ -84,6 +84,19 @@ func ExampleRuleBuilder_DeleteTemporaryFiles() {
|
||||
// outputs: ["c"]
|
||||
}
|
||||
|
||||
func ExampleRuleBuilder_Installs() {
|
||||
rule := NewRuleBuilder()
|
||||
|
||||
rule.Command().Tool("ld").Inputs([]string{"a.o", "b.o"}).FlagWithOutput("-o ", "linked")
|
||||
rule.Install("linked", "/bin/linked")
|
||||
rule.Install("linked", "/sbin/linked")
|
||||
|
||||
fmt.Printf("rule.Installs().String() = %q\n", rule.Installs().String())
|
||||
|
||||
// Output:
|
||||
// rule.Installs().String() = "linked:/bin/linked linked:/sbin/linked"
|
||||
}
|
||||
|
||||
func ExampleRuleBuilderCommand() {
|
||||
rule := NewRuleBuilder()
|
||||
|
||||
|
Reference in New Issue
Block a user