Remove ModuleSrcPath
ModuleSrcPath was designed as a type that ensured that modules only referenced sources inside the directory that contained the Android.bp file. In practice they don't work very well, because allowing filegroups and genrules as inputs to any module that takes a source path means that the path might end up being to a file in another source directory or to a generated file in the output directory. Remove ModuleSrcPath, replacing it with SourcePath in the places that need to explicitly refer to a path in the source tree, or Path where it may be a source path or a generated path. Make PathForModuleSrc return a Path instead of a SourcePath in preparation for consolidation with ctx.ExpandSources, which will make it possibly return paths to generated files. Test: All soong tests Change-Id: I973a78470ed14307eea5f6d0cc93942775a65715
This commit is contained in:
@@ -90,7 +90,7 @@ type headerModule struct {
|
||||
properties headerProperties
|
||||
|
||||
installPaths android.Paths
|
||||
licensePath android.ModuleSrcPath
|
||||
licensePath android.Path
|
||||
}
|
||||
|
||||
func getHeaderInstallDir(ctx android.ModuleContext, header android.Path, from string,
|
||||
@@ -204,7 +204,7 @@ type versionedHeaderModule struct {
|
||||
properties versionedHeaderProperties
|
||||
|
||||
installPaths android.Paths
|
||||
licensePath android.ModuleSrcPath
|
||||
licensePath android.Path
|
||||
}
|
||||
|
||||
func (m *versionedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
@@ -232,7 +232,8 @@ func (m *versionedHeaderModule) GenerateAndroidBuildActions(ctx android.ModuleCo
|
||||
processHeadersWithVersioner(ctx, fromSrcPath, toOutputPath, srcFiles, installPaths)
|
||||
}
|
||||
|
||||
func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir android.Path, srcFiles android.Paths, installPaths []android.WritablePath) android.Path {
|
||||
func processHeadersWithVersioner(ctx android.ModuleContext, srcDir, outDir android.Path,
|
||||
srcFiles android.Paths, installPaths []android.WritablePath) android.Path {
|
||||
// The versioner depends on a dependencies directory to simplify determining include paths
|
||||
// when parsing headers. This directory contains architecture specific directories as well
|
||||
// as a common directory, each of which contains symlinks to the actually directories to
|
||||
@@ -326,7 +327,7 @@ type preprocessedHeadersModule struct {
|
||||
properties preprocessedHeadersProperties
|
||||
|
||||
installPaths android.Paths
|
||||
licensePath android.ModuleSrcPath
|
||||
licensePath android.Path
|
||||
}
|
||||
|
||||
func (m *preprocessedHeadersModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
|
Reference in New Issue
Block a user