Commit graph

16 commits

Author SHA1 Message Date
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00
Chris Parsons
637458d326 Have ConvertWBp2build use Bp2buildMutatorContext
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.

Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
2023-09-20 14:49:35 +00:00
Paul Duffin
d796f6f6dc Stop module types being SdkAware
Removes all usages of SdkBase and InitSdkAwareModule.

Bug: 260237150
Test: m nothing
Change-Id: I07db8afc805eadbeb5b23f2e1d2f51567eecfab0
2022-12-12 17:33:06 +00:00
Cole Faust
2ced8c8a57 Prevent duplicated license_kinds
Bazel fails when there are duplicate license_kinds.

Bug: 260148018
Test: go test
Change-Id: I47a27d37d66be947e4a744cd04a3cdcc0b000de4
2022-11-22 17:43:40 -08:00
Sasha Smundak
8bea267caf Implement bp2build for the package module
* We are interested mostly in the conversion the `default_applicable_licenses`
  attribute, as `default_visibility` cannot be handled until every module's
  `visibility` is handled.
* Several referenced license modules had to be manually enabled for
  conversion, and likewise a few trivial Android.bp containing only
  package and license modules.
* As Bazel allows only a single `package` rule, the package rules in a
  manually converted BUILD.bazel files were removed (in
  external/protobuf and prebuilts/clang/host/linux-x86 trees).
* The converted package rule is emitted before the `load` statements per
  Bazel documentation.

Bug: 190817312
Test: treehugger
Change-Id: If8bf6fee1580177de3bb402923615bcd48923ed2
2022-09-14 13:49:27 -07:00
Sasha Smundak
9d2f1743d2 Implement bp2build for the license module
Also, add ExpectedRuleTarget type to simplify bp2build testing

Bug: 190817312
Test: treehugger
Change-Id: Id3a642680d3518d36360ba957919a6fc96222672
2022-09-14 13:49:18 -07:00
Bob Badour
4101c71e63 Support multiple library names per target.
The prior interface to make supported only a single package name per
target; although, a target might have multiple licenses each with its
own package name.

Bug: 151177513
Bug: 210912771

Test: m all dist
Test: flash; About Phone -> Legal Information -> Third-party licenses

Change-Id: I1db5fcfd4c066afd162adb4eb4177960c7a503bd
2022-02-11 10:36:22 -08:00
Usta
851a3271ce Use Module.GetProperties() instead of ModuleBase.generalProperties
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
2022-01-08 03:09:52 +00:00
Usta
dca0219965 Remove customizableProperties from android.ModuleBase
- customizableProperties was being used to access all properties,
i.e. basically `GetProperties()`

- generalProperties was a subset of properties,
i.e. `initArchModule()` would only add new arch-specific properties
to `customizableProperties` (and `archProperties`) but not `generalProperties`

This PR sets generalProperties to contain all properties,
which then makes customizableProperties redundant.
And in arch.go, any iteration is done via `archProperties` instead.

Bug: 206961391
Test: m nothing and diff the ninja files
Change-Id: Ieb72b31c0a447fcbf34c92a04f002d7b9d777a86
2022-01-04 13:33:51 -05:00
Paul Duffin
ec0836af3a Switch Effective_license_text from []string to Paths
Effective_license_text contains paths to files that are copied from
one module to another and so need to be converted to Paths within the
context of the owning module as the paths are relative to the owning
module's directory.

The previous code did convert the license_text property to paths but
converted it back to strings again which was confusing and does not
follow the normal pattern.

Bug: 181569894
Test: m nothing
Change-Id: Iea09ee7f3de1187a2c3e41455ca83b0233d904b2
2021-05-11 08:24:59 +01:00
Paul Duffin
df5a90502d Move license module processing to GenerateAndroidBuildActions
Previously, the processing of the license module was done in the
licensesPropertyFlattener method which is called for all modules before
their GenerateAndroidBuildActions method is called. This change moves
the processing into the license module's GenerateAndroidBuildActions
method which was previously empty to match the normal practice.

Bug: 181569894
Test: m nothing
Change-Id: I3736879bfa4b4d1f4e2b35770852a02d09b3db83
2021-05-11 08:24:59 +01:00
Paul Duffin
b9e7a3ca7a Make licenseModule SdkAware
Making licenseModule SdkAware caused two breakages in the build. The
breakages were both caused by having an SdkAware module that was
depended upon by a versioned sdk snapshot but which was not itself
versioned and so did not have the member_name property set.

That occured because some default licenses have been added to the
packages containing prebuilts, e.g. prebuilts_runtime_license in
prebuilts/runtime/Android.bp. They apply to both the versioned and
unversioned members.

Once license support has been added to the sdk most of those will be
removed and replaced with properly versioned license modules. However,
in the meantime it is necessary to support that.

This change avoids the issue by checking to see whether the module is
itself versioned before relying on the member_name property. It also
improves the error message when a panic is recovered to make it easier
to identify where it originates.

Bug: 181569894
Test: m nothing
Change-Id: I0e7da2e0c4a30a6f814c2faab821b185aaed2135
2021-05-06 23:13:06 +01:00
Paul Duffin
3c298a3725 Reformat license code to comply with preupload checks
Bug: 181070625
Test: m nothing
Change-Id: I0b7c8613fcb7bc4e96908e391f1e46a9168f2507
2021-03-04 22:35:29 +00:00
Bob Badour
37af046002 Revert^2 "Add ability to declare licenses in soong."
df98d3e4a5

Change-Id: Ie7e1695ecb8cd943124426a0cad2c0d1db2b46ed
2021-01-06 20:48:24 -08:00
Jerome Gaillard
df98d3e4a5 Revert "Add ability to declare licenses in soong."
Revert submission 1377717-metalics

Reason for revert: This has broken renderscript_mac target for aosp-master, see b/176909442

Reverted Changes:
I26ac54ca9:Define the standard license_kind rules.
I656486070:Export soong license data to make.
If9d661dfc:Export soong license data to make.
I97943de53:Add ability to declare licenses in soong.
Icaff40171:Rough-in license metadata support to make.
Ib8e538bd0:Add variables for notice deps, license kinds etc.

Change-Id: Iddf5468e0175831ddb642011f2768f87a5e4fcf2
2021-01-06 19:00:05 +00:00
Bob Badour
8a36d94714 Add ability to declare licenses in soong.
See: http://go/android-license-checking-in-soong-v2-design

Bug: 151953481
Bug: 151177513
Bug: 67772237

Change-Id: I97943de53b071cd9918679c17015ed3397c172e9
2021-01-05 08:42:48 -08:00