aboutsummaryrefslogtreecommitdiffstats
path: root/java/sdk.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2019-10-11 13:50:28 +0100
committerPaul Duffin <paulduffin@google.com>2019-10-11 16:38:14 +0100
commite25c644f1e06b2ff11322e5791dd92dee6ebf9af (patch)
tree84dcf2a8fcae29bf8e3466269e06066391a740c3 /java/sdk.go
parent22762b98f35fe9c8d9d43f64a41a7e5de6fe0534 (diff)
downloadbuild_soong-e25c644f1e06b2ff11322e5791dd92dee6ebf9af.tar.gz
build_soong-e25c644f1e06b2ff11322e5791dd92dee6ebf9af.tar.bz2
build_soong-e25c644f1e06b2ff11322e5791dd92dee6ebf9af.zip
Add system_modules to droidstubs
This allows droidstubs to use the same system modules to create the stubs that will be used to compile them. It improves consistency and avoids droidstubs having to duplicate the libraries that make up the system modules on its libs property. Adds systemModules() to the sdkContext which allows consistent error checking behavior between droidstubs and java_library. Bug: 142534789 Test: m checkbuild Change-Id: Ib2006906d9528a900f16851f50b62152ffb51a1b
Diffstat (limited to 'java/sdk.go')
-rw-r--r--java/sdk.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/sdk.go b/java/sdk.go
index 3451774c..c6a9a73c 100644
--- a/java/sdk.go
+++ b/java/sdk.go
@@ -39,6 +39,8 @@ var apiFingerprintPathKey = android.NewOnceKey("apiFingerprintPathKey")
type sdkContext interface {
// sdkVersion returns the sdk_version property of the current module, or an empty string if it is not set.
sdkVersion() string
+ // systemModules returns the system_modules property of the current module, or an empty string if it is not set.
+ systemModules() string
// minSdkVersion returns the min_sdk_version property of the current module, or sdkVersion() if it is not set.
minSdkVersion() string
// targetSdkVersion returns the target_sdk_version property of the current module, or sdkVersion() if it is not set.
@@ -185,8 +187,18 @@ func decodeSdkDep(ctx android.BaseModuleContext, sdkContext sdkContext) sdkDep {
frameworkResModule: "framework-res",
}
case "none":
+ systemModules := sdkContext.systemModules()
+ if systemModules == "" {
+ ctx.PropertyErrorf("sdk_version",
+ `system_modules is required to be set to a non-empty value when sdk_version is "none", did you mean sdk_version: "core_platform"?`)
+ } else if systemModules == "none" {
+ // Normalize no system modules to an empty string.
+ systemModules = ""
+ }
+
return sdkDep{
noStandardLibs: true,
+ systemModules: systemModules,
}
case "core_platform":
return sdkDep{