Commit Graph

22183 Commits

Author SHA1 Message Date
Paul Duffin
efcbb61e8a [automerger skipped] Enable api_lint in java_sdk_library am: 8986cc947c -s ours
am skip reason: Change-Id I87ca5a942228cf6af1a9939f0334d6fc46c39a63 with SHA-1 160fe41c39 is in history

Change-Id: Ife1c3e7c7d9d2d27329320bfc1b2efce00c902ed
2020-05-13 14:01:30 +00:00
Treehugger Robot
8c30912b64 Merge "Remove unused Module.visibility() method" am: 717e50c630 am: 5c9c0e79e0
Change-Id: Iebd9e08a399a827bda6441326d7884ae5cd1bbf7
2020-05-13 12:22:59 +00:00
Treehugger Robot
ecc80fce50 Merge "Add //visibility:override to allow control over inheritance" am: 5bc07e59e3 am: 290ae01f42
Change-Id: I4018d83a19e854d5ba38452ac76f784b3fe78061
2020-05-13 12:22:52 +00:00
Treehugger Robot
5c9c0e79e0 Merge "Remove unused Module.visibility() method" am: 717e50c630
Change-Id: I25746735f0a7ab6219888925d106291c66d064b8
2020-05-13 12:04:47 +00:00
Treehugger Robot
290ae01f42 Merge "Add //visibility:override to allow control over inheritance" am: 5bc07e59e3
Change-Id: I7e73f5a0fb5a1a6665b80aa8b3bdcb3bf4ae8199
2020-05-13 12:04:39 +00:00
Treehugger Robot
717e50c630 Merge "Remove unused Module.visibility() method" 2020-05-13 11:53:49 +00:00
Treehugger Robot
5bc07e59e3 Merge "Add //visibility:override to allow control over inheritance" 2020-05-13 11:53:43 +00:00
Paul Duffin
8986cc947c Enable api_lint in java_sdk_library
Adds api_lint.enabled property to control whether API linting should be
performed.

Test: m checkapi
Bug: 156126315
Merged-In: I87ca5a942228cf6af1a9939f0334d6fc46c39a63
Change-Id: I87ca5a942228cf6af1a9939f0334d6fc46c39a63
(cherry picked from commit 160fe41c39)
2020-05-13 11:27:44 +01:00
Paul Duffin
d52fd68933 java_sdk_library: Add framework-modules naming scheme am: 6c9c5fc4bc am: 35dd087ac2
Change-Id: Icf988bd62716a7870b4583b4f83086dbc8b275de
2020-05-13 08:43:39 +00:00
Paul Duffin
44ab8cad82 java_sdk_library: Remove some almost single use constants am: dd9d0740fa am: 04e787a74a
Change-Id: I1fba19d2f21021a8de3c04badc43e07e8ec6fd34
2020-05-13 08:43:31 +00:00
Paul Duffin
c0bb45605d java_sdk_library: Delegate component module to naming scheme am: 1b1e8069ec am: 4fc05862d6
Change-Id: Id61c950ddb4607691951371c972985e503a020a1
2020-05-13 08:43:28 +00:00
Paul Duffin
29cba10756 java_sdk_library: Extract child module naming to common struct am: c3091c8c19 am: edcb7f889e
Change-Id: Ie7d6bb07746c1fbe77ac42aa7a7b26534e208c61
2020-05-13 08:43:21 +00:00
Paul Duffin
7421be5e53 java_sdk_library: Allow separate api/stubs source modules am: 0ff08bdb07 am: 4f7962e268
Change-Id: I8475dc1ae5cad4d036fa16616daf149941a96d45
2020-05-13 08:43:17 +00:00
Paul Duffin
35dd087ac2 java_sdk_library: Add framework-modules naming scheme am: 6c9c5fc4bc
Change-Id: I0621e83f790a5aa9458e9d24d4e5bcdcfba96c49
2020-05-13 08:32:45 +00:00
Paul Duffin
04e787a74a java_sdk_library: Remove some almost single use constants am: dd9d0740fa
Change-Id: Ic042f2e06d833d5487c90fb5b74949939f632749
2020-05-13 08:32:39 +00:00
Paul Duffin
4fc05862d6 java_sdk_library: Delegate component module to naming scheme am: 1b1e8069ec
Change-Id: I3fbe8b22d55136c2dfd0ad2713ca495416c265bb
2020-05-13 08:32:37 +00:00
Paul Duffin
edcb7f889e java_sdk_library: Extract child module naming to common struct am: c3091c8c19
Change-Id: Ideb0faf635aac8bad39e70360987b3c8e1c73b7e
2020-05-13 08:32:25 +00:00
Paul Duffin
4f7962e268 java_sdk_library: Allow separate api/stubs source modules am: 0ff08bdb07
Change-Id: If70a36168d75fc432ebe913b772820739838885f
2020-05-13 08:32:22 +00:00
Treehugger Robot
8bd96e8c7e Merge "java_sdk_library: Preserve sdk_version: "none" in snapshot" am: fced20c3b4 am: 56730409dd
Change-Id: I8561184ff769a20f44e8c5399ee94c78c731f177
2020-05-13 08:01:16 +00:00
Treehugger Robot
c13cd601e8 Merge "Allow sdk_version: "none" to be used in prebuilts/" am: 46c907627b am: 16574cdea8
Change-Id: I0eda60684cd36ebd4174a26fbef8f03f05e0e2c1
2020-05-13 08:01:09 +00:00
Treehugger Robot
aaf54ecb48 Merge "Enable api_lint in java_sdk_library" am: c0320878e6 am: 3bab3bd9d1
Change-Id: I693e9857ec13ba1e553df6d04f1c0b5d275f1d8b
2020-05-13 08:01:01 +00:00
Paul Duffin
6c9c5fc4bc java_sdk_library: Add framework-modules naming scheme
Matches the naming scheme used by the separate manually created modules
that will be replaced by java_sdk_library's automatically created
components. This will simplify conversion to java_sdk_library as it
will allow developers to concentrate on getting the conversion correct
without also having to worry about name changes. It will also allow the
conversions to be parallelized as many of the references to the
components are in places where conflicts are likely.

