Commit Graph

29 Commits

Author SHA1 Message Date
Anton Hansson
2fc9706990 Merge "Use module_current to build module stubs" into rvc-dev am: a94c9b8d0c
Change-Id: Iecdff7e35dd8f6d3d2f16a7b9e0bc1266992ada4
2020-04-10 08:32:06 +00:00
Treehugger Robot
52693bd2df Merge "Disable stubs generation when generating module_lib .txt file" am: 95f4ad098a am: 99142fc4c6
Change-Id: I11bf75b8ad226194bbca6731f833c9da8fbdfd7e
2020-04-10 08:21:43 +00:00
Paul Duffin
4c5dc18da5 Disable stubs generation when generating module_lib .txt file
Avoids droidstubs doing unnecessary work to create stubs files that are
not actually used.

Bug: 146727827
Test: framework-sdkextensions-api-module_libs_api
Change-Id: Ic537fda99b564877709666025fb8df872144d827
2020-04-09 18:11:26 +01:00
Anton Hansson
eb34cbee12 Use module_current to build module stubs
module_current is always built from sources, whereas the
other SDK jars are being transitioned to be composed of
a set of stubs. This avoids the dependency cycle of module
stubs depending on themselves.

Bug: 144149403
Test: m
Change-Id: I31c6d0fa958aa502131352716a9f950828b7829c
2020-04-08 16:37:10 +01:00
Anton Hansson
f68ef068b1 Add package filter for system_server stubs
Should prevent accidental addition of APIs outside com.android,
which is where we want these APIs to be.

Bug: 149293194
Test: m update-api
Change-Id: I144ce6dbfe524106fc7de87318f66390c31b45af
Merged-In: I144ce6dbfe524106fc7de87318f66390c31b45af
2020-03-31 10:02:40 +01:00
Anton Hansson
087646e97d Limit framework module api packages
Use the same whitelist of packages that the non-updatable
part of the platform uses for now. This avoids exposing some
internal classes in a follow-up CL.

Move telephony off the module-wide defaults for now, as the
telephony stubs are causing problems.

Bug: 149293194
Test: m checkapi
Change-Id: Iedc8c309cef8290ac14e1ad32b5b66656145f557
Merged-In: Iedc8c309cef8290ac14e1ad32b5b66656145f557
2020-03-31 10:01:18 +01:00
Anton Hansson
26e1ed6dbf Add default configs for module service stubs
To be used by individual modules with service components that
define system_server APIs.

Bug: 147768409
Test: m
Change-Id: Iff6a5a840c5dd7731e881d7db379915375d02324
Merged-In: Iff6a5a840c5dd7731e881d7db379915375d02324
(cherry picked from commit 180ec39abe)
2020-03-31 09:59:32 +01:00
Anton Hansson
26c1b004da Merge "Limit framework module api packages" into rvc-dev 2020-03-28 16:51:13 +00:00
Anton Hansson
038922a526 Merge "Add package filter for system_server stubs" into rvc-dev 2020-03-27 20:57:54 +00:00
Anton Hansson
f79b08b7ab Limit framework module api packages
Use the same whitelist of packages that the non-updatable
part of the platform uses for now. This avoids exposing some
internal classes in a follow-up CL.

Move telephony off the module-wide defaults for now, as the
telephony stubs are causing problems.

Bug: 149293194
Test: m checkapi
Change-Id: Iedc8c309cef8290ac14e1ad32b5b66656145f557
2020-03-27 20:56:59 +00:00
Anton Hansson
442fcf48c4 Add package filter for system_server stubs
Should prevent accidental addition of APIs outside com.android,
which is where we want these APIs to be.

Also fix a bug in the permission filegroup where it wasn't
specifying the subpath of its code.

