Commit Graph

2090 Commits

Author SHA1 Message Date
Colin Cross 49e94c0a92 Merge "Use system modules for prebuilt SDKs >=30" 2020-05-18 19:02:43 +00:00
Treehugger Robot 1d9e2364ed Merge "Add test_mainline_modules to the auto-gen test config(AndroidJUnitTest only)." 2020-05-18 01:50:49 +00:00
Paul Duffin 0d3c2e136b Extract common behavior between Module and Import
Although the duplication being eliminated here is minimal follow up
changes will add more functionality that is common to Module and
Import.

Test: m nothing
Bug: 156723295
Change-Id: I1733405526764272beba63470a9bc8a958d41024
2020-05-17 13:32:13 +01:00
Paul Duffin a18abc2a61 java_sdk_library: Remove unnecessary qualification of fields
Fields in embedded structures can be accessed without qualifying them
by the type of the embedded structure.

This reduces the size of follow up changes that switch java_sdk_library
from embedding Library.

Bug: 156618935
Test: m nothing
Change-Id: I84f294c6f02d5089055130c63f5fb0538a1f21b9
2020-05-16 19:29:59 +01:00
Treehugger Robot 781baf01eb Merge "Remove unnecessary copying of common properties" 2020-05-16 14:22:01 +00:00
Paul Duffin 1dbe3ca254 Remove unnecessary copying of common properties
The (Soc/Device/Product/System_ext)_specific are all properties in
ModuleBase.commonProperties. Initially, they were explicitly copied
from the parent to the child. Since then the CreateModule() method
was modified to automatically copy all the commonProperties from the
parent to the child so this code is no longer necessary.

Bug: 156618935
Test: m nothing
      checked that it does not change the generated xml permissions
	  file for a java_sdk_library that sets soc_specific: true and
	  is in the vendor partition.
Change-Id: I8c985b50cb6b6c019b33a4652de482ded689fee4
2020-05-16 13:06:55 +01: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
Jaewoong Jung 805f2492e8 Merge "Add apex_set module." 2020-05-15 23:13:38 +00:00
Treehugger Robot e070b8ebb4 Merge "Add lineage file to deps for signapk." 2020-05-15 20:48:09 +00:00
Jaewoong Jung fa00c06187 Add apex_set module.
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
2020-05-15 11:02:01 -07:00
easoncylee 5bcff5d1fd Add test_mainline_modules to the auto-gen test config(AndroidJUnitTest only).
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
(search for auto-generated pattern)

Bug: 155238134
Test: add "test_mainline_modules: [some.apk]" to TetheringTests,
and build the modules, confirm the parameterized option is added
in the test config.

Change-Id: I41ba8749ce46da62db402a8b8a555d4874e1cfc0
2020-05-15 12:50:48 +08:00
Sasha Smundak a7856c0077 Implement android_app_set module
Bug: 152319766
Test: manual and builtin
Change-Id: Id0877476f9ae23311d92c0b59a9c568140ab4119
2020-05-14 19:01:11 -07:00
Liz Kammer a7126555c9 Add lineage file to deps for signapk.
(This is a cherry pick.)

Test: app_test.go
Bug: 153366049
Merged-In: I1481eb51d5d02674922459bdfac65c59d1130015
Change-Id: I1481eb51d5d02674922459bdfac65c59d1130015
2020-05-14 16:29:36 -07:00
Treehugger Robot dcd0fc4be7 Merge "Add signing certificate lineage support to soong" 2020-05-14 23:11:24 +00:00
Colin Cross cb1d161666 Merge "Don't use SDK variant for vendor JNI libraries" 2020-05-14 22:59:47 +00:00
Paul Duffin 6b836ba566 Correct module_lib scope name
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
Change-Id: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f
2020-05-14 00:53:50 +01:00
Paul Duffin f9088b03c2 Merge "java_sdk_library: Propagate naming_scheme to snapshot" 2020-05-13 23:49:20 +00:00
Treehugger Robot bb008e6213 Merge "Reland "enforce sdk_version for JNI libs for updatable APKs"" 2020-05-13 23:24:26 +00:00
Liz Kammer e2b27f473f Add signing certificate lineage support to soong
(This is a cherry pick.)

Test: app_test
Bug: 153366049
Merged-In: I65a92d6c40057dcc01950991fb7be485de1c9080
Change-Id: I65a92d6c40057dcc01950991fb7be485de1c9080
2020-05-13 14:30:53 -07:00
Paul Duffin f7a6433bab java_sdk_library: Propagate naming_scheme to snapshot
Bug: 155164730
Test: m nothing
Change-Id: Iec7c52d2102b6294540090f3c1e32bd9d8cc7da8
2020-05-13 20:40:53 +01:00
Paul Duffin 38b5785e3f java_sdk_library_import: Propagate prefer to child modules
Bug: 155164730
Test: m nothing
Change-Id: Idb06d79baf346ac570beada79880814c5ef6bb50
2020-05-13 20:40:53 +01:00
Colin Cross c2d24050c5 Don't use SDK variant for vendor JNI libraries
Vendor JNI libraries already have stable APIs enforced by the VNDK,
they shouldn't use SDK variants.

