diff options
author | 2024-06-17 12:32:40 -0700 | |
---|---|---|
committer | 2024-06-17 12:32:40 -0700 | |
commit | 43ddd08bd2b9af64cfbc58e2abf346be1b438d61 (patch) | |
tree | 83421f00a8a02ef2fcf993586c47a35d641d9c0f /snapshot | |
parent | 7dc42aa7afeb7fa9f630896d27959aba9f0f685b (diff) |
Make required a configurable property
So that users can use select statements with it.
Fixes: 347605145
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: Ica0ca6d1725b000b3748c0293e5a9f9b38ed87f9
Diffstat (limited to 'snapshot')
-rw-r--r-- | snapshot/host_fake_snapshot.go | 4 | ||||
-rw-r--r-- | snapshot/host_snapshot.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/snapshot/host_fake_snapshot.go b/snapshot/host_fake_snapshot.go index b416ebdd4..278247e10 100644 --- a/snapshot/host_fake_snapshot.go +++ b/snapshot/host_fake_snapshot.go @@ -129,12 +129,12 @@ func (c *hostFakeSingleton) GenerateBuildActions(ctx android.SingletonContext) { if !seen[outFile] { seen[outFile] = true outputs = append(outputs, WriteStringToFileRule(ctx, "", outFile)) - jsonData = append(jsonData, hostSnapshotFakeJsonFlags{*hostJsonDesc(module), false}) + jsonData = append(jsonData, hostSnapshotFakeJsonFlags{*hostJsonDesc(ctx, module), false}) } } }) // Update any module prebuilt information - for idx, _ := range jsonData { + for idx := range jsonData { if _, ok := prebuilts[jsonData[idx].ModuleName]; ok { // Prebuilt exists for this module jsonData[idx].Prebuilt = true diff --git a/snapshot/host_snapshot.go b/snapshot/host_snapshot.go index edcc16348..1ecab7ddc 100644 --- a/snapshot/host_snapshot.go +++ b/snapshot/host_snapshot.go @@ -101,7 +101,7 @@ func (f *hostSnapshot) CreateMetaData(ctx android.ModuleContext, fileName string // Create JSON file based on the direct dependencies ctx.VisitDirectDeps(func(dep android.Module) { - desc := hostJsonDesc(dep) + desc := hostJsonDesc(ctx, dep) if desc != nil { jsonData = append(jsonData, *desc) } @@ -209,7 +209,7 @@ func hostRelativePathString(m android.Module) string { // Create JSON description for given module, only create descriptions for binary modules // and rust_proc_macro modules which provide a valid HostToolPath -func hostJsonDesc(m android.Module) *SnapshotJsonFlags { +func hostJsonDesc(ctx android.ConfigAndErrorContext, m android.Module) *SnapshotJsonFlags { path := hostToolPath(m) relPath := hostRelativePathString(m) procMacro := false @@ -226,7 +226,7 @@ func hostJsonDesc(m android.Module) *SnapshotJsonFlags { props := &SnapshotJsonFlags{ ModuleStemName: moduleStem, Filename: path.String(), - Required: append(m.HostRequiredModuleNames(), m.RequiredModuleNames()...), + Required: append(m.HostRequiredModuleNames(), m.RequiredModuleNames(ctx)...), RelativeInstallPath: relPath, RustProcMacro: procMacro, CrateName: crateName, |