aboutsummaryrefslogtreecommitdiffstats
path: root/java/sdk.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-04-18 17:25:49 +0900
committerJiyong Park <jiyong@google.com>2019-04-19 14:45:41 +0900
commit71b519d6ce98fc0313019d84777bfc04f3799efc (patch)
treec749ea1d5ef4fde68627319c902fb64f9b484682 /java/sdk.go
parent109328714ff626446e16cfdd3103a5b969284841 (diff)
downloadbuild_soong-71b519d6ce98fc0313019d84777bfc04f3799efc.tar.gz
build_soong-71b519d6ce98fc0313019d84777bfc04f3799efc.tar.bz2
build_soong-71b519d6ce98fc0313019d84777bfc04f3799efc.zip
Set default target SDK version for APEX
Target SDK version is used for targeting an APEX to a specific set of platform builds. Usually, the targeting is unrestricted (in case the APEX can run on all platforms), or based on platform SDK version (e.g. 28 for P). However, when the platform is under development and SDK is not finalized, the targeting should be much more fine-grained; the APEX should be targeted to a very specific build that supports the same set of APIs that the APEX was built against. To support that, target sdk version is automatically set by the build system. When the platform is released or SDK is finalized, the target sdk version set to the SDK version number. If not, it is set to <version_code>.<fingerprint> (e.g., Q.123456). Note that the target sdk version set by the build system is used only when the target sdk version is not explicitly set in AndroidManifest.xml. Bug: 130541924 Test: UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true \ UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true \ TARGET_BUILD_APPS=com.android.tzdata m build.ninja has --target_sdk_version Q.$$(cat out/soong/api_fingerprint.txt) Test: aapt dump badging out/dist/com.android.tzdata.apex | grep \ targetSdkVersion shows: targetSdkVersion:'Q.6ee443d9ad5f0cca7a43cfa97b7fc62a' Change-Id: I086230d787f01075c28fc3f0163550300fa00212
Diffstat (limited to 'java/sdk.go')
-rw-r--r--java/sdk.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/sdk.go b/java/sdk.go
index 36010b6f..e93f8fb6 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -316,7 +316,7 @@ func sdkFrameworkAidlPath(ctx android.PathContext) android.OutputPath {
// Create api_fingerprint.txt
func createAPIFingerprint(ctx android.SingletonContext) {
- out := apiFingerprintPath(ctx)
+ out := ApiFingerprintPath(ctx)
rule := android.NewRuleBuilder()
@@ -359,7 +359,7 @@ func createAPIFingerprint(ctx android.SingletonContext) {
rule.Build(pctx, ctx, "api_fingerprint", "generate api_fingerprint.txt")
}
-func apiFingerprintPath(ctx android.PathContext) android.OutputPath {
+func ApiFingerprintPath(ctx android.PathContext) android.OutputPath {
return ctx.Config().Once(apiFingerprintPathKey, func() interface{} {
return android.PathForOutput(ctx, "api_fingerprint.txt")
}).(android.OutputPath)
@@ -371,5 +371,5 @@ func sdkMakeVars(ctx android.MakeVarsContext) {
}
ctx.Strict("FRAMEWORK_AIDL", sdkFrameworkAidlPath(ctx).String())
- ctx.Strict("API_FINGERPRINT", apiFingerprintPath(ctx).String())
+ ctx.Strict("API_FINGERPRINT", ApiFingerprintPath(ctx).String())
}