Allow Soong to generate its own build documentation
Add a rule in soong that re-executes soong_build in order to generate build documentation. This allows Soong to customize the documentation. Bug: 70516282 Test: m soong_docs Change-Id: If143cfacd6ac20274cd7bb8d8fab0c07025a5553
This commit is contained in:
@@ -25,6 +25,14 @@ import (
|
||||
"android/soong/android"
|
||||
)
|
||||
|
||||
var (
|
||||
docFile string
|
||||
)
|
||||
|
||||
func init() {
|
||||
flag.StringVar(&docFile, "soong_docs", "", "build documentation file to output")
|
||||
}
|
||||
|
||||
func newNameResolver(config android.Config) *android.NameResolver {
|
||||
namespacePathsToExport := make(map[string]bool)
|
||||
|
||||
@@ -56,9 +64,17 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if docFile != "" {
|
||||
configuration.SetStopBefore(bootstrap.StopBeforePrepareBuildActions)
|
||||
}
|
||||
|
||||
ctx.SetNameInterface(newNameResolver(configuration))
|
||||
|
||||
ctx.SetAllowMissingDependencies(configuration.AllowMissingDependencies())
|
||||
|
||||
bootstrap.Main(ctx.Context, configuration, configuration.ConfigFileName, configuration.ProductVariablesFileName)
|
||||
|
||||
if docFile != "" {
|
||||
writeDocs(ctx, docFile)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user