diff options
author | Jiyong Park <jiyong@google.com> | 2019-07-17 20:08:41 +0900 |
---|---|---|
committer | Jiyong Park <jiyong@google.com> | 2019-09-22 08:21:27 +0900 |
commit | d1063c15869080e5f7c07852a512aaa12905fb11 (patch) | |
tree | eaf3e5f55dfb740425ed34cb0796dbbaf976eab4 /cc/prebuilt.go | |
parent | 1f6c94a3ac5cc86c81a3a8e9ed5561d0e1e9c5fc (diff) | |
download | build_soong-d1063c15869080e5f7c07852a512aaa12905fb11.tar.gz build_soong-d1063c15869080e5f7c07852a512aaa12905fb11.tar.bz2 build_soong-d1063c15869080e5f7c07852a512aaa12905fb11.zip |
Introduce module type 'sdk'
This change introduces a new module type named 'sdk'. It is a logical
group of prebuilt modules that together provide a context (e.g. APIs)
in which Mainline modules (such as APEXes) are built.
A prebuilt module (e.g. java_import) can join an sdk by adding it to the
sdk module as shown below:
sdk {
name: "mysdk#20",
java_libs: ["myjavalib_mysdk_20"],
}
java_import {
name: "myjavalib_mysdk_20",
srcs: ["myjavalib-v20.jar"],
sdk_member_name: "myjavalib",
}
sdk {
name: "mysdk#21",
java_libs: ["myjavalib_mysdk_21"],
}
java_import {
name: "myjavalib_mysdk_21",
srcs: ["myjavalib-v21.jar"],
sdk_member_name: "myjavalib",
}
java_library {
name: "myjavalib",
srcs: ["**/*/*.java"],
}
An APEX can specify the SDK(s) that it wants to build with via the new
'uses_sdks' property.
apex {
name: "myapex",
java_libs: ["libX", "libY"],
uses_sdks: ["mysdk#20"],
}
With this, libX, libY, and their transitive dependencies are all built
with the version 20 of myjavalib (the first java_import module) instead
of the other one (which is for version 21) and java_library having the
same name (which is for ToT).
Bug: 138182343
Test: m (sdk_test.go added)
Change-Id: I7e14c524a7d6a0d9f575fb20822080f39818c01e
Diffstat (limited to 'cc/prebuilt.go')
-rw-r--r-- | cc/prebuilt.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cc/prebuilt.go b/cc/prebuilt.go index 8c72b691..4e6cdd75 100644 --- a/cc/prebuilt.go +++ b/cc/prebuilt.go @@ -152,6 +152,7 @@ func NewPrebuiltSharedLibrary(hod android.HostOrDeviceSupported) (*Module, *libr // Prebuilt libraries can be included in APEXes android.InitApexModule(module) + android.InitSdkAwareModule(module) return module, library } @@ -176,6 +177,7 @@ func NewPrebuiltStaticLibrary(hod android.HostOrDeviceSupported) (*Module, *libr module.AddProperties(&prebuilt.properties) android.InitPrebuiltModule(module, &prebuilt.properties.Srcs) + android.InitSdkAwareModule(module) return module, library } |