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

Commit f87696ed authored by Rob Seymour's avatar Rob Seymour Committed by Automerger Merge Worker
Browse files

Merge "Add module based host-tools snapshot" am: f6c37cc8 am: dc2cc0d8

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

Change-Id: I05d5d44fddfc8c8dd8e59dd64bb76024bbbfbf66
parents 0b31f81b dc2cc0d8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1531,6 +1531,10 @@ func (c *deviceConfig) RecoverySnapshotDirsIncludedMap() map[string]bool {
		c.config.productVariables.RecoverySnapshotDirsIncluded)
}

func (c *deviceConfig) HostFakeSnapshotEnabled() bool {
	return c.config.productVariables.HostFakeSnapshotEnabled
}

func (c *deviceConfig) ShippingApiLevel() ApiLevel {
	if c.config.productVariables.ShippingApiLevel == nil {
		return NoneApiLevel
+9 −0
Original line number Diff line number Diff line
@@ -188,6 +188,15 @@ func WriteFileRule(ctx BuilderContext, outputFile WritablePath, content string)
	buildWriteFileRule(ctx, outputFile, content)
}

func CatFileRule(ctx BuilderContext, paths Paths, outputFile WritablePath) {
	ctx.Build(pctx, BuildParams{
		Rule:        Cat,
		Inputs:      paths,
		Output:      outputFile,
		Description: "combine files to " + outputFile.Base(),
	})
}

// shellUnescape reverses proptools.ShellEscape
func shellUnescape(s string) string {
	// Remove leading and trailing quotes if present
+1 −0
Original line number Diff line number Diff line
@@ -334,6 +334,7 @@ type productVariables struct {
	VendorSnapshotDirsExcluded   []string `json:",omitempty"`
	RecoverySnapshotDirsExcluded []string `json:",omitempty"`
	RecoverySnapshotDirsIncluded []string `json:",omitempty"`
	HostFakeSnapshotEnabled      bool     `json:",omitempty"`

	BoardVendorSepolicyDirs      []string `json:",omitempty"`
	BoardOdmSepolicyDirs         []string `json:",omitempty"`
+3 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import (
	"android/soong/cc/config"
	"android/soong/fuzz"
	"android/soong/genrule"
	"android/soong/snapshot"
)

func init() {
@@ -3401,6 +3402,8 @@ func (c *Module) AlwaysRequiresPlatformApexVariant() bool {
	return c.IsStubs() || c.Target().NativeBridge == android.NativeBridgeEnabled
}

var _ snapshot.RelativeInstallPath = (*Module)(nil)

//
// Defaults
//
+2 −6
Original line number Diff line number Diff line
@@ -132,12 +132,9 @@ func isSnapshotAware(cfg android.DeviceConfig, m LinkableInterface, inProprietar
	return false
}

// This is to be saved as .json files, which is for development/vendor_snapshot/update.py.
// These flags become Android.bp snapshot module properties.
// Extend the snapshot.SnapshotJsonFlags to include cc specific fields.
type snapshotJsonFlags struct {
	ModuleName          string `json:",omitempty"`
	RelativeInstallPath string `json:",omitempty"`

	snapshot.SnapshotJsonFlags
	// library flags
	ExportedDirs       []string `json:",omitempty"`
	ExportedSystemDirs []string `json:",omitempty"`
@@ -154,7 +151,6 @@ type snapshotJsonFlags struct {
	SharedLibs  []string `json:",omitempty"`
	StaticLibs  []string `json:",omitempty"`
	RuntimeLibs []string `json:",omitempty"`
	Required    []string `json:",omitempty"`

	// extra config files
	InitRc         []string `json:",omitempty"`
Loading