Modules in a package is implicitly visible within the same package.
When making effective visibility rules which work from another location
that visibility needs to be mentioned explicitly. In practice this
allows prebuilts to remain visible to other modules in the source
package when the prebuilts are preferred.
Test: m nothing
Test: m conscrypt-module-sdk, check that the snapshot Soong modules give
visibility to //external/conscrypt
Bug: 151303681
Merged-In: I404f6e5ca7021974a8c7be5e4d6b4982c050b8a5
Change-Id: I404f6e5ca7021974a8c7be5e4d6b4982c050b8a5
(cherry picked from commit 0641d189d0)
To reduce clutter a little.
// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730
Test: m nothing
Merged-In: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819
Change-Id: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819
(cherry picked from commit 01407c525a)
The space after the backtick prevents it working when copy-pasting it
into the shell.
Test: create lint error => m => cp/pasted command runs successfully
Merged-In: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
Change-Id: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
(cherry picked from commit 3361a294c0)
// Added for rvc-dev. Used this bug as it is the bug that needs all the build changes.
Bug: 155164730
Change-Id: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.
Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Merged-In: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Vendor JNI libraries already have stable APIs enforced by the VNDK,
they shouldn't use SDK variants.
Bug: 156225490
Test: TestJNISDK
Change-Id: I21ba67e8e9fb05016caf5888129adc1a939545c2
Merged-In: I21ba67e8e9fb05016caf5888129adc1a939545c2
(cherry picked from commit c2d24050c5)
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.
Bug: 146586360
Test: m nothing
Merged-In: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
(cherry picked from commit 581bbbe8cb)
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
The module_lib scope should be called module-lib in order to pick up
the latest filegroup. Without it the API lint does not use a baseline
and so reports issues with released and unchangeable APIs.
It is also needed for the correct dist path.
Test: m update-api
Bug: 155164730
Merged-In: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f
Change-Id: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f
(cherry picked from commit 6b836ba566)
Allow the sdk_version against which the stubs for a scope are compiled
to be specified in the module on a per scope basis.
Bug: 155164730
Test: m nothing
Merged-In: I5881e5ee7c2169c30f544882344a60a602dae917
Change-Id: I5881e5ee7c2169c30f544882344a60a602dae917
(cherry picked from commit 87a05a389d)
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
Merged-In: I8a9c9c5a1bdceaee387c08864ae2b34629e0d46f
Change-Id: I8a9c9c5a1bdceaee387c08864ae2b34629e0d46f
(cherry picked from commit 51084ff6cf)
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
Merged-In: Ic859a61de155b3e582c17f6ab5e9298f5f4e709a
Change-Id: Ic859a61de155b3e582c17f6ab5e9298f5f4e709a
(cherry picked from commit 6c9c5fc4bc)
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
Merged-In: I966e82b8ae67624da168e05f5a2b062b832cb8cd
Change-Id: I966e82b8ae67624da168e05f5a2b062b832cb8cd
(cherry picked from commit dd9d0740fa)
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
Merged-In: I708657661188ea4a14a4dd8c6bc4b46237bbe5e0
Change-Id: I708657661188ea4a14a4dd8c6bc4b46237bbe5e0
(cherry picked from commit 1b1e8069ec)
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
Merged-In: I9be9aab07252b491ab292b8847138a93b487cf53
Change-Id: I9be9aab07252b491ab292b8847138a93b487cf53
(cherry picked from commit c3091c8c19)
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
Merged-In: Iea7d59852d7aeb503120acf3c44e08eb0d9d07b9
Change-Id: Iea7d59852d7aeb503120acf3c44e08eb0d9d07b9
(cherry picked from commit 0ff08bdb07)
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)
Previously, when writing to generatedContents \n characters were
quoted (replaced with \\n) so as to allow them to be preserved through
ninja/rsp/bash and were unquoted (replaced \\n with \n) just before
redirecting to the output file. That meant that any code which wanted
to access the contents for other purposes, e.g. testing had to unquote
\\n.
This change moves the quoting to be part of the code that generates the
ninja rule which simplifies any other code that has to access the
contents.
Without quoting the generated Android.bp files are not formatted
properly, are all on one line and completely unreadable.
Bug: 156286550
Test: m art-module-sdk and check generated Android.bp file to make sure
it is properly formatted.
Merged-In: I768c3b96ed08a3daf251730e2a10d9d72338c49a
Change-Id: I768c3b96ed08a3daf251730e2a10d9d72338c49a
(cherry picked from commit 1110827b3f)
To support parameterized mainline modules in Test Mapping, we plan to
add a new parameter called test_mainline_modules in build system to
auto-generate the test config based on the parameter.
For detailed information: go/test-mapping-mainline-gcl
(serach for auto-generated pattern)
Bug: 155238134
Test: add "test_mainline_modules: [some.apk]" to libstatspull_test,
and build the modules, confirm the parameterized option is added
in the test config.
Change-Id: I31d6dfbb71881d7a7026cf2f36ba6ca6a97870ad
Merged-In: I31d6dfbb71881d7a7026cf2f36ba6ca6a97870ad
Previously, the information that the java_sdk_library extracted from
its child dependencies was determined purely by the type of the
dependency and whether it had a tag of the appropriate type. The actual
tag itself was ignored. That worked but was a little fragile as it
relied on there being no overlap between the types of the dependencies
or if there was overlap on the order in which the dependencies were
processed and the dependency types were checked to ensure that the
correct information was collected.
This change makes the information that is extracted dependent on the
tag that is used. That makes the behavior much more robust and also
simplifes the follow up change which may get the stubs source and API
files from separate droidstubs invocations.
Changes:
* A func field is added to the scopeDependencyTag that is supplied with
a dependency from which to extract the information and scopePaths
into which the information will be stored.
* Each scopeDependencyTag instance supplies its own function.
* Various items are renamed to more closely reflect what they actually
do. e.g. the apiFileTag is renamed to stubsSourceAndApiTag field
because if provides access to both api file and stubs source.
Test: m checkapi
Bug: 155164730
Merged-In: I4e1861ea67f441f2948a0d7d7053ab0b1169955f
Change-Id: I4e1861ea67f441f2948a0d7d7053ab0b1169955f
(cherry picked from commit c878250d3f)
Metalava apparently normalizes the SystemApi annotation that was
previously used to the form that this change uses so this is
effectively a no-op. However, this does make this code more
self-consistent and also matches the form that is used in the framework
defaults for the mainline modules.
Test: m checkapi
Bug: 155164730
Merged-In: Ic99b7333730ed8b918d8af72ae7bd6a851c2093a
Change-Id: Ic99b7333730ed8b918d8af72ae7bd6a851c2093a
(cherry picked from commit 0d543640d5)
Similar to APEX-deps-info, app deps info produces two lists with
transitive dependencies.
Bug: 149622332
Test: m NetworkStack-deps-info
Change-Id: Ic6d94df3b7b4be5afe328a0abe768beee1a58362
Merged-In: Ic6d94df3b7b4be5afe328a0abe768beee1a58362
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 1111b84822)
* changes:
java_sdk_library: Specify visibility of stubs modules
Retry: Fix snapshot of a host/device cc_library with stubs
Retry: Adds support for 'ignored-on-host'
Retry: Detect invalid arch specific properties in snapshot
Adds two new properties to specify the visibility of the stubs modules
(source and library) created by the java_sdk_library. Excludes
visibility property from being inherited when creating the module so it
can be properly specified by copying across the relevant property.
Test: m checkapi
Bug: 155164730
Merged-In: Iffdd9f191ff0d74646356ac577560cc38efdd790
Change-Id: Iffdd9f191ff0d74646356ac577560cc38efdd790
(cherry picked from commit 4911a89181)
Change since last attempt: Disable test that breaks on darwin.
Adds a test that fails with unknown property android.stubs.versions
and then fixes that by marking the field from which that property is
created with 'ignored-on-host' and implemented the isHostVariant on
*osTypeSpecificInfo.
Bug: 155628860
Test: m nothing
Merged-In: Ia4e744c9e799d5adaf8a2f761516f568ec363ad4
Change-Id: Ia4e744c9e799d5adaf8a2f761516f568ec363ad4
(cherry picked from commit 7a1f7f32ab)
Adds a filter mechanism that can exclude property values from being
included in the common value extraction. That is needed to prevent the
snapshot mechanism from generating invalid output for properties that
are ignored on host (and have their values cleared) and which are not
tagged with `android:"arch_variant"`.
Changes:
* Updates the documentation of SdkMemberType to explain what effect
the 'ignored-on-host' tag has.
* Adds some tests for this new mechanism.
Bug: 155628860
Test: m nothing
Merged-In: Ibafdb6e921ba5abe505bd8a91ca5a1d9c9b5d0cb
Change-Id: Ibafdb6e921ba5abe505bd8a91ca5a1d9c9b5d0cb
(cherry picked from commit c459f89fb4)
Previously, the snapshot code did not know whether a specific property
could be arch specific or not and assumed that they all were which
meant that it could generate snapshots containing arch specific values
for properties that are not arch specific and so would fail when
unpacked.
This change requires arch specific fields in SdkMemberProperties to be
tagged as such using `android:"arch_variant"` (just as in module input
property structures). Any property without that must have properties
that are common across all variants.
Bug: 155628860
Test: m nothing
Merged-In: I3df60f0b53ba02ec2c55a80c7da058eac5909d26
Change-Id: I3df60f0b53ba02ec2c55a80c7da058eac5909d26
(cherry picked from commit 864e1b45db)
Check that jni_uses_sdk_apis and jni_uses_platform_apis are consistent
with sdk_version, and add tests that they select the right variant.
Bug: 154665579
Test: app_test.go
Change-Id: I544a4f881ba16dacd7e74cd480c095091b3cf667
Merged-In: I544a4f881ba16dacd7e74cd480c095091b3cf667
(cherry picked from commit 3c007704c7)