summaryrefslogtreecommitdiff
path: root/android/path_properties.go
AgeCommit message (Collapse)Author
2025-02-18Implement host_common_data property for cc, java, rust and sh test modules Colin Cross
Implement the host_common_data property that will copy a host common module into the test data directory. This property can be used to copy a custom Tradefed test runner jar alongside the test. Bug: 262397555 Test: TestHostCommonData Change-Id: Iacef0778254a3dda400c9e221f442c47d8db7b02
2024-10-30Merge "Revert "Add device_first_vendor(_shared)_data"" into main Cole Faust
2024-10-30Revert "Add device_first_vendor(_shared)_data" Cole Faust
This reverts commit a8bf946a22d5e7022c5fd2c748da226f0ee0a16e. Reason for revert: Replaced with aosp/3322568 Change-Id: Ided7e261d50fbc3e41d4d731ae86b69258b2e7a2
2024-10-25Merge "Handle IgnorePrefer32OnDevice() in first_prefer32 path properties" ↵ Cole Faust
into main
2024-10-25Handle IgnorePrefer32OnDevice() in first_prefer32 path properties Cole Faust
This was causing missing dependency errors because the arch mutator will replace first_prefer32 with first when IgnorePrefer32OnDevice() is set. Bug: 372091092 Test: m nothing with aosp/3315229 on a device that sets IgnorePrefer32OnDevice() Change-Id: I04e4d7f95500befaf65cde58e9e16f643307b0a8
2024-10-24Add device_first_vendor(_shared)_data Cole Faust
There are some host tests in internal that rely on the vendor variation of other modules, that they include in their `data` property. Add explicit properties for these dependencies so that they don't rely on the 1-variant fallback. Bug: 372091092 Test: m nothing Change-Id: I51a50db2a06fdd3f885ac21f3ad3ce15386feb53
2024-10-23Add device_first_prefer32_data to java modules Cole Faust
Some java host tests add data dependencies on `compile_multilib: "first_prefer32"` modules. In order to match that with the requested variations, add a device_first_prefer32_data property. Bug: 372091092 Test: m nothing Change-Id: I54d056cc864512b22ad3da882c807052344ac1ca
2024-10-21Add new properties to aid in removing the 1-variant fallback Cole Faust
These new properties are essentially methods to specify "outgoing transitions" in blueprint files. There are lots of host tests that want to include apps built for device in their data, so they need a property that adds dependencies based on the device variants instead of copying the same host variants. After this cl is submitted, I'll do an LSC to update all the usages that are relying on the 1-variant fallback to use these properties instead. Bug: 372091092 Test: m nothing --no-skip-soong-tests Change-Id: I45b8fb024da120ad61606e3a21de86e4392be2a4
2024-10-10Remove MutatorHandle.Parallel() Colin Cross
All mutators are parallel by default, remove the explicit Parallel() calls. Bug: 372540665 Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I41e3a71bd13c75b7fceae91b1c4cfe678ab62df2
2024-04-04Rename Evaluate() to Get() and add GetDefault() Cole Faust
Part of the design of property structs is that they were easy to access. In keeping with that spirit, use a shorter and easier to spell name for the getter, and add GetDefault() so that you don't need to pass the result of Get() to one of the proptools.StringDefault/BoolDefault/etc functions. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I0b8df151de59f2cd9463425c6666cbfda6bf47f2
2024-03-14Make select statements work on path properties Cole Faust
Fixes: 329711542 Test: go test Change-Id: I71f489c26c535174e226e4a9ab449cc2b4bee83a
2024-01-29Prevent defaults modules from expanding path property dependencies Colin Cross
Defaults modules should not have dependencies added to them for path properties, the properties will already have been squashed into other modules that depend on the defaults modules, and the path dependencies will be added to those modules. Fixes: 321056451 Test: TestDefaultsPathProperties Change-Id: I59049f94b7a0924a7b1d997d15723901b0d522ee
2022-01-08Use Module.GetProperties() instead of ModuleBase.generalProperties Usta
ModuleBase.generalProperties served the pupose of being a subset of ModuleBase.customizableProperties. But now with the removal of the latter, the former is simply a redirection to Module.GetProperties() Bug: 206961391 Test: m nothing and diff the ninja files Change-Id: I6dd8b7ba74eb5e7ffb61029b0f9129eec2ccfdaf
2021-07-14Support fully qualified names in `android:"path"` properties Paul Duffin
Previously, a module reference in a path property would be parsed into two parts, the module name and the optional output tag, which defaults to an empty string if not specified. The output tag would be stored in a sourceOrOutputDependencyTag which would then be used, along with the module name to add a dependency on the module. Later, when the paths were processed the same module reference would be parsed into the same two parts again and the module name used to find a matching Module by comparing it against the name returned by either Module.Name(), ctx.OtherModuleName() or ModuleBase.BaseModuleName(). Once the module had been found then if it supported OutputFilesProducer then the tag would be passed to its OutputFiles(tag) method. Otherwise, it would fall back to treating it as SourceFilesProducer. The problem with that is the module name retrieved from the module in some way (either directly or through a context name) could be different to that originally supplied when adding the dependency. e.g. 1. If the original dependency was added onto a source module but there existed a suitable and preferred prebuilt module then the dependency onto the source module would have been replaced by the prebuilt module which has a different name. 2. If the path property included a fully qualified name that included a qualifying path then it would not match the name retrieved from the module which would not include the qualifying path. This change circumvents that whole issue by adding the module name that was originally used to add the dependency into the DependencyTag. Now the DependencyTag uniquely identifies the original module/outputTag pair parsed from the module reference. The pathDepsMutator guarantees that they are unique as it dedups them before adding the dependencies. It is possible that calling ExtractSource(s)Deps() would add some duplicate but if they did they would be identical, i.e. the same sourceOrOutputDependencyTag would be used to add a dependency onto the exact same module. In that case it would not matter which of the dependencies was found as it would still return the same module. Bug: 193228441 Test: m nothing Change-Id: I661514a2984818e5c26577411cede53eb57bcd02
2021-04-21Add bp2build arch-specific paths mutator Liz Kammer
Adds deps for properties tagged `android:"path"` within arch, multilib, and target properties. Test: build/bazel/ci/bp2build.sh Test: m nothing Bug: 185217298 Change-Id: I0230da399d2c4e984b837f69523fa09eadba3ff1
2021-03-09Lineage properties support module references. Jaewoong Jung
They should have had `android:"path"` tags attached so that users can point them to filegroup modules. Test: app_test.go & app_import_test.go Bug: 182175153 Change-Id: I5580408488ffe5fc12c869cbfb7a468713dcbc96
2021-02-24android:path attribute is respected for fields in a slice of struct Jiyong Park
This change fixes a bug that android:path attribute is ignored when annotated field is in a slice of struct. blueprint now traverses fields whose type is slice of struct and provides the index list in the case. Soong is modified so that it checks whether the field being referenced is a slice of struct or not. If that is the case, it gathers field values from each of the elements. If not, it follows the original path. Bug: 181018147 Test: m nothing Change-Id: I220efb6feaa525a00939654459b2998e98e7ad56
2020-11-19Add more comments to path_properties.go Colin Cross
Bug: 173449605 Test: m checkbuild Change-Id: I2638da9cc56726f5d646424e72f52289ad093781
2020-11-19Revert "Skip creating variants for disabled OSes" Colin Cross
This reverts commit d976af0cb47b78a7b4dbc60452d1eff4f0296df6. Reason for revert: broke windows SDK build: missing bin/dexdump.exe Bug: 173663545 Change-Id: Ibb541507650beabd2d94885dd8d66f724a358ca7
2020-11-17Skip creating variants for disabled OSes Colin Cross
The documentation java_genrule_host states that it creates a single variant, which would make it work with the single variant fallback in AddDependency used by the data property, but it actually has a host and a host-cross windows variant. Modify osMutator to take the OS-specific enabled properties into account to skip creating variants that will immediately be disabled so there is a single variant. Test: m checkbuild Change-Id: Ic2daab29f4fa3a3797d7a08348fbfcf1036ec5dc
2019-07-16Dedup path properties across property structs Colin Cross
Listing a property in multiple property structs would cause it to add multiple dependencies with the same dependency tag, which would trip the panic in getDirectDepInternal when calling PathForModuleSrc. Dedup the properties with the android:"path" struct tag across all property structs. Test: path_properties_test.go Change-Id: Ib6c0e7789443d340ee7551721df0135c5ee64c0f
2019-06-04Support tagged module references Colin Cross
There are cases where a module needs to refer to an intermediate output of another module instead of its final output. For example, a module may want to use the .jar containing .class files from another module whose final output is a .jar containing classes.dex files. Support a new ":module{.tag}" format in any property that is annotated with `android:"path"`, which will query the target module for its ".tag" output(s). Test: path_properties_test.go, paths_test.go Test: no unexpected changes in build.ninja Change-Id: Icd3c9b0d83ff125771767c04046fcffb9fc3f65a
2019-03-18Don't add dependencies on modules referenced in unused arch variants Colin Cross
When extracting dependencies from properties tagged with `android:"path"`, only look at the general property structs and not the arch-specific ones. The necessary arch-specific values will be appended into the general property structs. Fixes: 128377112 Test: path_properties_test.go Change-Id: I35e35555d5b15473229a7458fcfc2c7dacaec889
2019-03-07Add path properties mutator Colin Cross
Add a mutator pass after DepsMutator that visits every property struct in every module looking for properties that have a tag `android:"path"`, and automatically add a SourceDepTag dependency on any module references (":module-name") found. Uses a cache to store the mapping of property struct type to locations of properties with the tag. Test: android/path_properties_test.go Change-Id: I38c0497843dde4890e9342c3a6f0b402c0720742