summaryrefslogtreecommitdiff
path: root/java/java.go
AgeCommit message (Collapse)Author
2020-05-29Merge "apex respects stem of java_library modules" am: 00f5701ade am: 3013ea064fTreehugger Robot
Change-Id: I40a1a6803d8af53a7889b8986f59fbafd4d13ee1
2020-05-28Add support for remote-execution / caching of jar/zip actionsKousik Kumar
Test: Ran a build with `RBE_JAR="true" RBE_JAR_EXEC_STRATEGY="remote" RBE_ZIP="true" RBE_ZIP_EXEC_STRATEGY="remote" ... use_rbe m` and that succeeded. Bug: b/156765207 Change-Id: Ia17b532fbb282be414adf879914870082dd0841b
2020-05-28apex respects stem of java_library modulesJiyong Park
apex now respects stem of java_library modules. As a follow-up we need to suppor the same for other types of modules. Bug: 157638999 Test: m Change-Id: Iaf5023020b5440f1ffd4f5414b5a7864655fc22a
2020-05-28Merge "Correct link type for module stubs" into rvc-dev am: 1733d6acf8Anton Hansson
Change-Id: Ia5df51ecc76e9490aa94937ff8ba8eb92470dc5e
2020-05-28Merge "Correct link type for module stubs" into rvc-devAnton Hansson
2020-05-28Merge "Add test_mainline_modules to the auto-gen test ↵TreeHugger Robot
config(AndroidJUnitTest only)." into rvc-dev
2020-05-27Merge "Allow the user to explicitly set the java Uncompress_dex property."David Srbecky
2020-05-27Merge "Improve the structure of the link check method" into rvc-dev am: ↵Anton Hansson
5e8c81a91d Change-Id: I097494045b4ce961b5d0f019e856893e19988e32
2020-05-27Merge "Improve the structure of the link check method" into rvc-devAnton Hansson
2020-05-27Merge "AIDEGen: Add path attribute to okhttp module." am: c7c7e466ac am: ↵Treehugger Robot
d3205312ed Change-Id: I229231b44e448f72d896545ef525a6c2f39a5e1f
2020-05-27Merge "AIDEGen: Add path attribute to okhttp module."Treehugger Robot
2020-05-27Merge "Allow the user to explicitly set the java Uncompress_dex property." ↵TreeHugger Robot
into rvc-dev am: 6270b775de Change-Id: If73110d3028a1accf0cf61e6baa3b265f443f763
2020-05-27Merge "Allow the user to explicitly set the java Uncompress_dex property." ↵TreeHugger Robot
into rvc-dev
2020-05-26Retry: "Improve tracking of exported sdk libraries" am: 64e6199756Paul Duffin
Change-Id: I1ce69a094492316ba50da15e44968490f15a8bd8
2020-05-25Correct link type for module stubsAnton Hansson
Module stubs compile against module_current, so any module depending on them had to compile against module_current (or broader) too. Treat them as the API surface the stubs are for. Bug: 157010342 Test: m Change-Id: I49b9082dc1b5afe6c22e94126e574dd8061f0f39
2020-05-25Improve the structure of the link check methodAnton Hansson
Match by name first, then by kind. Bug: 157010342 Test: m Change-Id: Ic337a073c3bd14ac03b1d899aeb612247a708495
2020-05-25Retry: "Improve tracking of exported sdk libraries"Paul Duffin
The build tracks the java_sdk_library/_import modules that are referenced by libraries so that it can ensure that any Android app that includes code that depends on one of those modules has the appropriate <uses-library> entry in their manifest. Unfortunately, there were a couple of issues with that: 1) It only tracks direct references to the java_sdk_library module itself, e.g. android.test.mock. Direct references to the stubs module, e.g. android.test.mock.stubs were not tracked. Making it possible for Android apps to reference libraries which would not be available at runtime. 2) The logic for determining whether something was a java_sdk_library was repeated in a number of places making it difficult to allow java_sdk_library/_import instances to determine whether they should be treated as an Android shared library. 3) It tracks (and could use) even those java_sdk_library instances which do not represent a shared library, e.g. the ones that set api_only: true. While this change will simplifty fixing that the actual issue will be fixed in a follow up change. Changes: * Added EmbeddableSdkLibraryComponent and embedded it into java_sdk_library/_import, java_library and java_import. It provides the common code to minimize duplication. It contains an SdkLibraryToImplicitlyTrack field that if set will cause any references to the containing module to add the SdkLibraryParent to the list of implicit sdk libraries being tracked. * Changed code that assumed that anything that implemented SdkLibraryDependency required tracking to use the OptionalImplicitSdkLibrary() method to get the optional name of the sdk library to track. That will allow a follow up change to return nil from that method to exclude an sdk library from being tracked. * Moved SdkLibraryDependency from java.go to sdk_library.go as that is a better place for it to be. * Changed the stubs java_library/java_import creation code to initialize the SdkLibraryToImplicitlyTrack field with the name of the creating module. * Initialized the SdkLibraryToImplicitlyTrack field in the java_sdk_library/_import so that direct references to them will be tracked too. * Added tests to verify that direct access to the .stubs child of both java_sdk_library and java_sdk_library_import are tracked properly. Test: atest CtsProviderTestCases - which relies on android.test.mock being implicitly tracked to verify that I had not broken anything. Used aapt2 dump badging to read the manifest. m nothing - to run the new tests which failed before fixing the code. Bug: 156723295 (cherry picked from commit 859fe961b015259368e9994969b569eb34f54ddc) Change-Id: I760a9ac72856e3a07a497ce40db70c7e70106837
2020-05-25Revert "Improve tracking of exported sdk libraries" am: ed0314270dRemi NGUYEN VAN
Change-Id: I2a85486223ae046ff455752769ae08dffe6e98cf
2020-05-25Revert "Improve tracking of exported sdk libraries"Remi NGUYEN VAN
Revert submission 11569833 Reason for revert: Broke presubmit: b/157231582 Reverted Changes: Ia99def91e:Improve tracking of exported sdk libraries If91b4d106:java_sdk_library: Do not expose stubs implementati... Id6d76e56c:java_sdk_library: Access outputs using tags Change-Id: I3a07d412e795df512c430e4d2ed221f4d17e904a
2020-05-21Allow the user to explicitly set the java Uncompress_dex property.David Srbecky
ART tests need to explicitly control the compression. Bug: 157239179 Test: "atest ArtGtestsTarget" with http://go/aog/1302773 Change-Id: I4490aa0a61fa71f830feb6a46dffd8d20fccfc66
2020-05-21Allow the user to explicitly set the java Uncompress_dex property.David Srbecky
ART tests need to explicitly control the compression. Bug: 157239179 Test: "atest ArtGtestsTarget" with http://go/aog/1302773 Change-Id: I4490aa0a61fa71f830feb6a46dffd8d20fccfc66 Merged-In: I4490aa0a61fa71f830feb6a46dffd8d20fccfc66
2020-05-21Improve tracking of exported sdk librariesPaul Duffin
The build tracks the java_sdk_library/_import modules that are referenced by libraries so that it can ensure that any Android app that includes code that depends on one of those modules has the appropriate <uses-library> entry in their manifest. Unfortunately, there were a couple of issues with that: 1) It only tracks direct references to the java_sdk_library module itself, e.g. android.test.mock. Direct references to the stubs module, e.g. android.test.mock.stubs were not tracked. Making it possible for Android apps to reference libraries which would not be available at runtime. 2) The logic for determining whether something was a java_sdk_library was repeated in a number of places making it difficult to allow java_sdk_library/_import instances to determine whether they should be treated as an Android shared library. 3) It tracks (and could use) even those java_sdk_library instances which do not represent a shared library, e.g. the ones that set api_only: true. While this change will simplifty fixing that the actual issue will be fixed in a follow up change. Changes: * Added EmbeddableSdkLibraryComponent and embedded it into java_sdk_library/_import, java_library and java_import. It provides the common code to minimize duplication. It contains an SdkLibraryToImplicitlyTrack field that if set will cause any references to the containing module to add the SdkLibraryParent to the list of implicit sdk libraries being tracked. * Changed code that assumed that anything that implemented SdkLibraryDependency required tracking to use the OptionalImplicitSdkLibrary() method to get the optional name of the sdk library to track. That will allow a follow up change to return nil from that method to exclude an sdk library from being tracked. * Moved SdkLibraryDependency from java.go to sdk_library.go as that is a better place for it to be. * Changed the stubs java_library/java_import creation code to initialize the SdkLibraryToImplicitlyTrack field with the name of the creating module. * Initialized the SdkLibraryToImplicitlyTrack field in the java_sdk_library/_import so that direct references to them will be tracked too. * Added tests to verify that direct access to the .stubs child of both java_sdk_library and java_sdk_library_import are tracked properly. Test: atest CtsProviderTestCases - which relies on android.test.mock being implicitly tracked to verify that I had not broken anything. Used aapt2 dump badging to read the manifest. m nothing - to run the new tests which failed before fixing the code. Bug: 156723295 Merged-In: Ia99def91e9b74d2ed0a777de04b476c00ea0393d Change-Id: Ia99def91e9b74d2ed0a777de04b476c00ea0393d (cherry picked from commit 859fe961b015259368e9994969b569eb34f54ddc)
2020-05-21Merge "Improve tracking of exported sdk libraries" am: 7d74b5f142 am: 9e6bbde8b1Treehugger Robot
Change-Id: Ic39a86ee438e21c8b1cc4f9024e1bb889e7ca34c
2020-05-21Improve tracking of exported sdk librariesPaul Duffin
The build tracks the java_sdk_library/_import modules that are referenced by libraries so that it can ensure that any Android app that includes code that depends on one of those modules has the appropriate <uses-library> entry in their manifest. Unfortunately, there were a couple of issues with that: 1) It only tracks direct references to the java_sdk_library module itself, e.g. android.test.mock. Direct references to the stubs module, e.g. android.test.mock.stubs were not tracked. Making it possible for Android apps to reference libraries which would not be available at runtime. 2) The logic for determining whether something was a java_sdk_library was repeated in a number of places making it difficult to allow java_sdk_library/_import instances to determine whether they should be treated as an Android shared library. 3) It tracks (and could use) even those java_sdk_library instances which do not represent a shared library, e.g. the ones that set api_only: true. While this change will simplifty fixing that the actual issue will be fixed in a follow up change. Changes: * Added EmbeddableSdkLibraryComponent and embedded it into java_sdk_library/_import, java_library and java_import. It provides the common code to minimize duplication. It contains an SdkLibraryToImplicitlyTrack field that if set will cause any references to the containing module to add the SdkLibraryParent to the list of implicit sdk libraries being tracked. * Changed code that assumed that anything that implemented SdkLibraryDependency required tracking to use the OptionalImplicitSdkLibrary() method to get the optional name of the sdk library to track. That will allow a follow up change to return nil from that method to exclude an sdk library from being tracked. * Moved SdkLibraryDependency from java.go to sdk_library.go as that is a better place for it to be. * Changed the stubs java_library/java_import creation code to initialize the SdkLibraryToImplicitlyTrack field with the name of the creating module. * Initialized the SdkLibraryToImplicitlyTrack field in the java_sdk_library/_import so that direct references to them will be tracked too. * Added tests to verify that direct access to the .stubs child of both java_sdk_library and java_sdk_library_import are tracked properly. Test: atest CtsProviderTestCases - which relies on android.test.mock being implicitly tracked to verify that I had not broken anything. Used aapt2 dump badging to read the manifest. m nothing - to run the new tests which failed before fixing the code. Bug: 156723295 Change-Id: Ia99def91e9b74d2ed0a777de04b476c00ea0393d
2020-05-21AIDEGen: Add path attribute to okhttp module.bralee
Bug: 157115477 Test: 1. aidegen Settings -n open merged_module_info.json "okhttp": { ... "path": ["external/okhttp"] }, modules: "mimemap-testing-res.jar", "mimemap-res.jar" "services.core.priorityboosted", "framework-tethering" "bouncycastle_ike_digests", "robolectric-sqlite4java-native" have the 'path' attribute. Change-Id: If3628887866c29dcc948dd427727f175a5199edc
2020-05-18Merge "Use system modules for prebuilt SDKs >=30"Colin Cross
2020-05-18Extract common behavior between Module and ImportPaul Duffin
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 Merged-In: I1733405526764272beba63470a9bc8a958d41024 Change-Id: I1733405526764272beba63470a9bc8a958d41024 (cherry picked from commit 0d3c2e136b24272a51feed84eec947b7f42cf057)
2020-05-18Merge "Add test_mainline_modules to the auto-gen test ↵Treehugger Robot
config(AndroidJUnitTest only)." am: 1d9e2364ed am: 30a6edb924 Change-Id: I2134c97ff74f278033887a0e9ea5f758f4080772
2020-05-18Add test_mainline_modules to the auto-gen test config(AndroidJUnitTest only).easoncylee
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 Merged-In: I41ba8749ce46da62db402a8b8a555d4874e1cfc0
2020-05-18Merge "Add test_mainline_modules to the auto-gen test ↵Treehugger Robot
config(AndroidJUnitTest only)."
2020-05-17Extract common behavior between Module and Import am: 0d3c2e136b am: 8bf22015c0Paul Duffin
Change-Id: I1566ab0283c3efacb3c31d3c5f78903797d62a8c
2020-05-17Extract common behavior between Module and ImportPaul Duffin
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-15Use system modules for prebuilt SDKs >=30Colin Cross
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-15Merge "Use system modules for prebuilt SDKs >=30" into rvc-dev am: a91a16b484TreeHugger Robot
Change-Id: Ide5005514be7f916212cde486f75230fec87c807
2020-05-15Merge "Use system modules for prebuilt SDKs >=30" into rvc-devTreeHugger Robot
2020-05-15Don't use SDK variant for vendor JNI librariesColin Cross
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 c2d24050c5e3a09b7bc5236d15f24afa2405911f)
2020-05-15Add test_mainline_modules to the auto-gen test config(AndroidJUnitTest only).easoncylee
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-14Use system modules for prebuilt SDKs >=30Colin Cross
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
2020-05-15Merge "Don't use SDK variant for vendor JNI libraries" am: cb1d161666 am: ↵Colin Cross
d75524f322 Change-Id: I5684f17281e31e8d6ffc9d0c7541d55c1bbd0bba
2020-05-13Don't use SDK variant for vendor JNI librariesColin Cross
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-13java_sdk_library: Delegate component module to naming schemePaul Duffin
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 1b1e8069ec08a9f54cf0f8aa4ed95cab2781b3db)
2020-05-13java_sdk_library: Delegate component module to naming scheme am: 1b1e8069ec ↵Paul Duffin
am: 4fc05862d6 Change-Id: Id61c950ddb4607691951371c972985e503a020a1
2020-05-13java_sdk_library: Delegate component module to naming schemePaul Duffin
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-10Retry: Detect invalid arch specific properties in snapshotPaul Duffin
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 864e1b45dbf90e0b79b767be385e5f57f3dbdd25)
2020-05-09Merge "Retry: Detect invalid arch specific properties in snapshot" am: ↵Paul Duffin
385378bf99 am: ba539d0faf Change-Id: I8bec9a34eef34bf78c44f7836aba2496b117086f
2020-05-08Retry: Detect invalid arch specific properties in snapshotPaul Duffin
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 Change-Id: I3df60f0b53ba02ec2c55a80c7da058eac5909d26
2020-05-08Merge changes from topic "revert-1302576-NGVCIVIIJO" am: a71fe150fa am: ↵Greg Kaiser
010e45aa06 Change-Id: Idfb961746c35d4efceda1e0da4fc453b92101f3f
2020-05-08Revert "Detect invalid arch specific properties in snapshot"Greg Kaiser
Revert submission 1302576 Bug: 156054601 Reason for revert: Presumed root cause of build break. Reverted Changes: Ifc8116e11:Detect invalid arch specific properties in snapsho... I7ebd33307:Adds support for 'ignored-on-host' I167b47a13:Fix snapshot of a host/device cc_library with stub... Change-Id: Id7eba0bdde5c579e10e9b42d94a7cfab5f34995f
2020-05-07Merge changes I167b47a1,I7ebd3330,Ifc8116e1 am: af6fbcbcca am: 4b99ceccd6Paul Duffin
Change-Id: Id1001db2b0f09868529b3f7b87ddd3e822c14d49
2020-05-07Detect invalid arch specific properties in snapshotPaul Duffin
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 Change-Id: Ifc8116e11d987cfe7aec2eeaa964f3bbf36b5dc2