Commit Graph

1693 Commits

Author SHA1 Message Date
Automerger Merge Worker
3bb231d4a5 Merge "Decouple addition of new sdk member types from sdk code" am: 0558ecce51 am: d32b891ff3 am: b0a704e865
Change-Id: Id0f8ca132ef2221cce3f4449babfa480e7c9a1fc
2019-12-14 15:22:27 +00:00
Colin Cross
7d114b28e6 Use empty string for core image variant
Use the empty string for the core image variant so that modules
added to imageMutator do not change their build directory.

Bug: 142286466
Test: m checkbuild
Change-Id: Ida4534d9a4d6176236aaa480fed359ce27acfaa1
2019-12-13 13:13:57 -08:00
Paul Duffin
255f18e584 Decouple addition of new sdk member types from sdk code
Previously, adding a new SdkMemberType would require adding a new
sdkMemberListProperty instance to the sdkMemberListProperties as well
as adding a new property into the sdkProperties struct. They are
potential sources of conflict and couple the sdk code with all the
packages that add members to it. This change switched to a
registration model that allows each package to register its sdk
member types decoupling them from the sdk code.

Adds an SdkPropertyName() method to SdkMemberType that specifies the
name of the property to use in the sdk/sdk_snapshot. Also provides
an SdkMemberTypeBase struct to be used by providers of SdkMemberType
implementations.

SdkMemberType instances are registered using the
RegisterSdkMemberType() func which sorts the registered instances
by their SdkPropertyName() to ensure the behavior is consistent and
not affected by order of registration.

When creating a new sdk module a dynamicSdkMemberTypes instance is
created that contains the following:

* A properties struct is created dynamically that contains a field for
  each registered SdkMemberType, corresponding to that type's
  SdkPropertyName().

* A list of sdkMemberListProperty instances is also created, one for
  each registered SdkMemberType.

The dynamicSdkMemberTypes instance is cached using a key that uniquely
identifies the set of registered types just in case new types are
registered after one has been created, e.g. by tests.

Bug: 142918168
Test: m checkbuild
Change-Id: I4bf2bf56a2a49025aa41454048bc1e8ccc6baca2
2019-12-13 20:07:33 +00:00
Automerger Merge Worker
d99607e3a0 Merge "AndroidMk for the hostdex library has separate AndroidMkEntries" am: aafc04ea5c am: 500e305fe2 am: e70c6eadb9
Change-Id: I4bb92f3b85380a4ac6f6a9d5913073352bce0247
2019-12-12 04:08:15 +00:00
Automerger Merge Worker
7000b33b2e Merge "AndroidMkEntries() returns multiple AndroidMkEntries structs" am: 8ce3c2c8df am: aefa4ba9d0 am: c9313f217b
Change-Id: Id9928fa3016190d92d41cfd8ee5f3589600e95c9
2019-12-12 04:08:03 +00:00
Treehugger Robot
aafc04ea5c Merge "AndroidMk for the hostdex library has separate AndroidMkEntries" 2019-12-12 03:24:03 +00:00
Treehugger Robot
8ce3c2c8df Merge "AndroidMkEntries() returns multiple AndroidMkEntries structs" 2019-12-12 03:23:06 +00:00
Automerger Merge Worker
b1b77fe89e Revert "Use boot image extension for framework libraries." am: 3fae7662ee am: 8f9385a37b am: 8060fee08e
Change-Id: I580628260aa789452de96ce72023bd10ea4a03bf
2019-12-11 19:20:56 +00:00
Ulyana Trafimovich
3fae7662ee Revert "Use boot image extension for framework libraries."
This reverts commit 4d2eeed0da.

Reason for revert: breaks avd/avd_boot_health_check test
  on cf_x86_phone-userdebug_coverage on branch rvc-release
  (the device fails to boot).

Test: m
Test: aosp_walleye-userdebug boots

Bug: 145749668

Exempt-From-Owner-Approval: revert