Test: m nothing
Bug: 155480189
Change-Id: Ic859a61de155b3e582c17f6ab5e9298f5f4e709a
2020-05-13 08:52:56 +01:00
Paul Duffin
dd9d0740fa java_sdk_library: Remove some almost single use constants
The constants are only used in one place in the code and in the test.
This change switches the test code to use the apiScope methods to
generate the names and then inlines the constants in those methods. It
makes it easier to see the naming convention.

Test: m nothing
Bug: 155480189
Change-Id: I966e82b8ae67624da168e05f5a2b062b832cb8cd
2020-05-13 08:52:56 +01:00
Paul Duffin
1b1e8069ec java_sdk_library: Delegate component module to naming scheme
Adds a naming scheme abstraction to which the java_sdk_library/import
will delegate the task of creating the names of their component
modules. The naming scheme can be selected in a module definition but
for now the only supported option is "default".

Test: m nothing
Bug: 155480189
Change-Id: I708657661188ea4a14a4dd8c6bc4b46237bbe5e0
2020-05-13 08:52:56 +01:00
Paul Duffin
c3091c8c19 java_sdk_library: Extract child module naming to common struct
Extracts the child module naming to the commonToSdkLibraryAndImport
struct so it can be reused by both sdk library source and prebuilt.

Also:
* Makes all child module name generation go through the common struct.
* Renames some of the methods to clarify their purpose and improve
  consistency.

Test: m nothing
Bug: 155480189
Change-Id: I9be9aab07252b491ab292b8847138a93b487cf53
2020-05-13 08:52:56 +01:00
Paul Duffin
0ff08bdb07 java_sdk_library: Allow separate api/stubs source modules
The API file for a scope represents the differences between the API
provided by that scope and that provided by the scope that it extends.
On the other hand the stubs source for a scope represents the union of
the API provided by the scope and the scope it extends (all the way
back to public).

Unfortunately, while metalava supports this behavior for scopes that
extend public (e.g. system and test) it does not support this behavior
for scopes that extend others, e.g. module_lib which extends system.
This is because it always assumes that the baseline for the API file
is 'public' and so has no way to defined other baselines.

This change works around that by having separate droidstubs modules to
generate the API and stubs sources for scopes that require different
arguments to generate the API and stubs sources.

Test: m checkapi
Bug: 155164730
Change-Id: Iea7d59852d7aeb503120acf3c44e08eb0d9d07b9
2020-05-13 08:52:53 +01:00
Treehugger Robot
56730409dd Merge "java_sdk_library: Preserve sdk_version: "none" in snapshot" am: fced20c3b4
Change-Id: Ib05702864a77799d5abd84f7fe4dde651eb886b6
2020-05-13 07:50:13 +00:00
Treehugger Robot
16574cdea8 Merge "Allow sdk_version: "none" to be used in prebuilts/" am: 46c907627b
Change-Id: Ifaced0e5a8913b3b95aa469a05c68334037c3de8
2020-05-13 07:50:07 +00:00
Treehugger Robot
3bab3bd9d1 Merge "Enable api_lint in java_sdk_library" am: c0320878e6
Change-Id: I220f6816c84ae4f412442bfd91a3c2f331ac45d7
2020-05-13 07:49:55 +00:00
Treehugger Robot
fced20c3b4 Merge "java_sdk_library: Preserve sdk_version: "none" in snapshot" 2020-05-13 07:36:43 +00:00
Treehugger Robot
46c907627b Merge "Allow sdk_version: "none" to be used in prebuilts/" 2020-05-13 07:36:04 +00:00
Treehugger Robot
c0320878e6 Merge "Enable api_lint in java_sdk_library" 2020-05-13 07:35:15 +00:00
TreeHugger Robot
8bfac1dc94 [automerger skipped] Merge "Add test_mainline_modules to the auto-gen test config(GTest only)." into rvc-dev am: a7a30b63e9 -s ours
am skip reason: Change-Id I31d6dfbb71881d7a7026cf2f36ba6ca6a97870ad with SHA-1 1e3fdcd182 is in history

