diff options
| author | 2025-03-11 15:26:27 -0700 | |
|---|---|---|
| committer | 2025-03-11 15:26:27 -0700 | |
| commit | 8c25fbc6a1cd4f7e105786a7751bcc871acf4f2e (patch) | |
| tree | f9af4f59bb7c1a83a0c47fbe3314432acdb8e681 | |
| parent | 43bbd4d187f43038374d7fad6ce951953b2d7840 (diff) | |
| parent | cb8fd3e3c1ce17d5ee0cfd54a6b19f212cf42751 (diff) | |
Merge "Use built files instead of installed files as deps" into main am: cb8fd3e3c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3536740
Change-Id: I935e63bf661ad87dcacc34dafa4e57b5c07d898d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | ci_tests/ci_test_package_zip.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ci_tests/ci_test_package_zip.go b/ci_tests/ci_test_package_zip.go index 451dac4cc..f8c4578b6 100644 --- a/ci_tests/ci_test_package_zip.go +++ b/ci_tests/ci_test_package_zip.go @@ -20,6 +20,7 @@ import ( "strings" "android/soong/android" + "github.com/google/blueprint" "github.com/google/blueprint/proptools" ) @@ -214,7 +215,13 @@ func extendBuilderCommand(ctx android.ModuleContext, m android.Module, builder * ctx.ModuleErrorf("Module %s doesn't set InstallFilesProvider", m.Name()) } - for _, installedFile := range installedFilesInfo.InstallFiles { + for _, spec := range installedFilesInfo.PackagingSpecs { + if spec.SrcPath() == nil { + // Probably a symlink + continue + } + installedFile := spec.FullInstallPath() + ext := installedFile.Ext() // there are additional installed files for some app-class modules, we only need the .apk, .odex and .vdex files in the test package excludeInstalledFile := ext != ".apk" && ext != ".odex" && ext != ".vdex" @@ -253,7 +260,9 @@ func extendBuilderCommand(ctx android.ModuleContext, m android.Module, builder * tempOut := android.PathForModuleOut(ctx, "STAGING", f) builder.Command().Text("mkdir").Flag("-p").Text(filepath.Join(stagingDir.String(), dir)) - builder.Command().Text("cp").Flag("-Rf").Input(installedFile).Output(tempOut) + // Copy srcPath instead of installedFile because some rules like target-files.zip + // are non-hermetic and would be affected if we built the installed files. + builder.Command().Text("cp").Flag("-Rf").Input(spec.SrcPath()).Output(tempOut) builder.Temporary(tempOut) } } |