Bug: 149293194
Test: m update-api
Change-Id: I144ce6dbfe524106fc7de87318f66390c31b45af
2020-03-27 15:09:26 +00:00
Anton Hansson
5259a14d53 Dist module stub libraries for in sdk builds
Makes the stub libraries accessible to update_prebuilts.py,
so they can be finalized together with their txt files (already dist'd).

Bug: 149293194
Test: m dist sdk && find out/dist -name 'framework-*.jar'
Change-Id: Id4070113bf786bf79573d7b29cd98fcd86e20851
2020-03-26 10:46:26 +00:00
Anton Hansson
c8cc1eb4da Add defaults for framework stub libs
Useful to be able to change settings for all stub libs at
the same time. For example, disting these libraries will be
done soon.

Bug: 149293194
Test: followup CLs
Change-Id: I4dda5b44b6d4e76018acb50f46d05816cc4c7f0b
Merged-In: I4dda5b44b6d4e76018acb50f46d05816cc4c7f0b
(cherry picked from commit b470bf3434)
2020-03-25 14:09:20 +00:00
Anton Hansson
b470bf3434 Add defaults for framework stub libs
Useful to be able to change settings for all stub libs at
the same time. For example, disting these libraries will be
done soon.

Bug: 149293194
Test: followup CLs
Change-Id: I4dda5b44b6d4e76018acb50f46d05816cc4c7f0b
2020-03-24 19:40:38 +00:00
Anton Hansson
a92a23bc69 Make module apis dist their output
Only populate the targets and dir attributes. The output name
will be autopopulated to the filename, which differs by module.

Bug: 149293194
Test: m dist sdk && find out/dist/apistubs -name 'framework-*.txt'
Change-Id: I8502eb90a10d8b1ca998c2eba5646c662638ce3f
2020-03-23 18:18:27 +00:00
Anton Hansson
180ec39abe Add default configs for module service stubs
To be used by individual modules with service components that
define system_server APIs.

Bug: 147768409
Test: m
Change-Id: Iff6a5a840c5dd7731e881d7db379915375d02324
2020-03-23 15:08:04 +00:00
Anton Hansson
5d708e52e4 Add individual API tracking files for modules
This adds metalava api tracking generation to the module
stub rules, to make sure we know exactly what API a
particular module stub exports.

Bug: 147768409
Test: m update-api check-api
Exempt-From-Owner-Approval: approved internally
Change-Id: Iaf2ef5b5751eb208d119ddbc74481239366fe581
Merged-In: Iaf2ef5b5751eb208d119ddbc74481239366fe581
(cherry picked from commit bb61f963e3)
2020-03-19 08:51:11 +00:00
Anton Hansson
397eb47191 Don't pass annotation srcs to metalava for modules
Doing so can make these annotation end up in API tracking files
for modules, which we don't want. Put them on the classpath instead.

Bug: 147768409
Test: m
Change-Id: Ibb044c099174ee8591e14b6e2c683a46c1a756ef
Merged-In: Ibb044c099174ee8591e14b6e2c683a46c1a756ef
2020-03-19 08:24:15 +00:00
Anton Hansson
dc033c35c0 Add individual API tracking files for modules
This adds metalava api tracking generation to the module
stub rules, to make sure we know exactly what API a
particular module stub exports.

Bug: 147768409
Test: m update-api
Exempt-From-Owner-Approval: Approved in master
Change-Id: Iaf2ef5b5751eb208d119ddbc74481239366fe581
Merged-In: Iaf2ef5b5751eb208d119ddbc74481239366fe581
2020-03-18 11:03:12 +00:00
Anton Hansson
4d90a280d6 Put sdk_version in module stub defaults
Makes it easier to change when every module isn't specifying
how the stubs are built.

Also make wifi stubs build against the appropriate api surface, which
works around a bug.

Bug: 147768409
Bug: 151134996
Test: m
Change-Id: I91db06ef932a73002b4fe232566f5d111baef432
Merged-In: I91db06ef932a73002b4fe232566f5d111baef432
2020-03-16 15:52:34 +00:00
Anton Hansson
3b9ac0cb9d Don't pass annotation srcs to metalava for modules
Doing so can make these annotation end up in API tracking files
for modules, which we don't want. Put them on the classpath instead.

Bug: 147768409
Test: m
Change-Id: Ibb044c099174ee8591e14b6e2c683a46c1a756ef
2020-03-13 16:28:21 +00:00
Anton Hansson
1527353675 Put sdk_version in module stub defaults
Makes it easier to change when every module isn't specifying
how the stubs are built.

Also make wifi stubs build against the appropriate api surface, which
works around a bug.

Bug: 147768409
Bug: 151134996
Test: m
Change-Id: I91db06ef932a73002b4fe232566f5d111baef432
2020-03-10 12:12:19 +00:00
Jiyong Park
7f1e9b27ce stubs inheriting from framework-module-stubs-defaults-* now works
This change fixes a problem that droidstub modules inheriting from
framework-module-stubs-defaults-* don't emit any source code. The
problem was happening because

1) --show-annotation was with incorrect format; it had trailing
"," in the parameter list and
2) the class SystemApi was not available to metalava, which made
prevented it from processing any API annotated with @SystemApi.

