Commit Graph

4302 Commits

Author SHA1 Message Date
Wei Li
b980aa5f6e Merge "Add the initial implementation of bp2build converter for java_library, java_library_host, java_binary_host and cc_library_host_shared so signapk tool can be built with Bazel." am: 2115d35101 am: 9adc5f84bb am: 38387e7624
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918122

Change-Id: If8019287fd0f968c6ea62a9db012049eef379df3
2021-12-15 04:27:02 +00:00
Jingwen Chen
d109bd996e Allowlist directory for com.android.adbd.
Test: b test //build/bazel/tests/...
Change-Id: I54b90191566f6deb4f3d01af8b851df82f958119
2021-12-15 01:58:20 +00:00
Wei Li
bafb6d6612 Add the initial implementation of bp2build converter for java_library,
java_library_host, java_binary_host and cc_library_host_shared so
signapk tool can be built with Bazel.

Test: b build //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Test: jarsigner -verify -verbose build.bazel.examples.apex.minimal.apex
Bug: 209876137
Bug: 196204358
Bug: 210158864
Bug: 210159074
Bug: 210158872
Change-Id: I855884159d25e69d8f9623792c376da820a1eb4c
2021-12-14 17:23:19 -08:00
Liz Kammer
ea10fa37bd Merge "Ensure reported unconverted deps are unique" am: b7d18efca0 am: acec48022d am: 5d3d10e2eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1920688

Change-Id: I415022d2533c7c2c2a72e9cfad18a2741f3ef16a
2021-12-14 20:03:35 +00:00
Liz Kammer
037105c0f8 Merge "Use one mutator for all bp2build conversion." am: 92344259c5 am: 782f37eaee am: 5f4df317ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1878397

Change-Id: I07a71558e07f6a9756834950505017d1117bbb2c
2021-12-14 20:03:21 +00:00
Liz Kammer
bbabe6f3eb Ensure reported unconverted deps are unique
Test: m bp2build
Change-Id: I4a260d1f2ff9f6fd39c55c447466618fcdef52c7
2021-12-14 09:37:47 -05:00
Liz Kammer
be46fccc40 Use one mutator for all bp2build conversion.
Each conversion required defining a separate mutator, which will each
operate on _all_ modules and requires each to repeat checks whether the
mutator should operator. Instead, we introduce a single mutator and
modules can define a ConvertWithBp2build to implement bp2build
conversion for that module.

Test: bp2build.sh
Bug: 183079158
Change-Id: I99d4b51f441c2903879092c5b56313d606d4338d
2021-12-14 09:37:45 -05:00
Rupert Shuttleworth
c8f4b2ad17 Merge "Handle includes for generated headers" am: 6f32f95b25 am: d469eefcc3 am: f56d2d4bfe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918455

Change-Id: I5f8b5681f98ccfdefcd6ed16d67888ab4ba0c929
2021-12-14 00:58:48 +00:00
Rupert Shuttleworth
6f32f95b25 Merge "Handle includes for generated headers" 2021-12-14 00:11:26 +00:00
Usta
eabf0f36f3 cosmetic changes
base.module = module is redundant in InitDefaultsModule() becase of the preceding initAndroidModuleBase()
minor reformat of initArchModel()

Test: m nothing
Bug: n/a

Change-Id: I16d5a400a33098a81ffbf6c81eba5b13db6debf1
2021-12-13 13:33:15 -05:00
Liz Kammer
1263d9bdb1 Handle includes for generated headers
For generated headers, Soong introduces the package to the includes (and
re-exports as necessary).

Test: bp2build.sh
Change-Id: Iea9cda859ddaa3e5393f0f4533c15fc60222c408
2021-12-13 12:06:39 -05:00
Martin Stjernholm
67cbe36b4a Merge "Do not allow duplicate deapexer dependencies." am: d7c3fc0ae0 am: 49df6778ca am: 6bec093e48
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1752641