Change-Id: Ie1d93a200222e26461c1bcd384fdb69b7351e259
2019-12-11 18:29:19 +00:00
Jiyong Park
55bd98b2d9 AndroidMk for the hostdex library has separate AndroidMkEntries
Previously, the -hostdex library was emitted using the ExtraFooters.
Now, it has its own AndroidMkEntries, which can be returned together
with the AndroidMkEntries for the main library.

Bug: 128708192
Test: m
Change-Id: Ic9eb0d3839572ed340ccbc5fc6c4b54241e1cb24
2019-12-11 17:27:07 +09:00
Jiyong Park
0b0e1b9804 AndroidMkEntries() returns multiple AndroidMkEntries structs
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.

Bug: 128708192
Test: m

Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
2019-12-11 17:25:27 +09:00
Sundong Ahn
4ddc1d7332 Merge "Add system_ext_specific" am: 4858e41719 am: 87306ea8f5
am: f157e16426

Change-Id: Ibf1cbcd2b7952841f0f67aaae1d970fb8095b1d8
2019-12-09 17:51:46 -08:00
Treehugger Robot
4858e41719 Merge "Add system_ext_specific" 2019-12-10 01:28:45 +00:00
Martin Stjernholm
213d6533cc Merge "Move/dedupe some host path functions in package_ctx.go." am: 455e3a089d am: 47a7da1485
am: 1c0a6ebb26

Change-Id: I72f384073fff467ba53a8dea9422b4296605bb26
2019-12-09 16:14:37 -08:00
Treehugger Robot
455e3a089d Merge "Move/dedupe some host path functions in package_ctx.go." 2019-12-09 23:20:16 +00:00
Martin Stjernholm
7260d066ea Move/dedupe some host path functions in package_ctx.go.
These functions don't need a PackageContext object.

Test: m
Bug: 145934348
Change-Id: Ia1da2c76cbad292f9ca79617199b2b5b6b265568
2019-12-09 22:04:21 +00:00
Paul Duffin
b760b4304b Pass SdkMember to AddPrebuiltModule instead of the name am: 9d8d609fcd am: 210bc6ef3d
am: 8ddf45aa00

Change-Id: I2135138f813ed489f6a6052b2c2c2d110f0a1bf7
2019-12-09 13:23:42 -08:00
Paul Duffin
9d8d609fcd Pass SdkMember to AddPrebuiltModule instead of the name
This is needed for a follow up change that makes sure that the
prebuilt modules have the same visibility as the source modules.

Bug: 143678475
Test: m conscrypt-module-sdk
Change-Id: I9461c8c094ab19ee9ececb5e5fd50565789f2fa2
2019-12-09 13:28:36 +00:00
Paul Duffin
78546cc303 Merge "Cleanup java.DefaultsFactory()" am: 667039f404 am: 89c61eeae9
am: 6aaf6001fd

Change-Id: Id149ef9b7b260f08f57fbce4be0060114f3127cb
2019-12-07 02:10:41 -08:00
Paul Duffin
ae7a02e2d7 Merge "Support header and implementation jars in sdk" am: 8cda6d93de am: d38afab757
am: 3f6417dad2

Change-Id: I1ed9a3a43384a800c30494665e755709da45f622
2019-12-07 02:10:22 -08:00
Treehugger Robot
667039f404 Merge "Cleanup java.DefaultsFactory()" 2019-12-07 08:52:21 +00:00
Treehugger Robot
8cda6d93de Merge "Support header and implementation jars in sdk" 2019-12-07 08:52:09 +00:00
Colin Cross
da0c37bb44 Merge "Move ImageMutator after archMutator" am: e2f3b5dfe5 am: a129b29c76
am: 2e8290cfc7

Change-Id: Id08e19ede38a0eaa1999a44f3e012e19913249f3
2019-12-06 16:50:32 -08:00
Colin Cross
ae6c5207cc Move ImageMutator after archMutator
Move the ImageMutator to be registered just after the archMutator
in preparation for moving it between osMutator and archMutator.
Requries updating variants in a few tests that now run the
ImageMutator.

