diff options
author | Dan Shi <dshi@google.com> | 2017-11-22 15:35:09 -0800 |
---|---|---|
committer | Dan Shi <dshi@google.com> | 2017-11-22 15:35:09 -0800 |
commit | cc3d9b304eef9c05e9ccf8b1698150a94211d864 (patch) | |
tree | 006b469b5192ef889e25efa12f969881b46d1d9d /ui | |
parent | 99a5635733d45b30e4b38770e52243f3c46dac1e (diff) | |
download | build_soong-cc3d9b304eef9c05e9ccf8b1698150a94211d864.tar.gz build_soong-cc3d9b304eef9c05e9ccf8b1698150a94211d864.tar.bz2 build_soong-cc3d9b304eef9c05e9ccf8b1698150a94211d864.zip |
Add TEST_MAPPING to finder's cache
Build target test_mapping will create a tarball of all TEST_MAPPING
files in source code based on the cached TEST_MAPPING.list
Bug: 69678490
Test: m -j blueprint_tools && cat out/.module_paths/TEST_MAPPING.list
Change-Id: Iba3479363137609d6631cf1851a8ce4613078f61
Diffstat (limited to 'ui')
-rw-r--r-- | ui/build/finder.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/build/finder.go b/ui/build/finder.go index 05dec3ae..010b3256 100644 --- a/ui/build/finder.go +++ b/ui/build/finder.go @@ -43,7 +43,7 @@ func NewSourceFinder(ctx Context, config Config) (f *finder.Finder) { RootDirs: []string{"."}, ExcludeDirs: []string{".git", ".repo"}, PruneFiles: []string{".out-dir", ".find-ignore"}, - IncludeFiles: []string{"Android.mk", "Android.bp", "Blueprints", "CleanSpec.mk"}, + IncludeFiles: []string{"Android.mk", "Android.bp", "Blueprints", "CleanSpec.mk", "TEST_MAPPING"}, } dumpDir := config.FileListDir() f, err = finder.New(cacheParams, fs.OsFs, logger.New(ioutil.Discard), @@ -74,6 +74,12 @@ func FindSources(ctx Context, config Config, f *finder.Finder) { ctx.Fatalf("Could not export module list: %v", err) } + testMappings := f.FindNamedAt(".", "TEST_MAPPING") + err = dumpListToFile(testMappings, filepath.Join(dumpDir, "TEST_MAPPING.list")) + if err != nil { + ctx.Fatalf("Could not find modules: %v", err) + } + isBlueprintFile := func(dir finder.DirEntries) (dirs []string, files []string) { files = []string{} for _, file := range dir.FileNames { |