Change-Id: I079dd1a7666520e69f47b7819ee6977ba6e770fe
2021-12-13 16:51:07 +00:00
Martin Stjernholm
d7c3fc0ae0 Merge "Do not allow duplicate deapexer dependencies." 2021-12-13 15:52:19 +00:00
Colin Cross
f3a84bc1a6 Revert^2 "Build license metadata files in Soong" am: 4acaea9cbf am: d8395b1b2f am: c6d7cae3ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918948

Change-Id: Id80b8181716cc7b5da0100fd29e9ebd865ff43d1
2021-12-11 04:32:39 +00:00
Colin Cross
d8395b1b2f Revert^2 "Build license metadata files in Soong" am: 4acaea9cbf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918948

Change-Id: I8682f46f7843e0d367b96a09135dad03e3df934c
2021-12-11 03:48:25 +00:00
Treehugger Robot
f4c2bf6559 Merge changes from topic "revert-1918946-revert-1899703-AMWIVCREEV-CCTEXIRRRV"
* changes:
  Revert^2 "Add dependency license annotations"
  Revert^2 "Build license metadata files in Soong"
2021-12-11 03:32:18 +00:00
Colin Cross
9d9dc0a0a4 Merge changes from topic "revert-1899703-AMWIVCREEV" am: 67938c2925 am: 34ca826598 am: 5400ba36b5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918944

Change-Id: Ief89219f9cff1d842205febae3a43b607c22ba7a
2021-12-10 23:54:52 +00:00
Colin Cross
4acaea9cbf Revert^2 "Build license metadata files in Soong"
b3264f2090

Change-Id: I5ea5f7e29eb1dbc72b8b30f010006a25f5f72fac
2021-12-10 23:05:02 +00:00
Colin Cross
67938c2925 Merge changes from topic "revert-1899703-AMWIVCREEV"
* changes:
  Revert "Build license metadata files in Soong"
  Revert "Add dependency license annotations"
2021-12-10 23:04:45 +00:00
Colin Cross
b3264f2090 Revert "Build license metadata files in Soong"
Revert submission 1899703

Reason for revert: b/210158272
Reverted Changes:
I142c19284:Reuse license metadata files from Soong
Ife89b8f23:Add dependency license annotations
I8e7410837:Build license metadata files in Soong

Change-Id: I48f2bf2e2797ac9d38f7ece35ba616b823035607
2021-12-10 23:02:57 +00:00
Colin Cross
2904cf5cfc Build license metadata files in Soong am: 3dd2ff28ed am: 05ff6289c2 am: a25d6989dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899702

Change-Id: I1f39f285d2472c610077cca8175da7c6bed73864
2021-12-10 22:42:21 +00:00
Colin Cross
988e14cc4b Escape Host*Variable contents am: 1c35f243c5 am: 72d35eb0a5 am: 1e3709131f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915494

Change-Id: If504de76766aad0e13eafee6342567ad39e22d55
2021-12-10 22:42:17 +00:00
Colin Cross
05ff6289c2 Build license metadata files in Soong am: 3dd2ff28ed
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1899702

Change-Id: I96620d254f43dd9e8cfe02d1ed1dbc201c9cd381
2021-12-10 22:04:43 +00:00
Colin Cross
72d35eb0a5 Escape Host*Variable contents am: 1c35f243c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915494

Change-Id: I78a98453a932c7cace65bfaf0c2d39a2469342e6
2021-12-10 22:04:40 +00:00
Colin Cross
b435744fdc Merge changes from topic "soong-license-metadata"
* changes:
  Add dependency license annotations
  Build license metadata files in Soong
  Escape Host*Variable contents
2021-12-10 21:43:49 +00:00
Inseob Kim
d788455703 Merge "Add BoardPlatVendorPolicy to soong config" am: fcaea66933 am: 8bc61f24aa am: 656ba20a64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1913480