Bug: 142286466
Test: no change to build.ninja
Test: all soong tests
Change-Id: Ia9d2a7bc0e225bedec3c9a83ea04f471a931bf47
2019-12-06 12:37:14 -08:00
Jeongik Cha
8b65575d87 Merge "Link type checking for java_library" am: f3c24c12ef am: eff8478327
am: b06fdee4b9

Change-Id: I81ceb8411e9252c05e76af23107c7f27d28714e4
2019-12-06 11:21:53 -08:00
Treehugger Robot
f3c24c12ef Merge "Link type checking for java_library" 2019-12-06 18:59:48 +00:00
Ulyana Trafimovich
f21ca1ea2e Merge "Pass correct --image argument to oatdump." am: a4f02412a1 am: 4c1df60960
am: 5ab05089b4

Change-Id: I3ab9610fb42f46d47c708ab6718c7e1643613b90
2019-12-06 09:19:06 -08:00
Ulyana Trafimovich
a4f02412a1 Merge "Pass correct --image argument to oatdump." 2019-12-06 16:55:39 +00:00
Paul Duffin
4735766ef8 Cleanup java.DefaultsFactory()
This function took a props varargs parameter but it was only ever
called with no parameters. The props parameter meant it could not be
used directly with RegisterModuleType() so the defaultsFactory() func
was added which simply called through to DefaultsFactory().

Removing the props varargs parameter allowed it to be used directly
with RegisterModuleType() and so the defaultsFactory() could be
removed.

This was needed because a follow up change adds a test in another
package that uses java_defaults and so it needs the factory method
(defaultsFactory()) to be exported.

Test: m nothing
Change-Id: I33d5c4d4ce8f349b1e6fc706d5e9656faf303b4f
2019-12-06 16:13:58 +00:00
Paul Duffin
a0dbf43a82 Support header and implementation jars in sdk
Add a new java_header_libs property that exports header jars (as
java_libs currently does) and switch java_libs to export implementation
jars instead.

Refactors implementation of the existing library sdk member type so
both properties can be supported from common code as they differ only
on the jar being exported.

Bug: 143678475
Test: m nothing
Change-Id: I04642122f72d083bbdfd3290624f957b71ee8875
2019-12-06 16:13:58 +00:00
Paul Duffin
6e2ab7db45 Merge changes Ia7dbcd41,I93140450,I4d3fe18f,Ib00870dd,I10203594 am: 3a7caaa80c am: f44ca6b363
am: 4fe2c14a9b

Change-Id: Ib4d1eef9e11c7c10f4912fc446b538ddd229c6dd
2019-12-06 08:03:25 -08:00
Jeongik Cha
e403e9e8dc Link type checking for java_library
Link type checking for java_library has not been working unintentionally.
So turn on link type checking for these types.

And also add tests for link type checking.

Bug: 145799020
Test: cherry-pick aosp/1182522 and check if build fails
Test: m nothing and there is no error(soong unittest)

Change-Id: Ifc347f657885de1028ac0076ddd103c0387b597a
2019-12-07 00:45:02 +09:00
Ulya Trafimovich
163664a548 Pass correct --image argument to oatdump.
This was broken after CL:
  Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826
..which split boot image into primary and extension.
The argument to oatdump was not updated properly.

The old form before the split was:

  --image=out/soong/generic_x86/dex_bootjars/system/framework/boot.art

The new form after the split is:

  --image=out/soong/generic_x86/dex_artjars/apex/com.android.art/javalib/boot.art:out/soong/generic_x86/dex_bootjars/system/framework/boot-framework.art

Test: lunch aosp_x86-userdebug && m dump-oat

Test: Manually inspect build command to make sure correct image
  location is used:

  $ fgrep -e 'oatdump' $ANDROID_BUILD_TOP/out/soong/build.ninja | egrep -e '--image[^ ]*' -o
  --image=out/soong/generic_x86/dex_artjars/apex/com.android.art/javalib/boot.art:out/soong/generic_x86/dex_bootjars/system/framework/boot-framework.art

