Commit graph

16 commits

Author SHA1 Message Date
Liz Kammer
4e7f2607ed Add imports_compile_dex to prebuilt_apis
Allows specifying compile_dex for java_import modules generated by
prebuilt_apis.

Bug: 160455085
Test: m sdk_public_current_android
Change-Id: Id316ba740577b2c9c0522368c01072864cda6cca
2020-09-02 09:27:35 -07:00
Liz Kammer
2d2fd859bb Add imports_sdk_version to prebuilt_apis
This allows setting the prebuilt sdk's generated java_imports
sdk_version to "none".

Test: go tests
Test: m
Bug: 160455085
Change-Id: Id24aca811f0f09692971e63418da6685d8351737
2020-08-20 09:48:50 -07:00
Liz Kammer
f971af7997 Set sdk_version for prebuilt_api to scope
Remove old TODO setting sdk_version to "current" as the associated bug
appears to have been fixed.

Test: m checkapi
Change-Id: I7737fbd17d2f54fc4578e04d07875b4b8d408ef9
2020-07-13 15:41:20 -07:00
Colin Cross
17dec171b4 Use system modules for prebuilt SDKs >=30
Prebuilt SDKs >=30 now contain core-for-system-modules.jar,
convert them to system modules and use them when compiling against
the SDK to allow using javac -source 1.9 -target 1.9.

Bug: 117069453
Test: TestClasspath
Change-Id: Iebadad5980b952ed91c3ffd56cff1ce1827d3247
Merged-In: Iebadad5980b952ed91c3ffd56cff1ce1827d3247
2020-05-15 17:21:58 -07:00
Anton Hansson
8d23969bb6 Make prebuilt_sdk support module-lib and system-server
This makes prebuilt_sdk look for and create modules in the module-lib
and system-server subdirs too, e.g.:
    framework-wifi.api.module-lib.latest

Bug: 149293194
Test: follow-up change
Change-Id: Idbded6b633315034e669e9c5dd2bd30725d5c76b
Merged-In: Idbded6b633315034e669e9c5dd2bd30725d5c76b
2020-05-04 13:52:43 +01:00
Paul Duffin
d4c0356dad Create prebuilt api modules in load hook not mutator
An attempt to reference one of the prebuilt modules directly from an
Android.bp file highlighted a bug. The prebuilt_apis module used a
mutator to create filegroup and java_import modules for a set of api
versions. That mutator ran after the "prebuilts" mutator which handled
the renaming of prebuilt modules when the matching source module was
not present. That meant that the only way to reference the module was
by explicitly adding the prefix "prebuilt_".

This change fixed that bug by creating the modules in a load hook rather
that a mutator. This ensures that the prebuilt modules are present well
before the "prebuilts" mutator is run. Removing the mutator also removes
an unnecessary traversal of the whole dependency tree.

It also updated the documentation to explain that it creates
java_import modules as well as the filegroup modules.

(cherry picked from 47f6315f01)

Bug: 153649372
Test: m droid
Change-Id: Id44dce8ca9968ae903345df6ef1c4f1be9cb76c5
Merged-In: Id44dce8ca9968ae903345df6ef1c4f1be9cb76c5
2020-04-10 07:44:52 +01:00
Paul Duffin
a48f758d84 Dedup prebuilt apis module type/mutator registration
Test: m checkbuild
Bug: 146540677
Change-Id: If5d6fdace2574df6314fbcf6441838cd11df58ae
2019-12-19 19:19:40 +00:00
Colin Cross
84dfc3d331 Make CreateModule take an android.ModuleFactory
Reduce the boilerplate required to call CreateModule by taking an
android.ModuleFactory instead of a blueprint.ModuleFactory.

Test: m checkbuild
Change-Id: I1259d2dd3f7893b5319c333bc180727ac40f9e91
2019-09-26 17:19:26 +00:00
Jaewoong Jung
5fb5b2a7f5 Add synopsis for prebuilt_apis.
Test: m soong_docs
Change-Id: I0e2cefd3dd24e5c8483d32cc325a37e96d3d495c
2019-03-21 17:44:11 -07:00
Sundong Ahn
8faab8a547 Get latest api version
The logic of getting latest api version has problem that we don't
guarantee $(module_name).latest is latest api txt file. So change this
logic to get the latest api txt file.

