summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2020-05-06Introduce min_sdk_version to deps info.Artur Satayev
Bug: 149622332 Test: m Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc Merged-In: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc Exempt-From-Owner-Approval: cp from aosp (cherry picked from commit 480e25b74f9e7101ff3083bd4517f15ac0a6a1b9)
2020-05-05Merge changes Ie6568cb8,Ibd521c96 am: 292e7c0721 am: a07f9df5d7satayev
Change-Id: I4dcd1f47b080a71a97db0b10c1ebfc45b8d59bdb
2020-05-04Introduce min_sdk_version to deps info.Artur Satayev
Bug: 149622332 Test: m Change-Id: Ie6568cb8a82d5cca9a3dc91b5a068abf4b0632dc
2020-05-04Ensure APEX's Java deps use stable SDKs.Artur Satayev
Test: m Bug: 153333044 Change-Id: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db Merged-In: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db Exempt-From-Owner-Approval: cp from aosp (cherry picked from commit 8cf899afcc69643f63350bc9f9f92677bb8feabd)
2020-05-04Merge "Ensure APEX's Java deps use stable SDKs." am: 9d6ea77c52 am: 858239ce20satayev
Change-Id: Icf58cab4392926b11836447d24161ef224e3ac09
2020-05-04Merge "Ensure APEX's Java deps use stable SDKs."satayev
2020-05-01Revert "[soong] new field in Android.bp to request APK signing V4"Songchun Fan
This reverts commit 17d69e3484d2e74f28721e86a6554c3d0d740a51. Reason for revert: This new field is not useful without dependencies in aosp Test: builds Change-Id: I87bd820cd6dbc5274ce3d28c4578381718aa805d Merged-In: I70d6f7dc751510311b03e245b2189a76b395a49c
2020-04-28Add defaults support to runtime_resource_overlay.Jaewoong Jung
(This is a cherry-pick change.) Bug: 154956723 Test: app_test.go Change-Id: Ida29035ef45ec188c95a07a8bccaaa77eea486d7 Merged-In: Ida29035ef45ec188c95a07a8bccaaa77eea486d7
2020-04-27Merge "Add defaults support to runtime_resource_overlay." into rvc-dev am: ↵Jaewoong Jung
e3643da744 Change-Id: I6ccea172878755e4ce2edcb8e1d26edaf6d71190
2020-04-27Ensure APEX's Java deps use stable SDKs.Artur Satayev
Test: m Bug: 153333044 Change-Id: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
2020-04-26Add defaults support to runtime_resource_overlay.Jaewoong Jung
Bug: 154956723 Test: app_test.go Change-Id: Ida29035ef45ec188c95a07a8bccaaa77eea486d7
2020-04-24Repeat kapt processor argument for multiple processorsColin Cross
kapt claims to support a comma separated list of annotation processors, but it errors if multiple annotation processors are given. Surrounding the the list with {} does not error, but it also doesn't even warn if the second element in the list is garbage, so it may not be running the second processor. Repeat the processor argument for each annotation processor class instead. Bug: 154736649 Test: TestKapt Test: m checkbuild Change-Id: I4c7c161dbf867d7fba1aaf16fd5e502647e3f682 Merged-In: I4c7c161dbf867d7fba1aaf16fd5e502647e3f682 (cherry picked from commit 5a11686e64d7c6665589458a94f183d0823dc833)
2020-04-24Merge "Repeat kapt processor argument for multiple processors"Treehugger Robot
2020-04-22Repeat kapt processor argument for multiple processorsColin Cross
kapt claims to support a comma separated list of annotation processors, but it errors if multiple annotation processors are given. Surrounding the the list with {} does not error, but it also doesn't even warn if the second element in the list is garbage, so it may not be running the second processor. Repeat the processor argument for each annotation processor class instead. Bug: 154736649 Test: TestKapt Test: m checkbuild Change-Id: I4c7c161dbf867d7fba1aaf16fd5e502647e3f682
2020-04-22Stop requiring apex_available on java_library members of sdksPaul Duffin
Previously, adding java_library to an sdk required that the names of any APEXes that transitively compiled against it were added to its apex_available property. This change removes that requirement. Also corrects the dependency path in the TestApexAvailable_IndirectDep error which previously passed through "shared from static" static dependency tags even though those are explicitly NOT followed when checking apex_available settings. Bug: 152878661 Bug: 153306490 Test: m droid Merged-In: I995ed38956c1bc210b09494812de012fed9f9232 Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
2020-04-22Improve consistency of handling java snapshot propertiesPaul Duffin
Previously, java snapshot properties (java_library and java_test) relied on the properties not being optimized when there was a single os type and instead being added directly to the common os type properties. However, that means that the behavior is inconsistent for other member types depending on whether there was one os type or not. This change updates the java sdk member handling to support optimization. This involved: 1) Adding AidlIncludeDirs field to librarySdkMemberProperties to specify the aidl include dirs instead of extracting that from the library field. 2) Renaming jarToExport to JarToExport (in both library/testSdkMemberProperties)to allow it to be optimized. 3) Adding MemberType() and Name() methods to SdkMemberPropertiesContext to avoid having to store the former in the properties struct and retrieve the latter from the library/test fields. 4) Removing the now unused library/test fields from the properties structures. 5) Separating the processing of the jar/test config in AddToPropertySet(...) as they may be optimized separately. 6) Ditto for the jar/aidl include dirs. 7) While doing this work I noticed that although the contents of the aidl include dirs are copied into the snapshot the java_import does not make use of them. Raised bug 151933053 and added TODO to track that work. Bug: 142935992 Bug: 153306490 Test: m nothing Merged-In: Iba9799e111ca5672b2133568163d8c49837ba9cd Change-Id: Iba9799e111ca5672b2133568163d8c49837ba9cd
2020-04-22Make new module creation API more flexiblePaul Duffin
Previously passing additional information to the implementations of AddPrebuiltModule() or the SdkMemberProperties interface would have required making changes to the API. This change added an SdkMemberContext object into which additional information can easily be added without requiring changes to existing implementations. The BuildSnapshot() method was not modified because it is deprecated and will be removed in a follow up change. It also switches the API from passing variants as android.SdkAware to android.Module. That is for a couple of reasons: 1) SdkAware is designed for managing the relationship between the module and the SDK, not for generating the output snapshot. As such there is nothing in SdkAware that is needed for generating the output snapshot. 2) Accepting android.Module instead makes it easier to use the underlying code for generating the snapshot module as well as the individual member modules. This is in preparation for a number of improvements and bug fixes in both the snapshot creation code and implementations to address found while trying to built the platform against ART prebuilts. Bug: 151937654 Bug: 153306490 Test: m nothing Merged-In: Iac10f1200c0f283aa35402167eec8f9aeb65a38e Change-Id: Iac10f1200c0f283aa35402167eec8f9aeb65a38e
2020-04-22Add support for multiple os typesPaul Duffin
Updates the member snapshot creation code to support multiple os types. It basically sorts the variants by os type, then applies the code to optimize the arch properties and then it optimizes the properties that are common across architectures and extracts any properties that are common across os types. The java and cc member types needed to be modified to make the location of the generated files within the snapshot os type dependent when there is more than one os type. That was done by adding an OsPrefix() method to the SdkMemberPropertiesBase which returns the os prefix to use when there is > 1 os type and otherwise returns an empty string. Added three tests, one for cc shared libraries, one for cc binary and one for java header libraries. Bug: 150451422 Bug: 153306490 Test: m nothing Merged-In: I08f5fbdd7852b06c9a9a2f1cfdc364338a3d5bac Change-Id: I08f5fbdd7852b06c9a9a2f1cfdc364338a3d5bac
2020-04-22Refactor java_library/java_test snapshot processingPaul Duffin
Adds support for handling the common arch to the sdk module type snapshot generation code and then refactors the java_library and java_test snapshot processing to take advantage of that. Bug: 150451422 Bug: 153306490 Test: m nothing Merged-In: If746f375f1c4288ab6b67c7d216593b70258b043 Change-Id: If746f375f1c4288ab6b67c7d216593b70258b043
2020-04-22Simplify java library sdk member codePaul Duffin
Adds the accessor function for retrieving the impl/header jars to the librarySdkMemberType structure instead of passing it into its buildSnapshot() method. That enabled: * The removal of the [header/impl]LibrarySdkMemberType structs. * The removal of their implementations of BuildSnapshot. * Replacing buildSnapshot() with BuildSnapshot() This will make subsequent refactoring of the SdkMemberType interface a little simpler. Bug: 153306490 Test: m nothing Bug: 150451422 Merged-In: I1f96986bb497cf9d9df9916e40065f66b35a4704 Change-Id: I1f96986bb497cf9d9df9916e40065f66b35a4704
2020-04-16Check updatable APKs compile against managed SDKs.Artur Satayev
As a follow up, this property will be set to APKs participating in mainline program. Bug: 153333044 Test: m Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43 Merged-In: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43 (cherry picked from commit 2db1c3f1c432740f734917e04b2b847066c8d508) Exempt-From-Owner-Approval: clean cherry-pick
2020-04-15Check updatable APKs compile against managed SDKs.Artur Satayev
As a follow up, this property will be set to APKs participating in mainline program. Bug: 153333044 Test: m Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
2020-04-08Stop requiring apex_available on java_library members of sdksPaul Duffin
Previously, adding java_library to an sdk required that the names of any APEXes that transitively compiled against it were added to its apex_available property. This change removes that requirement. Also corrects the dependency path in the TestApexAvailable_IndirectDep error which previously passed through "shared from static" static dependency tags even though those are explicitly NOT followed when checking apex_available settings. Bug: 152878661 Test: m droid Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
2020-04-05Merge "[soong] new field in Android.bp to request APK signing V4"Treehugger Robot
2020-04-04[soong] new field in Android.bp to request APK signing V4Songchun Fan
If "v4_signature: true" is set, the v4 signature file, named [outputApkFile].idsig will be generated along side the outputApkFile. Test: m nothing Test: atest PackageManagerShellCommandIncrementalTest BUG: 149354175 Change-Id: Ie84725a15406f96f65042ea9909460e4eb34d57f Merged-In: Ie84725a15406f96f65042ea9909460e4eb34d57f
2020-03-31Add a Tag field to dist to dist a tagged outputAnton Hansson
Make java_library support this mode of output, to allow callers to dist the classes.jar file rather than the dexed jar file. Bug: 152618077 Test: followup CL Change-Id: I5ba6949833a0fbb95376142aec5096ff5f084c00 Merged-In: I5ba6949833a0fbb95376142aec5096ff5f084c00 (cherry picked from commit 1e65f94a4b2cc7dea1896937c2068b87c899c465)
2020-03-30Merge "Add a Tag field to dist to dist a tagged output" into rvc-devAnton Hansson
2020-03-30Add a Tag field to dist to dist a tagged outputAnton Hansson
Make java_library support this mode of output, to allow callers to dist the classes.jar file rather than the dexed jar file. Bug: 152618077 Test: followup CL Change-Id: I5ba6949833a0fbb95376142aec5096ff5f084c00
2020-03-27Add code coverage support to android_app JNI libs.Jaewoong Jung
This is a cherry-pick change. Test: Built mainline module coverage data Bug: 152117890 Change-Id: I47bf3e5d6e78c4518729bdb52616e248156d3cec Merged-In: I47bf3e5d6e78c4518729bdb52616e248156d3cec
2020-03-27Add code coverage support to android_app JNI libs.Jaewoong Jung
Test: Built mainline module coverage data Bug: 152117890 Change-Id: I47bf3e5d6e78c4518729bdb52616e248156d3cec
2020-03-25[soong] new field in Android.bp to request APK signing V4Songchun Fan
If "v4_signature: true" is set, the v4 signature file, named [outputApkFile].idsig will be generated along side the outputApkFile. Test: m nothing Test: atest PackageManagerShellCommandIncrementalTest BUG: 149354175 Change-Id: Ie84725a15406f96f65042ea9909460e4eb34d57f
2020-03-25Merge "Make system_server stubs consistent with other stubs"Anton Hansson
2020-03-25Make system_server stubs consistent with other stubsAnton Hansson
Include the module_api stubs in system_server one instead of putting both of these jars on the classpath. Also rename it to be in line with the other stubs. Bug: 149293194 Test: m Exempt-From-Owner-Approval: approved internally Change-Id: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e Merged-In: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e (cherry picked from commit bbd78556daf4a7e015f2e3ddfe9539909e9ebf40)
2020-03-24add aidl.export_include_dirs to java_import module typeJiyong Park
This allows a java prebuilt to export AIDL files to its clients. Bug: 151933053 Test: m Change-Id: I21b5d5ce647141a7c76f62490adbccb858b10323
2020-03-23Merge "Simplify the construction of class loader contexts for system server ↵Ulyana Trafimovich
jars."
2020-03-23Simplify the construction of class loader contexts for system server jars.Ulya Trafimovich
This reworks CL https://r.android.com/1180134 as follows: 1) Do not reorder the list of system server jars passed from Make to Soong via the product variable PRODUCT_SYSTEM_SERVER_JARS. This means that for some products the order of jars on the system server classpath may be non-optimal: a jar X that depends on Y may be dexpreopted before Y, so that all references to the classes and methods from Y wil be unresolved. Unfortunately for such products, fixing the order is not a simple matter of rearranging their PRODUCT_SYSTEM_SERVER_JARS, because the conflicts may arise when the product-specific variable gets merged with the common variable. 2) As a consequence of 1), do not add artificial dependencies between system server jars: this is now impossible, as it would create circular dependencies for those products that have non-optimal order of jars. 3) Copy dex files for system server jars to a predefined build location. This is necessary because at the time when Soong generates class loader context for k-th jar, it needs to know the paths to jars 1 .. (k-1), and it might have not processed those jars yet (so Soong can't query the paths from the modules). This approach is similar to the way Soong handles bootclasspath jars. 4) Do not exclude from dexpreopting system server jars that are not Soong modules (those that are Make modules). The previous CL excluded them because Make modules do not have ModuleContext. But it turns out that ModuleContext is not necessary, as all the information is passed via the dexpreopt config. Test: aosp_walleye-userdebug boots and there are no messages in the logcat regarding class loader context mismatch: $ adb logcat | grep 'mismatch' # empty Test: Class loader contexts in the oat files for system server jars match expectations: $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/com.android.location.provider.odex 2>/dev/null | grep '^classpath' classpath = PCL[] $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/services.odex 2>/dev/null | grep '^classpath' classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671] $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/ethernet-service.odex 2>/dev/null | grep '^classpath' classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671:/system/framework/services.jar*4040443083:/system/framework/services.jar!classes2.dex*2210087472] Test: The phone boots and logcat has no scary messages related to class loader contexts: $ lunch aosp_walleye-userdebug && m $ adb reboot bootloader && fastboot flashall -w && adb wait-for-device $ adb root $ adb shell stop $ adb logcat -c $ adb shell setprop dalvik.vm.extra-opts -verbose:oat $ adb shell start $ adb logcat | egrep -io 'system_server: .*load.*/system/framework.*' system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/services.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/services.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 Bug: 141785760 Bug: 140451054 Bug: 148944771 Bug: 147017252 Change-Id: I33c4087f8bfacd0ecb89877aa150b75360d06710 Merged-In: I33c4087f8bfacd0ecb89877aa150b75360d06710 (cherry picked from commit a4a83b0ef9b9769681ad285290fdbbf043eff3d5) Exempt-From-Owner-Approval: cherry-pick.
2020-03-23Merge "Simplify the construction of class loader contexts for system server ↵Ulyana Trafimovich
jars." into rvc-dev
2020-03-23Improve consistency of handling java snapshot propertiesPaul Duffin
Previously, java snapshot properties (java_library and java_test) relied on the properties not being optimized when there was a single os type and instead being added directly to the common os type properties. However, that means that the behavior is inconsistent for other member types depending on whether there was one os type or not. This change updates the java sdk member handling to support optimization. This involved: 1) Adding AidlIncludeDirs field to librarySdkMemberProperties to specify the aidl include dirs instead of extracting that from the library field. 2) Renaming jarToExport to JarToExport (in both library/testSdkMemberProperties)to allow it to be optimized. 3) Adding MemberType() and Name() methods to SdkMemberPropertiesContext to avoid having to store the former in the properties struct and retrieve the latter from the library/test fields. 4) Removing the now unused library/test fields from the properties structures. 5) Separating the processing of the jar/test config in AddToPropertySet(...) as they may be optimized separately. 6) Ditto for the jar/aidl include dirs. 7) While doing this work I noticed that although the contents of the aidl include dirs are copied into the snapshot the java_import does not make use of them. Raised bug 151933053 and added TODO to track that work. Bug: 142935992 Test: m nothing Change-Id: Iba9799e111ca5672b2133568163d8c49837ba9cd
2020-03-23Make new module creation API more flexiblePaul Duffin
Previously passing additional information to the implementations of AddPrebuiltModule() or the SdkMemberProperties interface would have required making changes to the API. This change added an SdkMemberContext object into which additional information can easily be added without requiring changes to existing implementations. The BuildSnapshot() method was not modified because it is deprecated and will be removed in a follow up change. It also switches the API from passing variants as android.SdkAware to android.Module. That is for a couple of reasons: 1) SdkAware is designed for managing the relationship between the module and the SDK, not for generating the output snapshot. As such there is nothing in SdkAware that is needed for generating the output snapshot. 2) Accepting android.Module instead makes it easier to use the underlying code for generating the snapshot module as well as the individual member modules. This is in preparation for a number of improvements and bug fixes in both the snapshot creation code and implementations to address found while trying to built the platform against ART prebuilts. Bug: 151937654 Test: m nothing Change-Id: Iac10f1200c0f283aa35402167eec8f9aeb65a38e
2020-03-20Simplify the construction of class loader contexts for system server jars.Ulya Trafimovich
This reworks CL https://r.android.com/1180134 as follows: 1) Do not reorder the list of system server jars passed from Make to Soong via the product variable PRODUCT_SYSTEM_SERVER_JARS. This means that for some products the order of jars on the system server classpath may be non-optimal: a jar X that depends on Y may be dexpreopted before Y, so that all references to the classes and methods from Y wil be unresolved. Unfortunately for such products, fixing the order is not a simple matter of rearranging their PRODUCT_SYSTEM_SERVER_JARS, because the conflicts may arise when the product-specific variable gets merged with the common variable. 2) As a consequence of 1), do not add artificial dependencies between system server jars: this is now impossible, as it would create circular dependencies for those products that have non-optimal order of jars. 3) Copy dex files for system server jars to a predefined build location. This is necessary because at the time when Soong generates class loader context for k-th jar, it needs to know the paths to jars 1 .. (k-1), and it might have not processed those jars yet (so Soong can't query the paths from the modules). This approach is similar to the way Soong handles bootclasspath jars. 4) Do not exclude from dexpreopting system server jars that are not Soong modules (those that are Make modules). The previous CL excluded them because Make modules do not have ModuleContext. But it turns out that ModuleContext is not necessary, as all the information is passed via the dexpreopt config. Test: aosp_walleye-userdebug boots and there are no messages in the logcat regarding class loader context mismatch: $ adb logcat | grep 'mismatch' # empty Test: Class loader contexts in the oat files for system server jars match expectations: $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/com.android.location.provider.odex 2>/dev/null | grep '^classpath' classpath = PCL[] $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/services.odex 2>/dev/null | grep '^classpath' classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671] $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/ethernet-service.odex 2>/dev/null | grep '^classpath' classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671:/system/framework/services.jar*4040443083:/system/framework/services.jar!classes2.dex*2210087472] Test: The phone boots and logcat has no scary messages related to class loader contexts: $ lunch aosp_walleye-userdebug && m $ adb reboot bootloader && fastboot flashall -w && adb wait-for-device $ adb root $ adb shell stop $ adb logcat -c $ adb shell setprop dalvik.vm.extra-opts -verbose:oat $ adb shell start $ adb logcat | egrep -io 'system_server: .*load.*/system/framework.*' system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/services.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 0 system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 0 system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/services.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 1 system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1 Bug: 141785760 Bug: 140451054 Bug: 148944771 Bug: 147017252 Change-Id: I33c4087f8bfacd0ecb89877aa150b75360d06710
2020-03-19Make system_server stubs consistent with other stubsAnton Hansson
Include the module_api stubs in system_server one instead of putting both of these jars on the classpath. Also rename it to be in line with the other stubs. Bug: 149293194 Test: m Change-Id: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e
2020-03-11Fix apex_availableJooyung Han
Checking apex_available was missing some corner cases. For example, the deps of share deps of cc_library modules are missed while those from cc_library_shared are correctly tracked. This was due to.. * calling DepIsInSameApex in WalkDeps: both work fine separately, but when they are used together, it fails to work. It's due to how WalkDeps works. (We might fix this bug too risky since it is used very widely) * incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver is supposed to be parent, but child was used before. Interestingly lots of deps are within the same group of module types(cc to cc, java to java), it has worked. (note that receiver's DepIsInSameApex implementation can be different). This change fixes them by.. * walkPayloadDeps is now relying on ApexVariation, which is calculated correctly by TopDown apex_deps mutator. * use correct receiver for DepIsInSameApex in apex_deps mutator, which requires for java.SdkLibrary to override the method and for java.Library/Import to use passed dep instead of receiver to check its membership of sdk. Exempt-From-Owner-Approval: cherry-pick from aosp/master Bug: 151071238 Test: build/boot Merged-In: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456 (cherry picked from commit 5e9013be2202effb500a0aa14d95f5fef70cc75e) Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-10Fix apex_availableJooyung Han
Checking apex_available was missing some corner cases. For example, the deps of share deps of cc_library modules are missed while those from cc_library_shared are correctly tracked. This was due to.. * calling DepIsInSameApex in WalkDeps: both work fine separately, but when they are used together, it fails to work. It's due to how WalkDeps works. (We might fix this bug too risky since it is used very widely) * incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver is supposed to be parent, but child was used before. Interestingly lots of deps are within the same group of module types(cc to cc, java to java), it has worked. (note that receiver's DepIsInSameApex implementation can be different). This change fixes them by.. * walkPayloadDeps is now relying on ApexVariation, which is calculated correctly by TopDown apex_deps mutator. * use correct receiver for DepIsInSameApex in apex_deps mutator, which requires for java.SdkLibrary to override the method and for java.Library/Import to use passed dep instead of receiver to check its membership of sdk. Bug: 151071238 Test: build/boot Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-09Add support for multiple os typesPaul Duffin
Updates the member snapshot creation code to support multiple os types. It basically sorts the variants by os type, then applies the code to optimize the arch properties and then it optimizes the properties that are common across architectures and extracts any properties that are common across os types. The java and cc member types needed to be modified to make the location of the generated files within the snapshot os type dependent when there is more than one os type. That was done by adding an OsPrefix() method to the SdkMemberPropertiesBase which returns the os prefix to use when there is > 1 os type and otherwise returns an empty string. Added three tests, one for cc shared libraries, one for cc binary and one for java header libraries. Bug: 150451422 Test: m nothing Change-Id: I08f5fbdd7852b06c9a9a2f1cfdc364338a3d5bac
2020-03-05Refactor java_library/java_test snapshot processingPaul Duffin
Adds support for handling the common arch to the sdk module type snapshot generation code and then refactors the java_library and java_test snapshot processing to take advantage of that. Bug: 150451422 Test: m nothing Change-Id: If746f375f1c4288ab6b67c7d216593b70258b043
2020-03-02Simplify java library sdk member codePaul Duffin
Adds the accessor function for retrieving the impl/header jars to the librarySdkMemberType structure instead of passing it into its buildSnapshot() method. That enabled: * The removal of the [header/impl]LibrarySdkMemberType structs. * The removal of their implementations of BuildSnapshot. * Replacing buildSnapshot() with BuildSnapshot() This will make subsequent refactoring of the SdkMemberType interface a little simpler. Test: m nothing Bug: 150451422 Change-Id: I1f96986bb497cf9d9df9916e40065f66b35a4704
2020-02-28Merge "Use header jar without jarjar for sharded classpath"Treehugger Robot
2020-02-25Expect added members for instrumented modulesJiyong Park
hiddenapi expects that all members in a class to have corresponding hidden API flags. However, this can't be satisfied when the java module having the class is instrumented; JaCoCo added a few number of synthetic members. In this case, give 'no-force-assign-all' option to the hidden api tool so that it doesn't complain about the synthetic methods. Also, disabling instrumenting jacocoagent itself, because it doesn't make sense. Exempt-From-Owner-Approval: PS3 fixes a typo in a comment. PS2 got ORV. Bug: 149353192 Test: SKIP_ABI_CHECKS=true EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true m out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/hiddenapi/unaligned/unaligned.jar Merged-In: Ibaf383c439945ab664e885af319548b56e2c8cb6 (cherry picked from commit 93e57a0b862beabdd11b8dac342167ea7f7c7b76) Change-Id: Ibaf383c439945ab664e885af319548b56e2c8cb6
2020-02-25Reland "Turn on the instrumentation by default for the java code in APEXes"Jiyong Park
This reverts commit c021ea0b3543d4ff64b16414c0276b96dc5b2c4b. Exempt-From-Owner-Approval: cherry-pick from aosp Bug: 149353192 Merged-In: I2b1c0736202de26c5ea88c0ab14574bd7207a5fb Test: N/A (this is a clean revert) forward fix will be followed (cherry picked from commit 00cae1cc88773a5238809130841b6a6b7eb63614) Change-Id: I2b1c0736202de26c5ea88c0ab14574bd7207a5fb
2020-02-25Expect added members for instrumented modulesJiyong Park
hiddenapi expects that all members in a class to have corresponding hidden API flags. However, this can't be satisfied when the java module having the class is instrumented; JaCoCo added a few number of synthetic members. In this case, give 'no-force-assign-all' option to the hidden api tool so that it doesn't complain about the synthetic methods. Also, disabling instrumenting jacocoagent itself, because it doesn't make sense. Exempt-From-Owner-Approval: PS3 fixes a typo in a comment. PS2 got ORV. Bug: 149353192 Test: SKIP_ABI_CHECKS=true EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true m out/soong/.intermediates/external/apache-xml/apache-xml/android_common_com.android.art.debug/hiddenapi/unaligned/unaligned.jar Change-Id: Ibaf383c439945ab664e885af319548b56e2c8cb6