Change-Id: I54a5146c404aefb6eaeadbe3e9363db935ecad86
2019-12-06 13:42:21 +00:00
Paul Duffin
1387957727 Parameterize the sdk member processing
Extracts the type specific functionality into the SdkMemberType
interface which has to be implemented by each module type that can
be added as a member of the sdk. It provides functionality to add
the required dependencies for the module type, check to see if a
resolved module is the correct instance and build the snapshot.

The latter was previously part of SdkAware but was moved because
it has to be able to process multiple SdkAware variants so delegating
it to a single instance did not make sense.

The custom code for handling each member type specific property,
e.g. java_libs, has been replaced with common code that processes
a list of sdkMemberListProperty struct which associates the
property (name and getter) with the SdkMemberType and a special
DependencyTag which is passed to the SdkMemberType when it has to add
dependencies.

The DependencyTag contains a reference to the appropriate
sdkMemberListProperty which allows the resolved dependencies to be
grouped by type.

Previously, the dependency collection methods would ignore a module if
it was an unsupported type because they did not have a way of
determining which property it was initially listed in. That meant it
was possible to add say a droidstubs module to the java_libs property
(and because they had the same variants) it would work as if it was
added to the stubs_sources property. Or alternatively, a module of an
unsupported type could be added to any property and it would just be
ignored.

However, the DependencyTag provides information about which property
a resolved module was referenced in and so it can detect when the
resolved module is of the wrong type and report an error. That check
identified a bug in one of the tests where the sdk referenced a
java_import module (which is not allowed in an sdk) instead of a
java_library module (which is allowed). That test was fixed as part
of this.

A list of sdkMemberListProperty structs defines the member properties
supported by the sdk and are processed in order to ensure consistent
behaviour.

The resolved dependencies are grouped by type and each group is then
processed in defined order. Within each type dependencies are grouped
by name and encapsulated behind an SdkMember interface which includes
the name and the list of variants.

The Droidstubs and java.Library types can only support one variant and
will fail if given more.

The processing for the native_shared_libs property has been moved into
the cc/library.go file so the sdk package code should now have no type
specific information in it apart from what is if the list of
sdkMemberListProperty structs.

Bug: 143678475
Test: m conscrypt-module-sdk
Change-Id: I10203594d33dbf53441f655aff124f9ab3538d87
2019-12-06 12:16:59 +00:00
Calin Juravle
378a952999 Merge "Export art dexpreopt image zip file" am: af7c2fcb71 am: 6db8f6c37f
am: 286be89d7d

Change-Id: I12c4077359a8f4669f4ee9189057ae7cb6a0d5dc
2019-12-06 00:47:48 -08:00
Søren Gjesse
527e854941 Merge "Remove passing -forceprocessing flag to R8" am: 5f9e5244c5 am: e40d85575d
am: 7dbc0aac3a

Change-Id: I3ff0e7be92c49debaf04356210d99a0d3e8caaa6
2019-12-06 00:13:18 -08:00
Calin Juravle
af7c2fcb71 Merge "Export art dexpreopt image zip file" 2019-12-05 22:11:28 +00:00
Treehugger Robot
5f9e5244c5 Merge "Remove passing -forceprocessing flag to R8" 2019-12-05 08:56:38 +00:00
Colin Cross
31bf00dac3 Export art dexpreopt image zip file
Test: m  out/target/product/generic_arm64/boot.zip
Bug: 144491400
Change-Id: I84342703ac614e072b0cde8c6f5597dc8cffbc65
2019-12-04 16:50:52 -08:00
Sundong Ahn
0d7dff48f5 Add system_ext_specific
The system_ext partition was created. So if java_sdk_library module is
installed to system_ext partition, .xml and .jar install path must be
changed to system_ext.

Bug: 143440787
Test: add system_ext_specific to java_sdk_module && make -j && check
system_ext parition