Fixing the problem by forcibly adding framework annotations to the
sources of the default modules.

Bug: 1241127
Test: `m ike-stubs` and check its output
Merged-In: Icbbbddb4fb68055f27aa314983a9c556e51f037a
(cherry picked from commit b4f8a85245)
Change-Id: Icbbbddb4fb68055f27aa314983a9c556e51f037a
2020-02-27 12:26:47 +09:00
Jiyong Park
b4f8a85245 stubs inheriting from framework-module-stubs-defaults-* now works
This change fixes a problem that droidstub modules inheriting from
framework-module-stubs-defaults-* don't emit any source code. The
problem was happening because

1) --show-annotation was with incorrect format; it had trailing
"," in the parameter list and
2) the class SystemApi was not available to metalava, which made
prevented it from processing any API annotated with @SystemApi.

Fixing the problem by forcibly adding framework annotations to the
sources of the default modules.

Bug: 1241127
Test: `m ike-stubs` and check its output
Change-Id: Icbbbddb4fb68055f27aa314983a9c556e51f037a
2020-02-25 17:18:38 +09:00
Anton Hansson
a12addc295 Tweak the defaults of module stubs
We will have 4 stubs for each framework module:
- stubs-publicapi with check_api
- stubs-systemapi with check_api
- api-module_api with check_api, just module_api
- stubs-module_api without check_api, module_api + priv_apps

This is because we want the stubs of module_api to include the priv_apps
system APIs, but don't want the api .txt files to contain them.

The check_api attrs will be setup later, when the individual modules
have been set up to inherit these defaults correctly.

Bug: 147768409
Test: m
Change-Id: Ie0fbff6949c8df3d6211558de7373bddb8b95768
2020-02-03 14:59:40 +00:00
Anton Hansson
5036ab60c2 Make wifi module use shared metalava args
Also (hopefully) temporarily filter out com.android.server
from the stubs, as the wifi module has a server class in
it.

Bug: 137191822
Test: m
Change-Id: I2c62fc16c676305e9ee739285f49656075f38b97
Merged-In: I2c62fc16c676305e9ee739285f49656075f38b97
(cherry picked from commit 0c2ebe2bbf)
2020-02-03 14:57:55 +00:00
Jiyong Park
7be934f395 Define stubs_defaults for the new API surfaces
The new stubs_defaults shall be used to create stub libraries from
modules. The existing defaults
'framework-module-stubs-defaults-systemapi' is not enough because it
only captures the SystemApis with client=PRIVILEGED_APPS. Modules can
have broader SystemApis with client=MODULE_APPS and
client=MODULE_LIBRARIES.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: b/140202860
Test: m
Merged-In: I5f425928cf1db912ebe09499111a9925fcfc98fb
Change-Id: I5f425928cf1db912ebe09499111a9925fcfc98fb
(cherry picked from commit 2afff6cc73)
2020-01-13 21:34:50 +09:00
Anton Hansson
cfa5532127 Add SystemApi params to framework-module defaults
As was done in I3305b71e22970e80db95f3daf3d7713603c7d68d for
the other metalava args.

Exempt-From-Owner-Approval: cherry-pick internal

Bug: 140202860
Test: m
Merged-In: I397d361f649f179eada827782d82c002cc7fb2d3
Change-Id: I397d361f649f179eada827782d82c002cc7fb2d3
(cherry picked from commit 14c80cf363)
2020-01-13 21:34:16 +09:00
Anton Hansson
24c88f43a9 Add stubs_defaults for framework modules
Add some reasonable defaults that can be reused instead of
duplicating the metalava args for every module.

Bug: 145998881
Test: followup CL depends on these
Change-Id: I31c37289ec38cfc9039a9b2c30b2f3396fc0a72c
2019-12-13 16:19:56 +00:00