Bug: 156225490
Test: TestJNISDK
Change-Id: I21ba67e8e9fb05016caf5888129adc1a939545c2
2020-05-13 11:10:38 -07:00
Jooyung Han bbc3fb780b Reland "enforce sdk_version for JNI libs for updatable APKs"
JNI libs for "updatable" APKs or APKs in "updatable" APEXes should set
sdk_version which is equal to or less than APK's min_sdk_version.

In fact, we'd better check if min_sdk_version of JNI libs matches(or is
earlier than) min_sdk_version of the APK. But for now the build system
can't handle sdk_version/min_sdk_version correctly for JNI libs. That's
why sdk_version of JNI libs is enforced to match with min_sdk_version
of APK in this change.

(original commit: 98c4750f39)

Bug: 145796956
Test: m
Change-Id: I08543ccee7dfda0559a1fca108ceb5c28f84943f
2020-05-14 00:19:45 +09:00
Paul Duffin 87a05a389d java_sdk_library: Add sdk_version for API scopes
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
Change-Id: I5881e5ee7c2169c30f544882344a60a602dae917
2020-05-13 13:09:23 +01: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 fced20c3b4 Merge "java_sdk_library: Preserve sdk_version: "none" in snapshot" 2020-05-13 07:36:43 +00:00
Treehugger Robot c0320878e6 Merge "Enable api_lint in java_sdk_library" 2020-05-13 07:35:15 +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 1852b586bf Merge "enforce sdk_version for JNI libs for updatable APKs" 2020-05-13 00:57:34 +00: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
Treehugger Robot e72da7f63c Merge "Add sourcepath to inputs of remoteable metalava action." 2020-05-12 04:15:16 +00:00
Ramy Medhat 0a5c8dea01 Add sourcepath to inputs of remoteable metalava action.
Test: presubmit
Change-Id: Idd77abddac0a676302226eb62883c74d5d7489af
2020-05-11 16:49:37 -04:00
Anton Hansson 432f75c61a Merge "Fix API lint copy command" 2020-05-11 17:54:08 +00:00
Paul Duffin 160fe41c39 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
Change-Id: I87ca5a942228cf6af1a9939f0334d6fc46c39a63
2020-05-11 18:05:45 +01:00
satayev ecea813997 Merge "Introduce app -deps-info." 2020-05-11 16:51:30 +00:00
Artur Satayev 1111b84822 Introduce app -deps-info.
Similar to APEX-deps-info, app deps info produces two lists with
transitive dependencies.

Bug: 149622332
Test: m NetworkStack-deps-info
Change-Id: Ic6d94df3b7b4be5afe328a0abe768beee1a58362
Exempt-From-Owner-Approval: previous patch approved.
2020-05-11 16:51:06 +00:00
Treehugger Robot a586fecea6 Merge "java_sdk_library: Path extraction from deps depend on tag" 2020-05-11 14:47:21 +00:00
Anton Hansson 3361a294c0 Fix API lint copy command
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
Change-Id: I42b8b60d01dcaed34dbde0390eb1691d656a32cf
2020-05-11 15:40:30 +01:00
Treehugger Robot d2e4822774 Merge "Expand SystemApi annotation for generating system api" 2020-05-11 14:24:36 +00:00
Paul Duffin c878250d3f java_sdk_library: Path extraction from deps depend on tag
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
Change-Id: I4e1861ea67f441f2948a0d7d7053ab0b1169955f
2020-05-10 23:42:02 +01:00
Paul Duffin 6e7ecbf972 Switch java_sdk_library_import to use SetDefaultableHook()
Ensure consistency with java_sdk_library.

Bug: 155295806
Test: m checkapi
Change-Id: I074e7c865b6b52c7bcf568da3342d8772623ce4f
2020-05-10 19:33:36 +01:00
Paul Duffin 9f10bbf4cf Merge "java_sdk_library: Specify visibility of stubs modules" 2020-05-10 18:31:56 +00:00
Paul Duffin 385378bf99 Merge "Retry: Detect invalid arch specific properties in snapshot" 2020-05-09 07:33:35 +00:00
Treehugger Robot 9c3a1291e2 Merge "Add error checking and tests for jni_uses_sdk_apis and jni_uses_platform_apis" 2020-05-09 02:13:42 +00:00
Colin Cross 3c007704c7 Add error checking and tests for jni_uses_sdk_apis and jni_uses_platform_apis
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
2020-05-08 16:55:14 -07:00