diff options
author | 2024-03-19 16:48:59 +0900 | |
---|---|---|
committer | 2024-03-26 05:55:49 +0000 | |
commit | 5baf2cbcb63a799ea16d67525493b36fd028e1bc (patch) | |
tree | 7b0b11002ad818d2f031fcb7d26d06727097c44b /java/sdk.go | |
parent | 9dcc3676a9b6e610a9301c7dc7297f25652b852e (diff) |
Migrate buildinfo.sh script into Soong
To build system.img in Soong, we need all artifacts including
build.prop. This fully migrates buildinfo.prop file into Soong as a
first step to build build.prop on Soong.
Bug: 322090587
Test: compare build.prop before and after
Test: build multiple times and see build.prop isn't rebuilt
Change-Id: Icaa7e1fdab2a8c169ac00949d3aaf6c8212a1872
Diffstat (limited to 'java/sdk.go')
-rw-r--r-- | java/sdk.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/java/sdk.go b/java/sdk.go index 3591ccdb6..d972c19bd 100644 --- a/java/sdk.go +++ b/java/sdk.go @@ -31,7 +31,6 @@ func init() { var sdkFrameworkAidlPathKey = android.NewOnceKey("sdkFrameworkAidlPathKey") var nonUpdatableFrameworkAidlPathKey = android.NewOnceKey("nonUpdatableFrameworkAidlPathKey") -var apiFingerprintPathKey = android.NewOnceKey("apiFingerprintPathKey") func UseApiFingerprint(ctx android.BaseModuleContext) (useApiFingerprint bool, fingerprintSdkVersion string, fingerprintDeps android.OutputPath) { if ctx.Config().UnbundledBuild() && !ctx.Config().AlwaysUsePrebuiltSdks() { @@ -45,8 +44,8 @@ func UseApiFingerprint(ctx android.BaseModuleContext) (useApiFingerprint bool, f useApiFingerprint = apiFingerprintTrue || dessertShaIsSet if apiFingerprintTrue { - fingerprintSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", ApiFingerprintPath(ctx).String()) - fingerprintDeps = ApiFingerprintPath(ctx) + fingerprintSdkVersion = ctx.Config().PlatformSdkCodename() + fmt.Sprintf(".$$(cat %s)", android.ApiFingerprintPath(ctx).String()) + fingerprintDeps = android.ApiFingerprintPath(ctx) } if dessertShaIsSet { fingerprintSdkVersion = ctx.Config().Getenv("UNBUNDLED_BUILD_TARGET_SDK_WITH_DESSERT_SHA") @@ -337,7 +336,7 @@ func nonUpdatableFrameworkAidlPath(ctx android.PathContext) android.OutputPath { // Create api_fingerprint.txt func createAPIFingerprint(ctx android.SingletonContext) { - out := ApiFingerprintPath(ctx) + out := android.ApiFingerprintPath(ctx) rule := android.NewRuleBuilder(pctx, ctx) @@ -378,17 +377,11 @@ func createAPIFingerprint(ctx android.SingletonContext) { rule.Build("api_fingerprint", "generate api_fingerprint.txt") } -func ApiFingerprintPath(ctx android.PathContext) android.OutputPath { - return ctx.Config().Once(apiFingerprintPathKey, func() interface{} { - return android.PathForOutput(ctx, "api_fingerprint.txt") - }).(android.OutputPath) -} - func sdkMakeVars(ctx android.MakeVarsContext) { if ctx.Config().AlwaysUsePrebuiltSdks() { return } ctx.Strict("FRAMEWORK_AIDL", sdkFrameworkAidlPath(ctx).String()) - ctx.Strict("API_FINGERPRINT", ApiFingerprintPath(ctx).String()) + ctx.Strict("API_FINGERPRINT", android.ApiFingerprintPath(ctx).String()) } |