Change-Id: Ie0d0df426d4aa96ac89eb4215e7376eea3f03f54
2019-12-04 04:00:21 +00:00
Automerger Merge Worker
30e7a254e8 Use boot image extension for framework libraries. am: 4d2eeed0da am: c641b9e722
Change-Id: I7ec291d2e995604ed5201887a0662e2b65b862fe
2019-12-03 17:41:18 +00:00
Automerger Merge Worker
28fcd629a8 Merge "Add model to represent generated snapshot .bp file" am: e63106a08c am: 1a9aff7d2b
Change-Id: If5142956902efb5a5b2b0c56b8500ec7ceb48f0e
2019-12-03 17:39:12 +00:00
Automerger Merge Worker
eed72ed1b0 Merge "Link type will be check in android_library also" am: f6739a65dd am: 96fef669ae
Change-Id: I2283b138854dee4a7e3ce57f9aad1d6ac146dfba
2019-12-03 17:36:46 +00:00
Ulya Trafimovich
4d2eeed0da Use boot image extension for framework libraries.
This patch splits the system boot image in two parts:

  - The ART boot image. This is the primary boot image that is
    included in the ART apex and contains dexpreopted Core Libraries.

  - The framweork boot image extension. It depends on the ART boot
    image and contains framework libraries.

The third "apex" boot image (used in the JIT-zygote experiment)
remains unchanged; it is a monolithic primary boot image that
contains both libcore and framework libraries.

Dexpreopting of APKs now uses the framework boot image extension
(which in turn pulls in the ART boot image as a dependency).

Test: m
Test: phone boots:
    lunch aosp_walleye-userdebug && m \
        && adb reboot bootloader && fastboot flashall -w

Bug: b/119800099

Exempt-From-Owner-Approval: rebased after getting approval.

Change-Id: Ida40dfae8c83bf7c2e737d5c7ea418e1197ad826
2019-12-03 13:59:25 +00:00
Paul Duffin
e63106a08c Merge "Add model to represent generated snapshot .bp file" 2019-12-03 10:07:10 +00:00
Treehugger Robot
f6739a65dd Merge "Link type will be check in android_library also" 2019-12-03 03:41:21 +00:00
Automerger Merge Worker
2a5a90c52d Merge "soong: Align update boot jar variable with system_server jar" am: d6fb4842c9 am: d5cb37ea01
Change-Id: I98325b725d7cd3f244e053a137d2cb7ccd780cce
2019-12-03 00:59:20 +00:00
Roshan Pius
ccc26ef316 soong: Align update boot jar variable with system_server jar
Use apex:jar pair values for updatable boot jars to align with
updatable system_server values.

Test: Compiles & flashed device. Ensured that the bootclasspath & system_server class
paths remain the same.

Change-Id: I1d6dfe3325d9091b7c724458be4e6471f9086666
2019-12-02 08:37:57 -08:00
Paul Duffin
b645ec8e34 Add model to represent generated snapshot .bp file
Having each module type generate the contents of the snapshot's .bp
file results in lots of duplicated code. This adds an intermediate
model for use by the module types and then generates the .bp file
contents from that.

This not only removes the duplicated formatting code but it also
allows consistent handling of shared properties such as name further
reducing duplication. It also makes it possible to duplicate the
versioned and unversioned prebuilt modules from the same model.

Extracts generatedContents from generatedFile to allow the contents
to be populated without creating an output file, for testing.

Cleans up unused code.

Bug: 143678475
Test: m nothing
Change-Id: If21b84db0ef3fdfb5dc11ea0973ce6cb73603ea3
2019-12-02 12:59:38 +00:00
Paul Duffin
361b90c9f1 Merge "Dedup code for generating prebuilt_stubs_sources in snapshot" am: bf857716a1 am: 8afdd32b7f
am: 622f056b2c

Change-Id: Ic0069fce2da69b8e160113041d14a163b8e4ba28
2019-11-27 08:31:39 -08:00