aboutsummaryrefslogtreecommitdiffstats
path: root/sdk
Commit message (Collapse)AuthorAgeFilesLines
* Use inclusive language in build/soongColin Cross2020-06-151-2/+3
| | | | | | | | Bug: 158889297 Test: m checkbuild Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc (cherry picked from commit 440e0d0542043de48f66771f00b67be0de588476)
* java_sdk_library: Add system-server scopePaul Duffin2020-06-081-0/+92
| | | | | | Bug: 155164730 Test: m nothing Change-Id: I49a2dab5c064b05f16691a3fae65f2b4ffc53bfd
* Copy removed.txt file to the snapshot correctlyPaul Duffin2020-06-041-11/+11
| | | | | | | | | | | | Previously, the code copied the current.txt file to both the current_api and removed_api properties. This change copies the removed.txt file to the removed_api property instead. Bug: 157980685 Test: m nothing Merged-In: Iad34e91051da43222d22c240c16f50887c43d73e Change-Id: Iad34e91051da43222d22c240c16f50887c43d73e (cherry picked from commit 3dbf9fd892fe7a60e4688a0bba54bfe4959b5ea2)
* Soong package structure refactoringJaewoong Jung2020-06-021-0/+27
| | | | | | | | | | | | Give prebuilt_etc and sh_binary their own packages and split the gigantic main Android.bp up to small, per-package ones. (This is a cherry-pick change.) Test: m nothing, TreeHugger Bug: 156980228 Change-Id: I7b00cd344b9f16861f1ff39edf0029f016b853d0 Merged-In: I7b00cd344b9f16861f1ff39edf0029f016b853d0
* java_sdk_library: Propagate shared_library to snapshotPaul Duffin2020-05-291-0/+13
| | | | | | | | | | | | | | | Passes the shared_library property through to the snapshot. It does not optimize away the default value in order to make it easier to invert the default value in future. The current default value was only chosen for convenience because most existing usages were already treated as shared libraries. It would be safer if modules had to opt in to be used as shared libraries. Bug: 155164730 Test: m nothing Merged-In: I33c7323f2389b44ed49cebe517ae2cce349117f1 Change-Id: I33c7323f2389b44ed49cebe517ae2cce349117f1 (cherry picked from commit d7eb1c2a762349befa616938219013bc423bcc44)
* Revert "Default annotations_enabled to true for sdk_library"Anton Hansson2020-05-251-6/+3
| | | | | | | | | This reverts commit a9a3173ee34ce6a6d33677eda02a6ca9b216e87e. Bug: 157010342 Reason for revert: broke ike Exempt-From-Owner-Approval: clean revert Change-Id: I592f50d0263ce78ea6d0d335cc7e0f493fcff800
* Default annotations_enabled to true for sdk_libraryAnton Hansson2020-05-211-3/+6
| | | | | | | | | | | This turns out retention of Nullable annotations, which is almost certainly what every user wants. Also add the "stub-annotations" lib to the stub libs property, to make sure the nullability annotations resolve properly. Bug: 157010342 Test: m Change-Id: I905144add4ef6f85445eedd1ba5169445f6005e0
* java_sdk_library: Propagate naming_scheme to snapshotPaul Duffin2020-05-161-0/+67
| | | | | | | | Bug: 155164730 Test: m nothing Merged-In: Iec7c52d2102b6294540090f3c1e32bd9d8cc7da8 Change-Id: Iec7c52d2102b6294540090f3c1e32bd9d8cc7da8 (cherry picked from commit f7a6433babd6495813ab4aacf4ca73ae2ce7bb4e)
* Fix special case when appending a visibility rule to //visibility:private.Martin Stjernholm2020-05-161-0/+24
| | | | | | | | Test: m nothing Bug: 151303681 Merged-In: Ibe7e953219e4660c653063e87cb08407a2cb513d Change-Id: Ibe7e953219e4660c653063e87cb08407a2cb513d (cherry picked from commit 64aeaaddef14cf83a6ffeca5c683a989c07fda7d)
* Add explicit visibility on the self package in EffectiveVisibilityRules.Martin Stjernholm2020-05-161-4/+16
| | | | | | | | | | | | | | | | Modules in a package is implicitly visible within the same package. When making effective visibility rules which work from another location that visibility needs to be mentioned explicitly. In practice this allows prebuilts to remain visible to other modules in the source package when the prebuilts are preferred. Test: m nothing Test: m conscrypt-module-sdk, check that the snapshot Soong modules give visibility to //external/conscrypt Bug: 151303681 Merged-In: I404f6e5ca7021974a8c7be5e4d6b4982c050b8a5 Change-Id: I404f6e5ca7021974a8c7be5e4d6b4982c050b8a5 (cherry picked from commit 0641d189d0cbf26cd23d584e621fc944c00abb46)
* Don't print :__pkg__ for package rules, since that's the default.Martin Stjernholm2020-05-161-5/+5
| | | | | | | | | | | | To reduce clutter a little. // Added for rvc-dev. Used this bug as it is the bug that needs all the build changes. Bug: 155164730 Test: m nothing Merged-In: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819 Change-Id: I0d2d86f00c3d38e603d6f58c4b1dd9a4170bf819 (cherry picked from commit 01407c525aa0c6326049a4c9179d74188ef4f86b)
* Correct module_lib scope namePaul Duffin2020-05-141-12/+12
| | | | | | | | | | | | | | 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 Merged-In: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f Change-Id: I7dbafd7164d5da600ca45c39a7f93a5a40027a1f (cherry picked from commit 6b836ba566fc83b8785d901067ad41e177292d37)
* java_sdk_library: Add sdk_version for API scopesPaul Duffin2020-05-131-1/+63
| | | | | | | | | | | 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 Merged-In: I5881e5ee7c2169c30f544882344a60a602dae917 Change-Id: I5881e5ee7c2169c30f544882344a60a602dae917 (cherry picked from commit 87a05a389d9edfa3b83d90aa4c08cb66a29e4caf)
* java_sdk_library: Allow separate api/stubs source modulesPaul Duffin2020-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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 Merged-In: Iea7d59852d7aeb503120acf3c44e08eb0d9d07b9 Change-Id: Iea7d59852d7aeb503120acf3c44e08eb0d9d07b9 (cherry picked from commit 0ff08bdb075412b15e005ca9c42860c385126588)
* java_sdk_library: Preserve sdk_version: "none" in snapshotPaul Duffin2020-05-131-0/+59
| | | | | | | | Test: m nothing Bug: 156354511 Merged-In: Icf7c20dc109a773430768c1a2d91c674551dbc1b Change-Id: Icf7c20dc109a773430768c1a2d91c674551dbc1b (cherry picked from commit 780c5f4715d402b4faddef336d456e39cfae9db1)
* Defer \n quoting generatedContents until creating the ninja rulePaul Duffin2020-05-123-9/+14
| | | | | | | | | | | | | | | | | | | | | | | Previously, when writing to generatedContents \n characters were quoted (replaced with \\n) so as to allow them to be preserved through ninja/rsp/bash and were unquoted (replaced \\n with \n) just before redirecting to the output file. That meant that any code which wanted to access the contents for other purposes, e.g. testing had to unquote \\n. This change moves the quoting to be part of the code that generates the ninja rule which simplifies any other code that has to access the contents. Without quoting the generated Android.bp files are not formatted properly, are all on one line and completely unreadable. Bug: 156286550 Test: m art-module-sdk and check generated Android.bp file to make sure it is properly formatted. Merged-In: I768c3b96ed08a3daf251730e2a10d9d72338c49a Change-Id: I768c3b96ed08a3daf251730e2a10d9d72338c49a (cherry picked from commit 1110827b3f30bffb6cb811e8cb79bb03ac7d1f86)
* java_sdk_library: Specify visibility of stubs modulesPaul Duffin2020-05-101-0/+2
| | | | | | | | | | | | | Adds two new properties to specify the visibility of the stubs modules (source and library) created by the java_sdk_library. Excludes visibility property from being inherited when creating the module so it can be properly specified by copying across the relevant property. Test: m checkapi Bug: 155164730 Merged-In: Iffdd9f191ff0d74646356ac577560cc38efdd790 Change-Id: Iffdd9f191ff0d74646356ac577560cc38efdd790 (cherry picked from commit 4911a89181dd1a22bf8703107e7395e6f1c0dd3f)
* Retry: Fix snapshot of a host/device cc_library with stubsPaul Duffin2020-05-102-0/+93
| | | | | | | | | | | | | | | Change since last attempt: Disable test that breaks on darwin. Adds a test that fails with unknown property android.stubs.versions and then fixes that by marking the field from which that property is created with 'ignored-on-host' and implemented the isHostVariant on *osTypeSpecificInfo. Bug: 155628860 Test: m nothing Merged-In: Ia4e744c9e799d5adaf8a2f761516f568ec363ad4 Change-Id: Ia4e744c9e799d5adaf8a2f761516f568ec363ad4 (cherry picked from commit 7a1f7f32ab9f230608c0648a62c0d3e9bc402a73)
* Retry: Adds support for 'ignored-on-host'Paul Duffin2020-05-102-1/+49
| | | | | | | | | | | | | | | | | | | Adds a filter mechanism that can exclude property values from being included in the common value extraction. That is needed to prevent the snapshot mechanism from generating invalid output for properties that are ignored on host (and have their values cleared) and which are not tagged with `android:"arch_variant"`. Changes: * Updates the documentation of SdkMemberType to explain what effect the 'ignored-on-host' tag has. * Adds some tests for this new mechanism. Bug: 155628860 Test: m nothing Merged-In: Ibafdb6e921ba5abe505bd8a91ca5a1d9c9b5d0cb Change-Id: Ibafdb6e921ba5abe505bd8a91ca5a1d9c9b5d0cb (cherry picked from commit c459f89fb46e163eb57f1fc41e4a79383785db32)
* Retry: Detect invalid arch specific properties in snapshotPaul Duffin2020-05-102-8/+57
| | | | | | | | | | | | | | | | | | | 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)
* java_sdk_library: Add support for module_lib API surfacePaul Duffin2020-05-081-0/+111
| | | | | | | | | | | | | | | | Adds api scope for the module_lib and adds that to the list of all all available scopes. The scope is generated if and only if the api_surfaces property contains "module_lib". No other changes are needed as the generation of the APIs is completely driven by the allApiScopes array and the information in its contained apiScope structures. Test: m checkapi Bug: 155164730 Merged-In: I7769af6823badca8715a270f86cf53b4e954b7df Change-Id: I7769af6823badca8715a270f86cf53b4e954b7df (cherry picked from commit 8f265b9ab96fb30bc179d88639bda03229996d65)
* java_sdk_library: Control API surfaces generatedPaul Duffin2020-05-081-0/+85
| | | | | | | | | | | | | | | Adds a per scope set of properties that allows explicit control over the API surfaces generated. Previously, the term active was used to determine whether it was generated but that was a little abstract and unclear so has been replaced by generated. Test: m nothing Bug: 155164730 Merged-In: I7539d89618b61f6b9d1a4b60cc3f9614b157f0d9 Change-Id: I7539d89618b61f6b9d1a4b60cc3f9614b157f0d9 (cherry picked from commit 3375e35d99b428460f0dd8404c74a9e1ccb0b5ab)
* Export API files as part of the java_sdk_libraryPaul Duffin2020-05-081-0/+18
| | | | | | | | | Bug: 153443117 Test: m nothing Merged-In: I9d6f5b91a7cc25019e2eb9e3c138f0874d2831de Change-Id: I9d6f5b91a7cc25019e2eb9e3c138f0874d2831de (cherry picked from commit 1fd005d5b30ce24593d7fe2e7dba43855d6f6466)
* Export stub sources as part of the java_sdk_libraryPaul Duffin2020-05-082-5/+16
| | | | | | | | | | | Minor refactoring of checkMergeZip(string) -> checkMergeZips(...string) to allow testing of multiple merge zips. Bug: 153443117 Test: m nothing Merged-In: I8db00f611ced15f8476ba16f2834a72e8c913596 Change-Id: I8db00f611ced15f8476ba16f2834a72e8c913596 (cherry picked from commit 3d1248ceb6d8c1ce7d2f3f2e62f98700f668e4dc)
* Allow extractCommonProperties to return an errorPaul Duffin2020-05-073-11/+83
| | | | | | | | | | | | | | | | | | Refactoring in preparation for follow up changes. Also: * Adds a new AssertErrorMessageEquals() helper method. * Improved error reporting in the accessor and added name to extractorProperty to ensure meaningful errors are reported. * Added String() string method to propertiesContainer. * Reports errors using the field name as the errors are not really fixable by developers and it is more meaningful to the build team. Bug: 155628860 Test: m nothing Merged-In: I5c5b8436bcbc39e4e7cd35df2577b2dac53e702a Change-Id: I5c5b8436bcbc39e4e7cd35df2577b2dac53e702a (cherry picked from commit 4b8b79394fa5eeddc532aa9e38870dd1c3a291b5)
* Correct order of parameters to AssertDeepEqualsPaul Duffin2020-05-071-6/+9
| | | | | | | | | | The expected/actual were around the wrong way. Bug: 155628860 Test: m nothing Merged-In: I98b575b8b85dcbfd2075e77689f0329aa2eadbf0 Change-Id: I98b575b8b85dcbfd2075e77689f0329aa2eadbf0 (cherry picked from commit 1d6c0df597d939ae408ba90214f023086fb13aed)
* Encapsulate getter into an extractorProperty structurePaul Duffin2020-05-071-7/+22
| | | | | | | | | | | | | Refactors the existing code to wrap a getter with a structure in order to simplify adding additional per-property information. Adds an emptyValue field to contain the empty value appropriate for the field type. Bug: 155628860 Test: m nothing Merged-In: I7e169bd9b6e51b88e35bdf8673a5056337f778c1 Change-Id: I7e169bd9b6e51b88e35bdf8673a5056337f778c1 (cherry picked from commit b28369a982a64d4820750c0d84fbe8ec243a1e7b)
* Encapsulate properties to be optimized in a containerPaul Duffin2020-05-072-21/+46
| | | | | | | | | | | | This allows additional metadata to be associated with a set of properties that will be used in a follow up change to filter properties that are ignored in some variants (e.g. host variants). Bug: 155628860 Test: m nothing Merged-In: Ie83c1ffbb71fd5d7a08d350571dad3e3209b1431 Change-Id: Ie83c1ffbb71fd5d7a08d350571dad3e3209b1431 (cherry picked from commit f34f6d853876b2a8e8e1b4d04e0b0e07dd007a04)
* Do not propagate dynamic dependencies for stub libs.Martin Stjernholm2020-05-061-0/+5
| | | | | | | | | | | | Test: m nothing Test: Build an SDK snapshot including libc, check that the generated cc_prebuilt_library_shared for it is a stub that doesn't depend on ld-android. Bug: 152255951 Bug: 154310674 Merged-In: Ie5ec02aebdf00b75756a6eda40db821488d30065 Change-Id: Ie5ec02aebdf00b75756a6eda40db821488d30065 (cherry picked from commit cc330d665a6e1ef3488e8fe69628983aa182bcc1)
* Do not propagate the stub symbol file to prebuilts.Martin Stjernholm2020-05-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | This partially reverts https://r.android.com/1278193. The propagated symbol files contain all versions, even though only one is applicable in a given SDK snapshot. It's uncertain what repercussions this might have, but one is that if we were to update a snapshot for a fixed version then it might change because the symbol file contains new versions that aren't applicable. Since the symbol file isn't actually needed at this point it's better to wait with this step until the use cases for it are more clear. Test: m nothing Test: Create an SDK snapshot with Bionic libs, drop it into a master-art tree without bionic/ in it, build ART APEXes, and check that the Soong phase completes (specifically that the stubs are detected even without symbol files). Bug: 152481980 Merged-In: Ic79f89bc6d11d0b6552fa20791f5680ff9a40c0d Change-Id: Ic79f89bc6d11d0b6552fa20791f5680ff9a40c0d (cherry picked from commit bdd0dffc1b93d137a7642998219e6e7849873218)
* Propagate stubs to the SDK for libraries that have them.Martin Stjernholm2020-05-061-0/+63
| | | | | | | | | | | | | | | | | | | | | | Necessary to make the APEX build logic treat the libraries as API boundaries rather than dependencies to bundle. The .so files in the snapshots are the compiled stub libraries in this case. They are strictly speaking redundant since they can be generated from the .map.txt files in the snapshots, but doing that would require extending the cc_prebuilt_library(_shared) module types with a full compiler pass etc, and that would break a lot of assumptions in the cc package. Test: m nothing Test: Create an SDK snapshot with Bionic libs, drop it into a master-art tree without bionic/ in it, build ART APEXes, and check that the Soong phase completes (specifically no errors about various APEX libs requiring libc that is not available to them). Bug: 152481980 Merged-In: I31b928e6261198b6dd6f6b17196e714f07b64172 Change-Id: I31b928e6261198b6dd6f6b17196e714f07b64172 (cherry picked from commit c5dd4f7c1f3958bb68ad493088275b286a6acd6b)
* Don't run new test on Darwin that lacks snapshot support.Martin Stjernholm2020-05-061-0/+3
| | | | | | | | | Test: m nothing Bug: 152514829 Bug: 152255951 Merged-In: Ib14af7caa408e252242e6933f7281aab3888789c Change-Id: Ib14af7caa408e252242e6933f7281aab3888789c (cherry picked from commit 66a06945aac1fe32f43dde883b7f92253e875a4a)
* Propagate empty vs unspecified system_shared_libs correctly.Martin Stjernholm2020-05-061-24/+199
| | | | | | | | | | | | | | | Necessary to get correct prebuilts for many Bionic libs. Cleaned up numerious "system_shared_libs: []" from test fixtures, since they otherwise would need correction in the expected results, and it is better to have a single test focused on testing system_shared_libs propagation. Test: m nothing Bug: 152255951 Merged-In: If2e8a5296223e6281d833312660e8e9e4cd184c0 Change-Id: If2e8a5296223e6281d833312660e8e9e4cd184c0 (cherry picked from commit 10566a035f648cd85b9af444b06cc2eb9975a9ef)
* Add SDK member support for cc_object.Martin Stjernholm2020-05-061-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: m nothing Test: Add sdk { name: "runtime-module-sdk", native_shared_libs: [ "libc", "libdl", "libm", "ld-android", ], native_objects: [ "crtbegin_dynamic", "crtbegin_static", "crtend_android", ], } to bionic/apex/Android.bp. Then: build/soong/scripts/build-aml-prebuilts.sh runtime-module-sdk Take the generated runtime-module-sdk-current.zip and unzip into a master-art tree without bionic/, edit the generated Android.bp to extend cc_prebuilt_* modules with: nocrt: true, stl: "none", system_shared_libs: [], apex_available: ["//apex_available:anyapex"], recovery_available: true, vendor_available: true, ramdisk_available: true, Then "m com.android.art.debug". This passes Soong but fails in the build step because more members are required. Bug: 148934017 Merged-In: I2ab8f6aadb1440b325697cae4a8ed761c62d15d2 Change-Id: I2ab8f6aadb1440b325697cae4a8ed761c62d15d2 (cherry picked from commit cd07bce43756d5246e07d079a4a24040981f54ff)
* Fix definition of android_stubs_current in sdk testsPaul Duffin2020-05-011-3/+3
| | | | | | | | | | | | This change fixes an issue with the definition of the android_stubs_current (and similar) modules in the sdk tests. They were incorrectly defined as java_sdk_library_import and not java_import. Test: m nothing Bug: 155164730 Merged-In: I4e9bfebdd2ff0a374e12284ccdf5ee5518968969 Change-Id: I4e9bfebdd2ff0a374e12284ccdf5ee5518968969 (cherry picked from commit 260bd316bf3b8722ddf3b9c11ca54b519466d189)
* Support java_sdk_library as member of sdkPaul Duffin2020-04-222-0/+113
| | | | | | | | Bug: 153443117 Bug: 153306490 Test: m nothing Merged-In: I9d8089b2555038e3f10ad5939a6a7b01839c67ea Change-Id: I9d8089b2555038e3f10ad5939a6a7b01839c67ea
* Stop requiring apex_available on java_library members of sdksPaul Duffin2020-04-222-16/+12
| | | | | | | | | | | | | | | | | 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
* Extract DepIsInSameApex and RequiredSdks interfacesPaul Duffin2020-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The DepIsInSameApex() and RequiredSdks() methods were defined in a few places to avoid having to depend on the whole ApexModule/SdkAware interfaces directly. However, that has a couple of issues: 1) It duplicates functionality making it difficult to change, changes to the definitions outside the main interfaces do not cause compile time failures, instead they result in a runtime change in behavior which can be difficult to debug. 2) IDE navigation (specifically in Intellij) does not detect that the duplicate definitions can resolve to the definitions in the main interface. This change extracts the methods into their own interfaces and reuses those interfaces instead of duplicating the methods to fix both of these issues. Bug: 152878661 Bug: 153306490 Test: m nothing Merged-In: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb Change-Id: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
* Use reflect.Zero(type) to get value to clear fieldPaul Duffin2020-04-221-5/+1
| | | | | | | | | | | | | Previously, the common value extraction code used an empty structure to get the value to use to clear a field whose value is common. This change removed the structure and used reflect.Zero(..) to get the value instead. Bug: 142935992 Bug: 153306490 Test: m nothing Merged-In: Ibd5103dacb86e7754a786356c0d15ffbde7f98bf Change-Id: Ibd5103dacb86e7754a786356c0d15ffbde7f98bf
* Sdk snapshot set compile_multilib per OsTypePaul Duffin2020-04-223-28/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when an sdk snapshot only supported a single os type the compile_multilib was set based on the multilib usages by the members of that variant. After the change to support multiple os types per snapshot the multilib setting was based on the multilib usages across all the members of all sdk variants. That meant that if one os type used only "64" and the other used "both" then they would both be treated as "both" leading to missing variants when the snapshot was unpacked. This change tracks the multilib usages per os type and adds a property for each one. It intentionally changes a couple of tests: 1) Either by adding compile_multilib that is missing. 2) By targeting it at a specific os type instead of host. The latter change is important to prevent the snapshot from being used on a host platform (which will match the host target section) but which is a different os type to the ones supported by the snapshot. Bug: 142935992 Bug: 153306490 Test: m nothing Merged-In: I883919b644292c3d019db223bb4fd5c11b39591f Change-Id: I883919b644292c3d019db223bb4fd5c11b39591f
* Remove old SdkMemberType API for creating snapshot modulesPaul Duffin2020-04-221-6/+1
| | | | | | | | | | Migrates system modules and droid stubs over to use the new API for creating the snapshot modules and removes the old API. Bug: 153306490 Test: m nothing Merged-In: Ia825767f1f7ee77f68cfe00f53e09e6f6bfa027f Change-Id: Ia825767f1f7ee77f68cfe00f53e09e6f6bfa027f
* Improve consistency of handling java snapshot propertiesPaul Duffin2020-04-221-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make new module creation API more flexiblePaul Duffin2020-04-221-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add abstraction for tracking compile multilib usagesPaul Duffin2020-04-221-32/+48
| | | | | | | | | | Ensures consistent tracking of multilib usages. Bug: 142935992 Bug: 153306490 Test: m nothing Merged-In: I82ba4a53a21a0823503cb98f7edfde449b48b440 Change-Id: I82ba4a53a21a0823503cb98f7edfde449b48b440
* Add support for using cc_library in sdk/module_exportsPaul Duffin2020-04-222-5/+171
| | | | | | | | | | | | | | | | | | Added link type support in module creation code as cc_prebuilt_library has to provide both shared and static libraries. Had to add some calls to FirstUniquePaths() around the include dirs settings in library_sdk_member as otherwise the shared variant contains duplicate include dirs (presumably because it gets one set from its dependency on the static variant and one set of its own). That difference in include dirs causes problems in the generated cc_prebuilt_library. Bug: 153306490 Test: m nothing Bug: 142918168 Merged-In: Ie7f23fc2341c83c7814cc98e3970df4f5d4c8423 Change-Id: Ie7f23fc2341c83c7814cc98e3970df4f5d4c8423
* Extract the osTypeSpecificInfo code from module creation loopPaul Duffin2020-04-221-119/+160
| | | | | | | | | | | | | | | Extract the functionality to create an osTypeSpecificInfo struct, to optimize the properties, and add its properties to a property set into methods of the *osTypeSpecificInfo struct. This change is in preparation for adding support for link type which is another dimension within arch type which itself sits within os type. Bug: 153306490 Test: m nothing Bug: 142918168 Merged-In: I025ee90e1461f7389bf4a9d056b281453068cf87 Change-Id: I025ee90e1461f7389bf4a9d056b281453068cf87
* Extract archTypeSpecificInfo code from module creation loopPaul Duffin2020-04-221-14/+30
| | | | | | | | | | | | Extract the functionality to create an archTypeSpecificInfo struct and to add its properties to a property set into methods of the *archTypeSpecificInfo struct. Bug: 153306490 Test: m nothing Bug: 142918168 Merged-In: I2a9e0327b61bce7ad7699cd75de17aa0e5f1ebbb Change-Id: I2a9e0327b61bce7ad7699cd75de17aa0e5f1ebbb
* Clean up the main module creation loopPaul Duffin2020-04-221-65/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change reorganizes the code within the main module creation loop in preparation for delegating the work to separate types. It has been split out into its own change to make it easier to review by keeping the functional changes localized. Renames the osTypeSpecificInfo archTypes field to archInfos as the latter is more accurate. Cleans up the arch variants handling: 1) Groups them by arch type to make them easier to process. 2) Fails fast when there is not exactly one variant per arch type as otherwise it results in a confusing failure later on. 3) Removes the commonArch flags and instead uses the fact that osInfo.archInfos is empty when the common architecture variant is available. Cleans up the arch type specific property set handling. 1) Adds new archPropertySet variable to allow the choice of where the arch specific properties are added to be made alongside the choice of where the os specific properties are to be added. 2) Removes unnecessary check for commonArch around the loop to add properties from archInfos as the archInfos will be empty when the common architecture is present. A number of other changes to make it easier to extract the code into their own methods. Bug: 153306490 Test: m nothing Bug: 142918168 Merged-In: I16a5fa79efff0d08c22916449eb46a5bd910723a Change-Id: I16a5fa79efff0d08c22916449eb46a5bd910723a
* Output properties before sets in snapshot modulePaul Duffin2020-04-223-17/+29
| | | | | | | | | | | | | | | This ensures a consistent output irrespective of whether property sets are created before or after the properties are added. This provides a little more flexibility in the creation code which allows that to be simplfied. Also switches from using reflection to a type switch. Bug: 142918168 Bug: 153306490 Test: m nothing Merged-In: Ia025bfc751f1217d1658de6fb8e15091ea0ea9ff Change-Id: Ia025bfc751f1217d1658de6fb8e15091ea0ea9ff
* Remove SdkMemberType.FinalizeModulePaul Duffin2020-04-222-28/+26
| | | | | | | | | | | | | | | This was only being used to set the "stl" property for cc library sdk member type and so that functionality was moved to AddPrebuiltModule() and FinalizeModule was removed. Required a few test changes to move the property to the correct position in the generated module. Bug: 142918168 Bug: 153306490 Test: m nothing Merged-In: If6400189833d4ff3285e7a7adf63a9b509e2a03b Change-Id: If6400189833d4ff3285e7a7adf63a9b509e2a03b