Test: make -j40
Change-Id: Ibbd8475061fc76169a4c94dcf148fece45b9a41d
2019-02-14 19:46:34 +09:00
Inseob Kim
c0907f191a Create sysprop_library soong module
A newly introduced sysprop_library soong module will generate a
java_sdk_library and a cc_library from .sysprop description files.
Both Java modules and C++ modules can link against sysprop_library
module, thus giving consistency for using generated sysprop API.

As Java controls accessibility of Internal / System properties with
@hide and @SystemApi, 2 different header files will be created. And
build system will selectively expose depending on the property owner
and the place where the client libraries go into.

Bug: 80125326
Bug: 122170616
Test: 1) Create sysprop_library module.
Test: 2) Create empty txt files under prebuilts/sdk.
Test: 3) Create api directory, make update-api, and see changes.
Test: 4) Try to link against sysprop_library with various clients.
Test: 5) Soc_specific, Device_specific, Product_specific, recovery flags
work as intended.
Change-Id: I78dc5780ccfbb4b69e5c61dec26b94e92d43c333
2019-02-13 23:32:51 +00:00
Colin Cross
5f692ec219 Remove empty DepsMutator methods
Add an empty DepsMutator to ModuleBase so it doesn't have to be
implemented on every module that doesn't need it.

Test: all soong tests
Change-Id: I545a832a0dbf27386d3080377a75ea482cd9ce59
2019-02-01 17:17:58 -08:00
Sundong Ahn
054b19a131 Support core library
To support core library, "Openjdk9", "No_standard_libs" and metalava
properties are added to java_sdk_library.
If core_lib is true, dist paths are changed to
apistubs/core/....
impl library name is changed to {module_name}.jar instead of
{module_name}.impl.jar

Bug: 110404779
Test: m -j
Change-Id: Ieb6248ea714b4260333d8bf61573d4f3413f7f24
Merged-In: Ieb6248ea714b4260333d8bf61573d4f3413f7f24
(cherry picked from commit af4907fed7)
2019-01-16 22:00:17 -08:00
Sundong Ahn
27eecb99d2 Add api_dirs property and use module name as prefix
The soong connect the prebuilt library according to LOCAL_SDK_VERSION.
But some sdk libraries has diffrent version policy with
LOCAL_SDK_VERSION. For this, we need to support direct link to the
prebuilt library instead of creating a new LOCAL_XXX_SDK_VERSION. So,
The base module name is used as the prefix for the prebuilt module name.

Remove the empty file check to support the absence of a prebuilt
library and add api_dirs property

Bug:77577799
Test: make -j
Change-Id: I1086977d26e4ddfd62e290637126d44e1b248bac
2018-06-25 10:30:30 +09:00
Sundong Ahn
a01c2a510e Support prebuilt libraries in prebuilt_apis.go
When the sdk_version or LOCAL_SDK_VERSION is not current or
TARGET_BUILD_APPS is not null, module will use the prebuilt
libraries. For this, prebuilt libraries are supported in
prebuilt_api.go

Bug:77577799
Test: make -j
Test: make -j TARGET_BUILD_APPS='camera2_stubs_test'
      and check intermediates files

Change-Id: I9540c1d1a7a030bcc599b77df8d101529b12b3bf
2018-06-13 22:51:45 +09:00
Jiyong Park
58c518b594 java_sdk_library does the apicheck by default
droiddoc now supports apicheck. java_sdk_library uses it to
automatically perform apichecks against the not-yet-release API and
the latest-released API.

A module type prebuilt_apis is added. It finds api txt files and creates
filegroup modules so that it can be referenced from java_sdk_library
across the module boundary.

Bug: 77575606
Test: m -j
Test: m -j checkapi
Test: m -j update-api
Change-Id: I0ba859972eac060296e1df2e71c4e047392d4877
2018-05-15 10:57:01 +09:00