Convert droidstubs to android.RuleBuilder

The droiddoc rules are ripe for converting to android.RuleBuilder,
they conditionally use many input files which is hard to track
with the standard blueprint.Rule style, as the argument and the
dependency have to be handled independently.  Start converting
to android.RuleBuilder by converting the droidstubs module.

Test: m docs
Test: m checkapi
Test: m updateapi
Change-Id: I08713e91149471e88a40115f69824cf5eaf88fb6
This commit is contained in:
Colin Cross
2019-07-11 11:01:22 -07:00
parent 7ad7e034f7
commit 33961b54e6
4 changed files with 398 additions and 315 deletions

View File

@@ -95,6 +95,16 @@ func (once *OncePer) Once2StringSlice(key OnceKey, value func() ([]string, []str
return s[0], s[1]
}
// OncePath is the same as Once, but returns the value cast to a Path
func (once *OncePer) OncePath(key OnceKey, value func() Path) Path {
return once.Once(key, func() interface{} { return value() }).(Path)
}
// OncePath is the same as Once, but returns the value cast to a SourcePath
func (once *OncePer) OnceSourcePath(key OnceKey, value func() SourcePath) SourcePath {
return once.Once(key, func() interface{} { return value() }).(SourcePath)
}
// OnceKey is an opaque type to be used as the key in calls to Once.
type OnceKey struct {
key interface{}