Change-Id: If30e2351ce5d8e2bbea861d4f32dc34325eaaf0b
2020-05-13 03:33:56 +00:00
TreeHugger Robot
a7a30b63e9 Merge "Add test_mainline_modules to the auto-gen test config(GTest only)." into rvc-dev 2020-05-13 03:20:42 +00:00
Colin Cross
b85063c64a Merge "Revert "enforce sdk_version for JNI libs for updatable APKs"" am: 2bdf0da9e7 am: 6e55eb8f69
Change-Id: I88b97cb5794aa17ebf11903847e0f57f8517f6ad
2020-05-13 01:55:38 +00:00
Colin Cross
6e55eb8f69 Merge "Revert "enforce sdk_version for JNI libs for updatable APKs"" am: 2bdf0da9e7
Change-Id: If534a74d40bb852c8f2ac58670e8468c496c58f5
2020-05-13 01:40:37 +00:00
Colin Cross
2bdf0da9e7 Merge "Revert "enforce sdk_version for JNI libs for updatable APKs"" 2020-05-13 01:26:25 +00:00
Jooyung Han
cc928d9059 Revert "enforce sdk_version for JNI libs for updatable APKs"
This reverts commit 98c4750f39.

Reason for revert: broken builds

Change-Id: Icd3a9e226ff8ff288b682757cded9f43069ebc5e
2020-05-13 01:22:56 +00:00
Treehugger Robot
58461c4a42 Merge "enforce sdk_version for JNI libs for updatable APKs" am: 1852b586bf am: 548c377bee
Change-Id: Icb9cd88d908d28eebd89d25429b64fc30faf60bb
2020-05-13 01:22:49 +00:00
Treehugger Robot
548c377bee Merge "enforce sdk_version for JNI libs for updatable APKs" am: 1852b586bf
Change-Id: I84d7039417a5c518659f044055cf86a85c506576
2020-05-13 01:06:36 +00:00
Treehugger Robot
1852b586bf Merge "enforce sdk_version for JNI libs for updatable APKs" 2020-05-13 00:57:34 +00:00
Treehugger Robot
c589305e8d Merge "Add support for the remote execution of Abi links." am: c81f967ddd am: e1d817f150
Change-Id: I8a276845427bab7ad7f2135672ac39e291944eb9
2020-05-12 22:00:25 +00:00
Treehugger Robot
e1d817f150 Merge "Add support for the remote execution of Abi links." am: c81f967ddd
Change-Id: I39f20b3527c3cdae74b2c73674eba14bf49af752
2020-05-12 21:46:27 +00:00
Treehugger Robot
c81f967ddd Merge "Add support for the remote execution of Abi links." 2020-05-12 21:35:43 +00:00
Stephen Hines
b99c9d52e2 Default to zero-initialization instead of pattern. am: 7871416eec am: a6ca70a374
Change-Id: I79affb3afb753859a38002a1b560d0876f8dfa87
2020-05-12 19:44:24 +00:00
Stephen Hines
a6ca70a374 Default to zero-initialization instead of pattern. am: 7871416eec
Change-Id: Ide57a1b64926a22c23cc2e83552820954aeaaa4a
2020-05-12 19:27:48 +00:00
Paul Duffin
36c5b8d0b8 Remove unused Module.visibility() method
Bug: 155787200
Test: m nothing
Change-Id: Iee7a9ab9d816ed1948e2c7cde23f9907cfda337d
2020-05-12 20:07:46 +01:00
Paul Duffin
51084ff6cf Add //visibility:override to allow control over inheritance
Visibility rules can be 'inherited' in one of two ways. Either from
defaults or from a module that called ctx.CreateModule(...).
Previously, in both cases the inheriting module could only append
additional visibility rules to the end of the inherited rules. That
made it impossible to restrict the visibility by removing or ignore
inherited rules.

The //visibility:override rectifies that by allowing the inheriting
module to ignore all the rules that they would have inherited. It can
only go at the beginning of a list of rules specified in a module but
after defaults are applied it can end up in the middle of a list of
rules. In that case it behaves as if all the rules up to and including
the //visibility:override rule were discarded.

It can be used with //visibility:private to override
//visibility:public and vice versa.

Bug: 155787200
Test: m nothing
Change-Id: I8a9c9c5a1bdceaee387c08864ae2b34629e0d46f
2020-05-12 20:07:46 +01:00
Paul Duffin
780c5f4715 java_sdk_library: Preserve sdk_version: "none" in snapshot
Test: m nothing
Bug: 156354511
Change-Id: Icf7c20dc109a773430768c1a2d91c674551dbc1b
2020-05-12 15:52:55 +01:00
Paul Duffin
e5c3b85ee5 Allow sdk_version: "none" to be used in prebuilts/
Bug: 156354511
Test: m nothing
Change-Id: Iffce78cbce88a8341146bf19e78acf25fc69f2b0
2020-05-12 15:33:52 +01:00