Revert "Rewrite sbox to use a textproto manifest"

This reverts commit 151b9ff0cf.

Reason for revert: broke builds

Change-Id: I69b3b8795d5a36b4fa0debb1af2d433be3c15d6c
This commit is contained in:
Colin Cross
2020-11-20 18:44:31 +00:00
parent 151b9ff0cf
commit 619b9ab260
12 changed files with 245 additions and 756 deletions

View File

@@ -417,23 +417,18 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
g.rawCommands = append(g.rawCommands, rawCommand)
// Pick a unique path outside the task.genDir for the sbox manifest textproto,
// a unique rule name, and the user-visible description.
manifestName := g.subDir + "genrule.sbox.textproto"
// Pick a unique rule name and the user-visible description.
desc := "generate"
name := "generator"
if task.shards > 0 {
manifestName = g.subDir + "genrule_" + strconv.Itoa(task.shard) + ".sbox.textproto"
desc += " " + strconv.Itoa(task.shard)
name += strconv.Itoa(task.shard)
} else if len(task.out) == 1 {
desc += " " + task.out[0].Base()
}
manifestPath := android.PathForModuleOut(ctx, manifestName)
// Use a RuleBuilder to create a rule that runs the command inside an sbox sandbox.
rule := android.NewRuleBuilder().Sbox(task.genDir, manifestPath)
rule := android.NewRuleBuilder().Sbox(task.genDir)
cmd := rule.Command()
cmd.Text(rawCommand)
cmd.ImplicitOutputs(task.out)