Dist module_paths/files.db am: 96e5e41b88

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1356181

Change-Id: I30c5d4a24ba1d73fe4c68d796643461da07da500
This commit is contained in:
Colin Cross
2020-07-07 03:40:46 +00:00
committed by Automerger Merge Worker
2 changed files with 11 additions and 5 deletions

View File

@@ -325,7 +325,12 @@ func (f *Finder) FindMatching(rootPath string, filter WalkFunc) []string {
// Shutdown declares that the finder is no longer needed and waits for its cleanup to complete // Shutdown declares that the finder is no longer needed and waits for its cleanup to complete
// Currently, that only entails waiting for the database dump to complete. // Currently, that only entails waiting for the database dump to complete.
func (f *Finder) Shutdown() { func (f *Finder) Shutdown() {
f.waitForDbDump() f.WaitForDbDump()
}
// WaitForDbDump returns once the database has been written to f.DbPath.
func (f *Finder) WaitForDbDump() {
f.shutdownWaitgroup.Wait()
} }
// End of public api // End of public api
@@ -345,10 +350,6 @@ func (f *Finder) goDumpDb() {
} }
} }
func (f *Finder) waitForDbDump() {
f.shutdownWaitgroup.Wait()
}
// joinCleanPaths is like filepath.Join but is faster because // joinCleanPaths is like filepath.Join but is faster because
// joinCleanPaths doesn't have to support paths ending in "/" or containing ".." // joinCleanPaths doesn't have to support paths ending in "/" or containing ".."
func joinCleanPaths(base string, leaf string) string { func joinCleanPaths(base string, leaf string) string {

View File

@@ -126,6 +126,11 @@ func FindSources(ctx Context, config Config, f *finder.Finder) {
if err != nil { if err != nil {
ctx.Fatalf("Could not find modules: %v", err) ctx.Fatalf("Could not find modules: %v", err)
} }
if config.Dist() {
f.WaitForDbDump()
distFile(ctx, config, f.DbPath, "module_paths")
}
} }
func dumpListToFile(ctx Context, config Config, list []string, filePath string) (err error) { func dumpListToFile(ctx Context, config Config, list []string, filePath string) (err error) {