Commit Graph

1676 Commits

Author SHA1 Message Date
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
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
Treehugger Robot
bf857716a1 Merge "Dedup code for generating prebuilt_stubs_sources in snapshot" 2019-11-27 16:21:41 +00:00
Ulyana Trafimovich
f94be47d8a Merge "Revert^2 "Do not dexpreopt system server jars from updatable modules."" am: 565b52610f am: ee40866813
am: 2a4240aead

Change-Id: I67eb9b18db6f736ae280741b896b7cd2c9944194
2019-11-27 06:14:45 -08:00
Ulyana Trafimovich
565b52610f Merge "Revert^2 "Do not dexpreopt system server jars from updatable modules."" 2019-11-27 12:45:34 +00:00
Ulyana Trafimovich
f2cb7e959b Revert^2 "Do not dexpreopt system server jars from updatable modules."
This reverts commit 01f6b0a656.

Reason for revert: Build failure is not reproducible.
Forrest build on the same build ID 6033773 and same target
cf_x86_phone-userdebug_coverage finished successfully.

Change-Id: I5077f8332aa0b8037e324b89d41f35b86b8cf216
2019-11-27 12:29:50 +00:00
Søren Gjesse
8e505e3f01 Remove passing -forceprocessing flag to R8
R8 ignores the flag

Test: m -j
Change-Id: Ie394dfc24bb5632717d23e9ab4ad03b6cc1feb19
2019-11-27 12:40:07 +01:00
Kyeongkab.Nam
da55b2f3ba Merge "Fix incorrect install path for priv-app prebuilt" am: a75606be1e am: d9bfc18600
am: ae52626186

Change-Id: Id51b81af6454911eaf84b2d2947b3eeada8b7a0d
2019-11-27 02:21:03 -08:00
Treehugger Robot
a75606be1e Merge "Fix incorrect install path for priv-app prebuilt" 2019-11-27 09:20:15 +00:00
Artur Satayev
dd3f6477df Merge "Add exported_plugins to java.Library." am: 4a692427f7 am: bedffa880d
am: 1c2809d197

Change-Id: I64626eaf10e01fc5e1938b0b96c7df8ce12e70ae
2019-11-26 17:05:46 -08:00
Treehugger Robot
4a692427f7 Merge "Add exported_plugins to java.Library." 2019-11-27 00:52:46 +00:00
Paul Duffin
b1a8813520 Dedup code for generating prebuilt_stubs_sources in snapshot
Removes duplicated code for generating a versioned and non-versioned
form of the prebuilt_stubs_sources module in the snapshot.

Bug: 143678475
Test: m nothing

Change-Id: Ic431b6fcb6f3c7c85f1a04cb6f087424aaf0cffa
2019-11-26 22:30:27 +00:00
Artur Satayev
9cf4669bc4 Add exported_plugins to java.Library.
The behaviour is similar to go/be#java_library.exported_plugins. Plugins added to exported_plugins of library X are not applied to the library itself, but rather to libraries that directly depend on the library X.

Test: m checkbuild
Bug: 139740873
Change-Id: I4042bd482ad9cb12d6fbaac51f039d38b1b7a428
2019-11-26 19:05:26 +00:00
Paul Duffin
8de63efacb Dedup code for generating java_import in snapshot am: 50e7900744 am: 82b6fe6f2c
am: bf88789520

Change-Id: Iddbe068271e82603584cbca4ed19bb95f6bd9d90
2019-11-26 09:47:45 -08:00
Paul Duffin
50e7900744 Dedup code for generating java_import in snapshot
Removes duplicated code for generating a versioned and non-versioned
form of the java_import module in the snapshot.

Bug: 143678475
Test: m nothing and check output for dummy sdk
Change-Id: Ia8d05c3bf9ef79953a817b168dd9d59f2af2d2ce
2019-11-26 16:19:36 +00:00
Ulyana Trafimovich
fef2ec8e07 Merge "Revert "Do not dexpreopt system server jars from updatable modules."" am: 9d8dab57a5 am: a5bad9e22e
am: 1cddc7dabc

Change-Id: I3f04c3d57d4b1cab16c433979ea3aa6a04b49f21
2019-11-26 05:24:38 -08:00
Ulyana Trafimovich
9d8dab57a5 Merge "Revert "Do not dexpreopt system server jars from updatable modules."" 2019-11-26 13:07:48 +00:00
Ulyana Trafimovich
01f6b0a656 Revert "Do not dexpreopt system server jars from updatable modules."
This reverts commit 61c325ebcc.

Reason for revert: broken build git_master/cf_x86_phone-userdebug_coverage (likely caused by these changes).

Exempt-From-Owner-Approval: revert.

Change-Id: I88ddd3af3a6c4ffdaa1fbb881d965356c5c75ad3
2019-11-26 13:06:38 +00:00
Ulyana Trafimovich
4080f0420c Merge "Do not dexpreopt system server jars from updatable modules." am: 40227e55be am: fd88a29801
am: dd59ef32b3

Change-Id: I65a2b942786bddca6cdf339dcb86e38a8c738b19
2019-11-26 02:31:30 -08:00