Change-Id: I820344c7b60a61924324c64e8ac4169a44a0c779
2021-12-10 13:03:08 +00:00
Inseob Kim
fcaea66933 Merge "Add BoardPlatVendorPolicy to soong config" 2021-12-10 12:13:36 +00:00
Remi NGUYEN VAN
4f2a9cb427 Merge "Relax apex package restriction for T+ jars" am: 4d5cd1f267 am: b68677917b am: 5d704c695e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1908871

Change-Id: Ia865d38f8ac71ce208d1452e39ac0c222a982ce2
2021-12-10 01:03:20 +00:00
Remi NGUYEN VAN
4d5cd1f267 Merge "Relax apex package restriction for T+ jars" 2021-12-10 00:15:17 +00:00
Treehugger Robot
c7c251787c Merge "The type assertion of DefaultableModule as Module is redundant Test: m nothing Bug: n/a" am: 37dd05bbbe am: 1bc4f14604 am: d640edaf69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1914978

Change-Id: I3ffa0d2eb73f74ff7592a86dcf4b8f02288ce699
2021-12-09 21:39:40 +00:00
Treehugger Robot
37dd05bbbe Merge "The type assertion of DefaultableModule as Module is redundant Test: m nothing Bug: n/a" 2021-12-09 20:02:24 +00:00
Remi NGUYEN VAN
1fdd6ca88a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

Bug: 208773835
Test: m (runs apex tests)
Change-Id: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-09 18:28:47 +09:00
Colin Cross
0c631f19e9 Merge "Don't panic when DevicePrimaryArchType is called in a host only build" am: 9f5a9d1d54 am: 11f79516e2 am: 278415109a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1915495

Change-Id: I08b50779360189f4cd979369386a016c890345cd
2021-12-09 05:11:56 +00:00
Colin Cross
c53c37fad1 Don't panic when DevicePrimaryArchType is called in a host only build
Check the length of c.Targets[Android] before getting the first
element, and return Common if the length is set.  Fixes a panic
when a tradefed_binary is defined in a host-only build.

Test: aosp-build-tools build
Change-Id: I89f1dd13aa1aff5eb7d39e0b66eeedcb7d930fa0
2021-12-08 15:42:22 -08:00
Dan Willemsen
4d913d8528 Merge "Add Darwin x86_64+arm64 universal binary support" am: ce69757379 am: 1bd7543d6e am: b2a6b903fb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1884611

Change-Id: I106219bd0af5ba1ef0f8f96a71f3026d4b8eb07c
2021-12-08 23:38:45 +00:00
Colin Cross
3dd2ff28ed Build license metadata files in Soong
Soong has enough information to build the license metadata files
without resorting to the fixups required in Make.

Bug: 207445310
Test: m checkbuild
Change-Id: I8e74108376162b8fdb87ba098ebe94350aa1f7c4
2021-12-08 15:08:59 -08:00
Colin Cross
1c35f243c5 Escape Host*Variable contents
There are tests with "$" in the name, which becomes part of the
path.  Escape Host*Variable so that the path to a host binary
in a test doesn't get treated as a ninja variable.

Test: genrule_test.go
Change-Id: Ie50b13e94d8a30743c70b7f7c28bbab8afa73e5f
2021-12-08 15:08:59 -08:00
Usta
fe201fe158 The type assertion of DefaultableModule as Module is redundant
Test: m nothing
Bug: n/a

Change-Id: I5f7eea47a2f2bc81a0a5b9314e6a452c38226067
2021-12-08 18:03:23 -05:00
Dan Willemsen
ce69757379 Merge "Add Darwin x86_64+arm64 universal binary support" 2021-12-08 21:08:43 +00:00
Treehugger Robot
a0b46c1d06 Merge changes I08ec0b44,I79b5a1fc,I469d6558 am: 6abfb33784 am: 3bcefabfeb am: dc2accaba0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1907862

