diff options
author | 2025-01-08 01:57:24 +0000 | |
---|---|---|
committer | 2025-01-09 01:27:45 +0000 | |
commit | d56da3271b0c62aa47871221e938bb34ed15b876 (patch) | |
tree | 323ccb80a63583db215dc1cbd0f658fa7126360c /android/raw_files.go | |
parent | 44670268657b495ea803001cb22b1abd70297a6a (diff) |
Copy android-info.txt to PRODUCT_OUT
By creating a timestamp file to copy the generated android-info.txt
file.
Test: m out/soong/.intermediates/aosp_cf_x86_64_phone_generated_android_info.prop/android_common/android-info.txt --soong-only
Bug: 376727180
Change-Id: I5a5eb5cfd27490ddccfb5470e9998e6a035e04c1
Diffstat (limited to 'android/raw_files.go')
-rw-r--r-- | android/raw_files.go | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/android/raw_files.go b/android/raw_files.go index 9d7f5e82d..fd371965c 100644 --- a/android/raw_files.go +++ b/android/raw_files.go @@ -18,7 +18,6 @@ import ( "crypto/sha1" "encoding/hex" "fmt" - "github.com/google/blueprint" "io" "io/fs" "os" @@ -26,25 +25,27 @@ import ( "strings" "testing" + "github.com/google/blueprint" + "github.com/google/blueprint/proptools" ) // WriteFileRule creates a ninja rule to write contents to a file by immediately writing the // contents, plus a trailing newline, to a file in out/soong/raw-${TARGET_PRODUCT}, and then creating // a ninja rule to copy the file into place. -func WriteFileRule(ctx BuilderContext, outputFile WritablePath, content string) { - writeFileRule(ctx, outputFile, content, true, false) +func WriteFileRule(ctx BuilderContext, outputFile WritablePath, content string, validations ...Path) { + writeFileRule(ctx, outputFile, content, true, false, validations) } // WriteFileRuleVerbatim creates a ninja rule to write contents to a file by immediately writing the // contents to a file in out/soong/raw-${TARGET_PRODUCT}, and then creating a ninja rule to copy the file into place. -func WriteFileRuleVerbatim(ctx BuilderContext, outputFile WritablePath, content string) { - writeFileRule(ctx, outputFile, content, false, false) +func WriteFileRuleVerbatim(ctx BuilderContext, outputFile WritablePath, content string, validations ...Path) { + writeFileRule(ctx, outputFile, content, false, false, validations) } // WriteExecutableFileRuleVerbatim is the same as WriteFileRuleVerbatim, but runs chmod +x on the result -func WriteExecutableFileRuleVerbatim(ctx BuilderContext, outputFile WritablePath, content string) { - writeFileRule(ctx, outputFile, content, false, true) +func WriteExecutableFileRuleVerbatim(ctx BuilderContext, outputFile WritablePath, content string, validations ...Path) { + writeFileRule(ctx, outputFile, content, false, true, validations) } // tempFile provides a testable wrapper around a file in out/soong/.temp. It writes to a temporary file when @@ -124,7 +125,7 @@ func writeContentToTempFileAndHash(ctx BuilderContext, content string, newline b return tempFile, hex.EncodeToString(hash.Sum(nil)) } -func writeFileRule(ctx BuilderContext, outputFile WritablePath, content string, newline bool, executable bool) { +func writeFileRule(ctx BuilderContext, outputFile WritablePath, content string, newline bool, executable bool, validations Paths) { // Write the contents to a temporary file while computing its hash. tempFile, hash := writeContentToTempFileAndHash(ctx, content, newline) @@ -186,6 +187,7 @@ func writeFileRule(ctx BuilderContext, outputFile WritablePath, content string, Input: rawPath, Output: outputFile, Description: "raw " + outputFile.Base(), + Validations: validations, }) } |