Nothing passes these arguments, so it's dead code.
There is a lot of other cruft in this file that is effectively
dead code, but required further cleanup.
Bug: 152479829
Test: m
Change-Id: Ib2630d4d49f21003b17e2331b0900e8df0a27e66
Makes it easier to add new api scopes by generating a struct with a
field for each scope.
Bug: 153443117
Bug: 153306490
Test: m nothing
Merged-In: Iec77a858d2c851d99e56568b89cb30aa3ff2a244
Change-Id: Iec77a858d2c851d99e56568b89cb30aa3ff2a244
Needed to optimize the handling of the module_lib API surface which
currently has to be generated with two separate droidstubs instances,
one to generate the stubs and another to generate the .txt file. This
allows the module generating the .txt file to avoid also wasting time
generating stubs that are not used.
This change:
* Adds a generate_stubs property that defaults to true to allow the
behavior to be customized on a per module basis.
* Uses either the stubs srcjar or the api .txt file as the OutputFile
for the AndroidMkEntries to ensure that they get written out properly.
* Rearranges the code for generating stubs to make it easier to
turn it off.
Bug: 146727827
Bug: 153306490
Test: m droid
Check output dir of framework-sdkextensions-api-module_libs_api
to make sure it does not contain any sources or srcjars.
Merged-In: Ib8025019f8a7a8cf5fa8765d76b5ad470af20006
Change-Id: Ib8025019f8a7a8cf5fa8765d76b5ad470af20006
It is no longer needed because non-static java_library dependencies are
not considered to be part of the depending APEX.
Bug: 153443117
Bug: 153306490
Test: m nothing
Merged-In: I7d58d1047b2d400395a253e492b35008284778ff
Change-Id: I7d58d1047b2d400395a253e492b35008284778ff
When a source and a prebuilt module are present in the same build a
dependency is added from the source module to the prebuilt module.
Previously, the code for generating the APEX did not recognize that
tag and in some cases (e.g. for cc_(prebuilt_)library_shared) will
fail the build.
This change:
1) Adds a test to reproduce the problem.
2) Improves the debug message by pretty printing the tag.
3) Adds a new ExcludeFromApexContents interface that can be implemented
by a tag to declare that it should be excluded from the APEX
contents.
4) Ignores tags that implement that interface when generating APEX
contents.
5) Implements that interface on prebuiltDependencyTag to fix the
test.
Bug: 153326844
Bug: 153306490
Test: m nothing
Merged-In: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
Change-Id: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
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
Having dependency tags in the dependency path that shows why a specific
module is considered part of an apex makes it easier to understand why
that is the case and detect possible issues.
Bug: 152762638
Bug: 153306490
Test: m nothing
Merged-In: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
Change-Id: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
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
Added droidstubsArgs field to the apiscope structure to avoid
switching on api scope type.
Bug: 153443117
Bug: 153306490
Test: m nothing
Merged-In: I96f0eb033d44c6a74787ba7f1523799b05a58092
Change-Id: I96f0eb033d44c6a74787ba7f1523799b05a58092
The java_sdk_library code used to create droiddoc and now it creates
droidstubs but it still referenced droiddoc internally. This change
removed all the remaining references except the ones that are visible
externally.
Bug: 153443117
Bug: 153306490
Test: m nothing
Merged-In: Ie883eb4590f9c091d4149d7b17d7d3d91b1b5c6a
Change-Id: Ie883eb4590f9c091d4149d7b17d7d3d91b1b5c6a
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.
Bug: 152878661
Bug: 153306490
Test: m droid
Merged-In: If46a2f74b6eca670befc3aeae430650e85542346
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
Added apex_available support to sysprop_library and copied it onto the
underlying cc_library.
Bug: 152762638
Bug: 153306490
Test: m nothing
Merged-In: I8f4c539532b48f3a45c1fbf0f7287db11df69d2f
Change-Id: I8f4c539532b48f3a45c1fbf0f7287db11df69d2f
The apex available check can traverse quite a long path (5+ steps) to
get from the apex to a module that is missing the apex from its
apex_available property. Understanding where that dependency came from
can often require examining the dependency path which can be difficult.
This change adds the path to the error to simplify that process.
Bug: 153306490
Test: m nothing
Bug: 152762638
Merged-In: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
Change-Id: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
Having multiple tests within one method makes debugging specific
failures more difficult so this change split the TestApexAvailable
test into multiple separate tests.
Bug: 153306490
Test: m nothing
Bug: 152762638
Merged-In: I2b2408ef515fd79c078686ef29a6ee8fb0407e7e
Change-Id: I2b2408ef515fd79c078686ef29a6ee8fb0407e7e
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
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
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
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
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
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 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 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
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
Previously, prebuilt had two ways to provide the src value, as a
pointer to an []string and using reflection. That meant that any code
that needed to check the src to use had to understand the two ways of
accessing it.
This change refactors the code to abstract the origin of the src values
being a supplier function. That insulates the callers from having to
know the details and makes it easy to add new suppliers in future.
Bug: 153306490
Test: m nothing
Bug: 142918168
Merged-In: I5cc7517c46cce96924c9f34ba1b046b468f7684a
Change-Id: I5cc7517c46cce96924c9f34ba1b046b468f7684a
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
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
This change ensures that the runtime dependencies between a
binary/shared library are correctly specified in the snapshot so that
the build can ensure that shared libraries are built before the targets
that use them.
It adds support for differentiating between references that are
required to refer to another sdk member (required) and those that may
refer to either an sdk member or a non-sdk member (optional). The
latter is used for shared library references as the libraries used by
an sdk member may be provided from outside the sdk. e.g. liblog is not
part of the ART module but is used by some members of the ART sdk.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ia8509ffe79b208c23beba1880fe9c8a92b732685
Change-Id: Ia8509ffe79b208c23beba1880fe9c8a92b732685
This change also added support for excluding properties from common
value extraction by using a struct tag of `sdk:"keep"` That was needed
to prevent the fields in SdkMemberPropertiesBase from having their
values cleared.
The purpose of this change is to make it easier to share functionality
across sdk member types.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ie5160a8f854056920e411801ca20721eab7c8578
Change-Id: Ie5160a8f854056920e411801ca20721eab7c8578
This change pulled the common value extraction functionality out into
its own structure that can be used to extract common values from
multiple sets of properties.
Precursor to follow up changes that will allow properties to contain
embedded structures making it easier to share functionality across
sdk member types.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ic902ed61e40ced7a2c2fa4b5f793f532c6fc0034
Change-Id: Ic902ed61e40ced7a2c2fa4b5f793f532c6fc0034
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
The sdk snapshot creates two prebuilts for each member one that is
versioned and one that is not. If they are both installed then they
lead to duplicate rules in make for creating the same installed file.
This change adds an installable property to cc modules that will
prevent the installation of the file and then adds installable: false
on the versioned prebuilt for cc modules.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: I4cb294c2b0c8a3f411eea569775835d9e41726d6
Change-Id: I4cb294c2b0c8a3f411eea569775835d9e41726d6
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
Adds support for specifying separate members to an sdk/module_exports
for different os types, e.g. separate ones for android and host.
Adds 'android:"arch_variant"' tag to the dynamically generated fields
for the sdk member types.
Merges the exported members from all variants together.
Determines the device/host_supported flags of the member snapshots by
whether the OsClasses used by their variants rather than the sdk's
host/device supported properties as they may be different.
Bug: 150451422
Bug: 153306490
Test: m nothing
Merged-In: I41fbbcd8723aafd54826aad9b78eced9f66ef51c
Change-Id: I41fbbcd8723aafd54826aad9b78eced9f66ef51c
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
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
Generalize the processing of arch specific properties to reduce
duplication in snapshot module creation and simplify addition of
support for handling multiple os types.
Supporting multiple os types with the current method for building
snapshot modules would require every affected module type to add
support for it. Rather than duplicate multiple os type handling code
across those module types this work generalizes the process cc modules
use for handling arch types as it can be used as a basis for handling
multiple os types. Migrating module types over to this new process
will insulate them from having to handle multiple os types.
OB
SdkMemberType changes:
* BuildSnapshot is deprecated in favour of the new AddPrebuiltModule()
method.
* Additional methods, CreateVariantPropertiesStruct() and
FinalizeModule() are added.
* A new interface SdkMemberProperties, is defined that handles
extracting information from the variant (prior to common value
optimization) and adding properties to a property set.
The sdk module type uses these new methods and types to delegate the
member type specific processing to the relevant member types while
handling the behavior that is common across all members types, e.g.
extracting common values across multiple architectures. A future change
will leverage this processing to add support for multiple os types.
This change also refactors the cc module processing to use the new
process.
Bug: 150451422
Bug: 153306490
Test: m nothing
Merged-In: If6ab2498407b17f50391d062cd9afc01b5e01af4
Change-Id: If6ab2498407b17f50391d062cd9afc01b5e01af4
Previously, while sdk tests would pass the sdk code would often fail
in androidmk processing. This change makes the tests more realistic
and will catch the errors earlier.
Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ifd0b2d7cf24e941c919f6b6e0beb2403a67d4308
Change-Id: Ifd0b2d7cf24e941c919f6b6e0beb2403a67d4308
Following how NDK also creates its own install path.
Bug: 142935992
Bug: 153306490
Test: cc_sdk_test.go, java_sdk_test.go
Merged-In: I98a3656903f37f6d7c90e6cf609431b2461a6161
Change-Id: I98a3656903f37f6d7c90e6cf609431b2461a6161