Change-Id: I189da72fe127e9717b2dc5e357f37263959d23a6
2021-12-08 18:45:10 +00:00
Treehugger Robot
6abfb33784 Merge changes I08ec0b44,I79b5a1fc,I469d6558
* changes:
  Allow java_sdk_library in an APEX to have higher min_sdk_version.
  Perform CheckMinSdkVersion for java_sdk_library.
  Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
2021-12-08 17:58:24 +00:00
Liz Kammer
cf392311e6 Merge "Propagate headers from bazel to mixed builds" am: 92d4188c2b am: 8534a37261 am: 5da0c42a09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1912212

Change-Id: I656710bf84a13af99b98712ee5934c5e21e8e5c2
2021-12-08 14:18:28 +00:00
Inseob Kim
1417880942 Add BoardPlatVendorPolicy to soong config
Bug: 205924657
Test: build
Change-Id: Ia0fe4fd916e539ee04aa0e8343068cc03bd9787c
2021-12-08 22:53:31 +09:00
Liz Kammer
92d4188c2b Merge "Propagate headers from bazel to mixed builds" 2021-12-08 13:24:08 +00:00
satayev
758968a700 Allow java_sdk_library in an APEX to have higher min_sdk_version.
Inidividual boot or system server jars may have higher min_sdk_version
than the contianing apex, since the runtime respects the values of
min/max_sdk_version; e.g. runtime would not load a boot jar with
higher min_sdk_version. This allows shipping new boot jars via apexes
that target older platforms.

Bug: 190818041
Test: presubmit
Change-Id: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
2021-12-08 11:36:34 +00:00
satayev
ad99149a62 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
2021-12-08 11:36:31 +00:00
Treehugger Robot
3b23e8bcb1 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" am: 939cb7b028 am: bf92b6d44e am: c028e47a3a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1852749

Change-Id: Iff32a1cdef6d911870a30200d4eca0382db7df8c
2021-12-08 06:58:12 +00:00
Treehugger Robot
939cb7b028 Merge "Add (obj|tidy)-*_os, and (obj|tidy)-*_subset targets" 2021-12-08 06:03:14 +00:00
Dan Willemsen
4745007bb1 Add Darwin x86_64+arm64 universal binary support
This is configured from Make by setting up Darwin+Arm64 as a HOST_CROSS
target (which is largely true, as binaries can't be executed on X86_64
machines). On the Soong side, it's a bit blurier, as we don't current
have any other users that are the same OS but not natively executable
(Linux/musl is executable, Windows/x86 is a different OS).

Instead of requiring cc_binary/etc to become multi-architecture-aware
and using something like common_first/MultiTarget, this defaults all
non-multi-architecture-aware modules to be built with both
architectures. It then adds a dependency with the
DarwinUniversalVariantTag so that supporting modules can get the outputs
of the other variant.

Cc uses that dependency tag to run lipo on shared libraries and binaries
so that the output of the x86_64 variant is actually a fat binary
including both architectures.

Bug: 203607969
Test: build sdk-repo targets on a Mac
Change-Id: Icbddb0a177c0ba19d3e0d11f8cf568e0d1ea3245
2021-12-07 22:01:25 -08:00
Martin Stjernholm
43c44b00d6 Do not allow duplicate deapexer dependencies.
Without these errors, the last encountered deapexer would silently be
used. However with PRODUCT_INSTALL_APEXES there will only be deapexer
for installable APEXes, and we can assume only a single installable
APEX exists for each APEX variant, so make it an error if it isn't the
case.

Corresponding to http://ag/15156931.

Test: m nothing SOONG_CONFIG_art_module_source_build=true
Test: m nothing SOONG_CONFIG_art_module_source_build=false
Test: m nothing SOONG_CONFIG_art_module_source_build=false
  with installable:true for the com.android.art.debug prebuilt APEX -
  check that it fails with an "ambiguous duplicate deapexer" error
Bug: 192006406
Bug: 192542393
Change-Id: I44566fd26b12f82a8a67fe4a69e56303460756d0
2021-12-07 23:30:30 +00:00