Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e2760a5 authored by Daniel Cardenas's avatar Daniel Cardenas Committed by Gerrit Code Review
Browse files

Merge changes from topic "revert_vendor"

* changes:
  Revert "Speed up vendor snapshot header globs"
  Revert "Truncate vendor snapshot header glob list after filtering it"
parents ef457534 c2aff9e9
Loading
Loading
Loading
Loading
+13 −28
Original line number Diff line number Diff line
@@ -449,39 +449,24 @@ func (l *libraryDecorator) collectHeadersForSnapshot(ctx android.ModuleContext)
			}
			continue
		}
		glob, err := ctx.GlobWithDeps(dir+"/**/*", nil)
		exts := headerExts
		// Glob all files under this special directory, because of C++ headers.
		if strings.HasPrefix(dir, "external/libcxx/include") {
			exts = []string{""}
		}
		for _, ext := range exts {
			glob, err := ctx.GlobWithDeps(dir+"/**/*"+ext, nil)
			if err != nil {
				ctx.ModuleErrorf("glob failed: %#v", err)
				return
			}
		isLibcxx := strings.HasPrefix(dir, "external/libcxx/include")
		j := 0
		for i, header := range glob {
			if isLibcxx {
				// Glob all files under this special directory, because of C++ headers with no
				// extension.
				if !strings.HasSuffix(header, "/") {
					continue
				}
			} else {
				// Filter out only the files with extensions that are headers.
				found := false
				for _, ext := range headerExts {
					if strings.HasSuffix(header, ext) {
						found = true
						break
					}
				}
				if !found {
			for _, header := range glob {
				if strings.HasSuffix(header, "/") {
					continue
				}
				ret = append(ret, android.PathForSource(ctx, header))
			}
			if i != j {
				glob[j] = glob[i]
			}
			j++
		}
		glob = glob[:j]
	}

	// Collect generated headers