Revert "Add Android.bp.list and soong.variables to inputs for soong_docs action" am: cd767eefe5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1344316 Change-Id: I50b091ea6e771f824606ac43723bde1f75a217e5
This commit is contained in:
commit
66406dd5df
|
@ -93,9 +93,8 @@ type config struct {
|
||||||
|
|
||||||
deviceConfig *deviceConfig
|
deviceConfig *deviceConfig
|
||||||
|
|
||||||
srcDir string // the path of the root source directory
|
srcDir string // the path of the root source directory
|
||||||
buildDir string // the path of the build output directory
|
buildDir string // the path of the build output directory
|
||||||
moduleListFile string // the path to the file which lists blueprint files to parse.
|
|
||||||
|
|
||||||
env map[string]string
|
env map[string]string
|
||||||
envLock sync.Mutex
|
envLock sync.Mutex
|
||||||
|
@ -317,7 +316,7 @@ func TestArchConfig(buildDir string, env map[string]string, bp string, fs map[st
|
||||||
|
|
||||||
// New creates a new Config object. The srcDir argument specifies the path to
|
// New creates a new Config object. The srcDir argument specifies the path to
|
||||||
// the root source directory. It also loads the config file, if found.
|
// the root source directory. It also loads the config file, if found.
|
||||||
func NewConfig(srcDir, buildDir string, moduleListFile string) (Config, error) {
|
func NewConfig(srcDir, buildDir string) (Config, error) {
|
||||||
// Make a config with default options
|
// Make a config with default options
|
||||||
config := &config{
|
config := &config{
|
||||||
ConfigFileName: filepath.Join(buildDir, configFileName),
|
ConfigFileName: filepath.Join(buildDir, configFileName),
|
||||||
|
@ -329,8 +328,7 @@ func NewConfig(srcDir, buildDir string, moduleListFile string) (Config, error) {
|
||||||
buildDir: buildDir,
|
buildDir: buildDir,
|
||||||
multilibConflicts: make(map[ArchType]bool),
|
multilibConflicts: make(map[ArchType]bool),
|
||||||
|
|
||||||
moduleListFile: moduleListFile,
|
fs: pathtools.NewOsFs(absSrcDir),
|
||||||
fs: pathtools.NewOsFs(absSrcDir),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
config.deviceConfig = &deviceConfig{
|
config.deviceConfig = &deviceConfig{
|
||||||
|
|
|
@ -904,27 +904,6 @@ func (p OutputPath) buildDir() string {
|
||||||
var _ Path = OutputPath{}
|
var _ Path = OutputPath{}
|
||||||
var _ WritablePath = OutputPath{}
|
var _ WritablePath = OutputPath{}
|
||||||
|
|
||||||
// toolDepPath is a Path representing a dependency of the build tool.
|
|
||||||
type toolDepPath struct {
|
|
||||||
basePath
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ Path = toolDepPath{}
|
|
||||||
|
|
||||||
// pathForBuildToolDep joins the provided paths and returns a toolDepPath that
|
|
||||||
// is validated to not contain invalid characters.
|
|
||||||
// There is no validation for the base directory of the constructed path.
|
|
||||||
// Only use this function to construct paths for depenencies of the build
|
|
||||||
// tool invocation.
|
|
||||||
// On error, it will return a usable, but invalid toolDepPath, and report a ModuleError.
|
|
||||||
func pathForBuildToolDep(ctx PathContext, pathComponents ...string) toolDepPath {
|
|
||||||
path, err := validatePath(pathComponents...)
|
|
||||||
if err != nil {
|
|
||||||
reportPathError(ctx, err)
|
|
||||||
}
|
|
||||||
return toolDepPath{basePath{path, ctx.Config(), ""}}
|
|
||||||
}
|
|
||||||
|
|
||||||
// PathForOutput joins the provided paths and returns an OutputPath that is
|
// PathForOutput joins the provided paths and returns an OutputPath that is
|
||||||
// validated to not escape the build dir.
|
// validated to not escape the build dir.
|
||||||
// On error, it will return a usable, but invalid OutputPath, and report a ModuleError.
|
// On error, it will return a usable, but invalid OutputPath, and report a ModuleError.
|
||||||
|
|
|
@ -44,10 +44,6 @@ func primaryBuilderPath(ctx SingletonContext) Path {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *docsSingleton) GenerateBuildActions(ctx SingletonContext) {
|
func (c *docsSingleton) GenerateBuildActions(ctx SingletonContext) {
|
||||||
var deps Paths
|
|
||||||
deps = append(deps, pathForBuildToolDep(ctx, ctx.Config().moduleListFile))
|
|
||||||
deps = append(deps, pathForBuildToolDep(ctx, ctx.Config().ProductVariablesFileName))
|
|
||||||
|
|
||||||
// Generate build system docs for the primary builder. Generating docs reads the source
|
// Generate build system docs for the primary builder. Generating docs reads the source
|
||||||
// files used to build the primary builder, but that dependency will be picked up through
|
// files used to build the primary builder, but that dependency will be picked up through
|
||||||
// the dependency on the primary builder itself. There are no dependencies on the
|
// the dependency on the primary builder itself. There are no dependencies on the
|
||||||
|
@ -67,7 +63,6 @@ func (c *docsSingleton) GenerateBuildActions(ctx SingletonContext) {
|
||||||
ctx.Build(pctx, BuildParams{
|
ctx.Build(pctx, BuildParams{
|
||||||
Rule: soongDocs,
|
Rule: soongDocs,
|
||||||
Output: docsFile,
|
Output: docsFile,
|
||||||
Inputs: deps,
|
|
||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"outDir": PathForOutput(ctx, "docs").String(),
|
"outDir": PathForOutput(ctx, "docs").String(),
|
||||||
},
|
},
|
||||||
|
|
|
@ -59,7 +59,7 @@ func main() {
|
||||||
ctx := android.NewContext()
|
ctx := android.NewContext()
|
||||||
ctx.Register()
|
ctx.Register()
|
||||||
|
|
||||||
configuration, err := android.NewConfig(srcDir, bootstrap.BuildDir, bootstrap.ModuleListFile)
|
configuration, err := android.NewConfig(srcDir, bootstrap.BuildDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "%s", err)
|
fmt.Fprintf(os.Stderr, "%s", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|
|
@ -66,8 +66,6 @@ func testForDanglingRules(ctx Context, config Config) {
|
||||||
outDir := config.OutDir()
|
outDir := config.OutDir()
|
||||||
bootstrapDir := filepath.Join(outDir, "soong", ".bootstrap")
|
bootstrapDir := filepath.Join(outDir, "soong", ".bootstrap")
|
||||||
miniBootstrapDir := filepath.Join(outDir, "soong", ".minibootstrap")
|
miniBootstrapDir := filepath.Join(outDir, "soong", ".minibootstrap")
|
||||||
modulePathsDir := filepath.Join(outDir, ".module_paths")
|
|
||||||
variablesFilePath := filepath.Join(outDir, "soong", "soong.variables")
|
|
||||||
|
|
||||||
danglingRules := make(map[string]bool)
|
danglingRules := make(map[string]bool)
|
||||||
|
|
||||||
|
@ -78,10 +76,7 @@ func testForDanglingRules(ctx Context, config Config) {
|
||||||
// Leaf node is not in the out directory.
|
// Leaf node is not in the out directory.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(line, bootstrapDir) ||
|
if strings.HasPrefix(line, bootstrapDir) || strings.HasPrefix(line, miniBootstrapDir) {
|
||||||
strings.HasPrefix(line, miniBootstrapDir) ||
|
|
||||||
strings.HasPrefix(line, modulePathsDir) ||
|
|
||||||
line == variablesFilePath {
|
|
||||||
// Leaf node is in one of Soong's bootstrap directories, which do not have
|
// Leaf node is in one of Soong's bootstrap directories, which do not have
|
||||||
// full build rules in the primary build.ninja file.
|
// full build rules in the primary build.ninja file.
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue