Commit Graph

6146 Commits

Author SHA1 Message Date
Sam Delmerico
489831660c convert java_import jars with arch variants
Bug: 220168131
Test: go test ./bp2build -run TestJavaImport
Test: b build '...'
Change-Id: Ib485e6905e7be9d199af5295b23131c226fd6e96
2022-03-31 21:00:24 +00:00
Bob Badour
43c2dcaef6 Build notice files from license metadata.
Switch from generate-notice-files.py and mergenotice.py to htmlnotice.

Bug: 151177513
Bug: 213388645
Bug: 210912771

Test: m droid dist reportmissinglicenses
Change-Id: I6cac049d24f35ec358c6f341a04f4ba6161703bf
2022-03-31 17:29:01 +00:00
Sam Delmerico
58614c0414 support errorprone javacflags
Soong has a separate property specifically for errorprone javacflags
that we need to add to the Bazel javacopts.

Test: go test ./bp2build
Change-Id: I5299f45793d2b05a6a71b94dd17ceb797f407846
2022-03-31 14:38:07 +00:00
Sam Delmerico
dc459dc9c1 Merge changes I8e4c3f37,I89a32bde am: 3c25ab1ac3 am: a2db166241 am: fd13aac77a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2032106

Change-Id: I320fc8b4385337497d684399e6f6b0c54084f8ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 22:07:11 +00:00
Treehugger Robot
5d123b15d9 Merge changes from topic "no-srcs-no-deps" am: d93afba1e6 am: d218781011 am: beb28cd9ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1995730

Change-Id: I8c8c7b973ffc6a6dfd91c35dc96e73c42bf30577
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-30 22:07:01 +00:00
Sam Delmerico
3c25ab1ac3 Merge changes I8e4c3f37,I89a32bde
* changes:
  add plugins to javaLibraryAttributes
  convert java_import_host with bp2build; enable jetifier
2022-03-30 21:08:12 +00:00
Treehugger Robot
d93afba1e6 Merge changes from topic "no-srcs-no-deps"
* changes:
  enable conversion of all java_import modules
  emulate java_library static_deps with Bazel exports
2022-03-30 21:06:46 +00:00
Sam Delmerico
77267c7d9c add plugins to javaLibraryAttributes
Test: go test ./bp2build
Change-Id: I8e4c3f373c62c60ea5013cd8c585915a366c1f81
2022-03-30 19:19:13 +00:00
Sam Delmerico
5f83b491b4 convert java_import_host with bp2build; enable jetifier
Also, add java_imports that were blocked by jetifier binary.
b/221082840 was blocking the build of jetifier which these java_imports
depended on. That bug is now resolved, so we can unblock these targets.

Bug: 220168131
Test: b build //packages/apps/Car/libs/car-ui-lib/car-ui-androidx/...
Test: build/bazel/ci/bp2build.sh
Change-Id: I89a32bde30c133a44aeb7826afa11d4140433f5d
2022-03-30 19:19:13 +00:00
Sam Delmerico
c016143602 emulate java_library static_deps with Bazel exports
In Soong, java_library can specify static_deps which are dependencies
that get aggregated into the final jar (akin to static linking). This is
useful because it allows dependencies higher up in the chain to compile
against the APIs exported by transitive dependencies. Bazel does not
support this functionality directly, but it can be emulated via the
exports attribute which makes any targets listed in the attribute public
to targets further up the chain.

Bug: 217236083
Bug: 219908977
Test: b build //external/error_prone:error_prone_core
Test: b build //external/bouncycastle:bouncycastle-host
Test: b build --platforms=//build/bazel/platforms:linux_x86
  //prebuilts/sdk/tools/jetifier/jetifier-standalone:jetifier
Change-Id: I2867e3f816de720a6f4bd9ff7a847d1b0c2da2d6
2022-03-30 18:58:38 +00:00
Colin Cross
cd811c0536 Merge "Use turbine instead of kapt for kotlin annotation processors" am: edd46702e1 am: 9ad80f6486 am: eed308db9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2030724

Change-Id: I2882ee4246da7ce663c92548dc0aef5b57f0c0da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 15:30:07 +00:00
Colin Cross
a8e2151a30 Merge "Don't use ziptime or --temp_dir for turbine" am: e311abcd44 am: 79e93d626a am: b420d23c16
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2030723

Change-Id: I1a2cc01787a5d3524755ca14a7ca46bd5d582c91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-28 19:23:05 +00:00
Colin Cross
f61766e987 Use turbine instead of kapt for kotlin annotation processors
Follow Bazel by using turbine instead of kapt to run annotation
processors.  This still requires using kapt to generate java stubs
of kotlin soruces, then uses turbine to run annotation processors
on the java stubs and any java sources to generate sources and
resources, and passes the annotation processor generated sources
to kotlinc and javac.

Bug: 225013372
Test: m checkbuild
Test: TestKapt
Change-Id: I9c6fc496a9fba64658bb062538bc5f7b9478b07a
2022-03-25 10:28:50 -07:00
Colin Cross
411647e8f4 Don't use ziptime or --temp_dir for turbine
Turbine sets dates to 2010 and doesn't need ziptime any more, and
ignores the --temp_dir flag.

Bug: 225013372
Test: m checkbuild
Change-Id: I6122f27d873ca671050e4dc0d65641bb52e90e99
2022-03-25 10:26:47 -07:00
Spandan Das
a1ec6ead90 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217 am: ad40fffa64 am: 3dd2985871 am: db71cd071c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977412

Change-Id: Ibbbeaaffb3a8baad67f50699d10a499155c3fd88
2022-03-24 17:59:24 +00:00
Spandan Das
ad40fffa64 Merge changes I4c373b29,I9ccda6fc,I1b390b0e,I30151217
* changes:
  Do not propagate strict updatability linting to libcore/
  Create allowlist to skip strict updatability lint check
  Propagate strict_updatability_linting to transitive deps of updatable apexes
  Export LintDepSetsIntf from java package
2022-03-24 16:38:20 +00:00
Colin Cross
2b6b13accf Merge "Collect deps from r8" am: 057beb2146 am: c20adfad25 am: 9c495b2617
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2034623

Change-Id: I20fdfa8e7000cf44bab7803d151044f2028dfb41
2022-03-22 17:42:51 +00:00
Colin Cross
057beb2146 Merge "Collect deps from r8" 2022-03-22 16:40:30 +00:00
Colin Cross
22e6a6f69a Collect deps from r8
Use the new --deps-file argument to collect a deps file from r8, which
will correctly track files included by proguard flags files.

Fixes: 221956283
Test: manual
Change-Id: I92341948311c2c994cc0ae032dc19e09b2e80550
2022-03-22 16:40:13 +00:00
Treehugger Robot
2edfe874e5 Merge "Prevent kotlinc from reading /tmp/build.txt" am: c4ad11ec28 am: ee5858c4c9 am: 4b85795a3b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2030984

Change-Id: Ie3a2c512f2977b54370cb7ec8be0a4ff9f29f5f0
2022-03-22 08:23:48 +00:00
Treehugger Robot
c4ad11ec28 Merge "Prevent kotlinc from reading /tmp/build.txt" 2022-03-22 07:28:05 +00:00
Treehugger Robot
376b1e81ff Merge "Revert "225341614: Enforce ExtraText in platform builds"" am: bc1217b4e7 am: 52b82e0eb1 am: 3da7775103
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2034523

Change-Id: Ie5c9df34daa8c82e874e8da7f6369450d3eda02d
2022-03-21 22:30:04 +00:00
Treehugger Robot
bc1217b4e7 Merge "Revert "225341614: Enforce ExtraText in platform builds"" 2022-03-21 21:40:12 +00:00
Treehugger Robot
f5a3a154db Merge "Don't pass static libs to r8" am: 2f39f7dacd am: da8a4b71bf am: 9db29d32db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2030983

Change-Id: Ib718defcb6cbf745d1fbec348823485031b45f5b
2022-03-21 20:19:38 +00:00
Tor Norbye
3544626c2f Merge "225341614: Enforce ExtraText in platform builds" am: 6014299148 am: 1f2b3a1ae8 am: 379af1cd38
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2033404

Change-Id: I2581f5282f68b748ba20bfa57343ece56e48a350
2022-03-21 19:35:44 +00:00
Treehugger Robot
2f39f7dacd Merge "Don't pass static libs to r8" 2022-03-21 19:21:02 +00:00
Tor Norbye
73dca5c905 Revert "225341614: Enforce ExtraText in platform builds"
This reverts commit 4c471458ec.

Reason for revert: There were failures in some build targets that
must not have run during presubmit checks (for example,
aosp-master/errorprone@8332220)

Change-Id: I220fd70df663ba49d876fb3ebf841fa9f3f06b97
2022-03-21 18:56:14 +00:00
Tor Norbye
4c471458ec 225341614: Enforce ExtraText in platform builds
Bug: 225341614
Test: N/A
Change-Id: Ic2ed5006643f3646315f16fe77552398f38c0265
2022-03-21 08:12:25 -07:00
Colin Cross
c2d504873f Prevent kotlinc from reading /tmp/build.txt
Pass -Didea.plugins.compatible.build=999.SNAPSHOT to kotlinc and kapt
to prevent it from reading /tmp/build.txt and failing with an obscure
exception:
exception: java.lang.ExceptionInInitializerError
	at com.intellij.openapi.util.BuildNumber.currentVersion(BuildNumber.java:297)
...

Bug: 222162908
Test: m metalava with /tmp/build.txt present
Change-Id: I5faced4a2e94561ce3aa37bfaacf5bd7d988a4f0
2022-03-18 20:48:51 +00:00
Colin Cross
9bb9bfb349 Don't pass static libs to r8
r8 gets the static libs in the program jar, it shouldn't also get
them as library jars.  Keep a separate classpath for dexing that
includes libs but not static_libs.

Bug: 222468116
Test: m checkbuild
Test: TestD8
Test: TestR8
Change-Id: Icca3393f496cbcadcc633f3b156761e6c145f975
2022-03-18 20:48:27 +00:00
Paul Duffin
e3b56cb45f Merge "Make bootclasspath_fragment hidden API package checks exhaustive" am: 2cb89166df am: bbf4ec6965 am: 50ed6e64a5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2028212

Change-Id: I125679a87a40deedc1f5435b8459bf8c8d96a419
2022-03-18 19:30:46 +00:00
Paul Duffin
2cb89166df Merge "Make bootclasspath_fragment hidden API package checks exhaustive" 2022-03-18 18:42:37 +00:00
Nicolas Geoffray
c219c50030 Merge "Pass --preloaded-classes to boot image compilation." am: 1a9df2604c am: d06a2b083e am: feb00d5550
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2024665

Change-Id: I105fcb8757171c12ecb32879a41b9849bb2b3360
2022-03-18 14:24:25 +00:00
Nicolas Geoffray
1a9df2604c Merge "Pass --preloaded-classes to boot image compilation." 2022-03-18 13:41:59 +00:00
Paul Duffin
846beb7f54 Make bootclasspath_fragment hidden API package checks exhaustive
Previously, the bootclasspath_fragment's hidden_api.split_packages and
hidden_api.package_prefixes properties did not specify an exhaustive
set of packages that were provided by the fragment. They excluded
packages which were either not split or which could not be used as a
package prefix because it would match sub-packages provided by other
bootclasspath modules.

This change adds the hidden_api.single_packages list to specify those
additional packages and then uses that information to verify that any
bootclasspath_fragment that specifies at least one of split_packages,
single_packages or package_prefixes properties only contains classes
from a package that matches one of those properties. That will
prevent a module from accidentally including unexpected classes, such
as might happen when statically including a common utility library.

It also adds coverage specific versions of the properties as additional
packages are added to the art-bootclasspath-fragment when building
coverage builds.

Bug: 194063708
Test: atest signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true out/soong/hiddenapi/hiddenapi-flags.csv
      # Breaks without corresponding change to add android.system to
      # the art-bootclasspath-fragment.
      /usr/bin/pylint --rcfile $ANDROID_BUILD_TOP/tools/repohooks/tools/pylintrc scripts/hiddenapi/signature_patterns*.py
      pyformat -s 4 --force_quote_type single -i scripts/hiddenapi/signature_patterns*.py
Change-Id: Iddf6c59cd4dc8c36dde7943a9840ccef5794b320
2022-03-18 10:54:51 +00:00
Colin Cross
5a2ccb5914 Merge "Export the license metadata files for dexpreopted bootjars to Make" am: 143b8d4eb1 am: dbd09f2192 am: 3401e518a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2026929

Change-Id: I07050fd64e4b7f408a87a8effeeab3bd83a49508
2022-03-17 03:50:38 +00:00
Colin Cross
143b8d4eb1 Merge "Export the license metadata files for dexpreopted bootjars to Make" 2022-03-17 01:48:47 +00:00
Patrick Rohr
f6337e86f7 Merge "Remove ethernet-service jar dependency." 2022-03-16 16:03:30 +00:00
Colin Cross
e7fe0962f4 Export the license metadata files for dexpreopted bootjars to Make
Track the license metadata file of the module used to dexpreopt
bootjars and pass it to Make.

Bug: 224612665
Test: m alllicensemetadata reportmissinglicenses
Change-Id: I8466c3d8edf7dc44976c2a343bd38799c6617db2
2022-03-15 19:56:45 -07:00
Xiao Ma
488ecd2999 Remove ethernet-service jar dependency.
ethernet service source code is going to be moved into Connectivity
mainline module, and start the ethernet service from the module. The
old ethernet-service lib will be deprecated, remove it from soong
build rule.

Bug: 210586283
Test: m
Change-Id: I8de35246dabba8eb2dda3a154436e43fe19cf384
Merged-In: I19697d13f3809d91c83e37c6d0d403e79eb28664
2022-03-16 00:52:40 +00:00
Nicolas Geoffray
b9a46fb624 Pass --preloaded-classes to boot image compilation.
Test: m
Bug: 162110941
Change-Id: I0df016c5d170ca101cd18cacc331499ae76677a6
2022-03-15 14:28:38 +00:00
Xiao Ma
855222e389 Remove ethernet-service jar dependency.
ethernet service source code is going to be moved into Connectivity
mainline module, and start the ethernet service from the module. The
old ethernet-service lib will be deprecated, remove it from soong
build rule.

Bug: 210586283
Test: m
Change-Id: I19697d13f3809d91c83e37c6d0d403e79eb28664
2022-03-15 21:52:26 +09:00
Treehugger Robot
2c326eedd9 Merge "bp2build supports arch variant srcs for java_library" am: 7db79508c7 am: 2f624bc824 am: 4dc497f88e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1989486

Change-Id: I59d9d933590cc2c7d1fe83af5b83a48d9c2c47be
2022-03-14 18:22:55 +00:00
Treehugger Robot
7db79508c7 Merge "bp2build supports arch variant srcs for java_library" 2022-03-14 17:06:01 +00:00
Treehugger Robot
df3e81e702 Merge "Suppress ChangedDefault (in another location)" am: 1571419fab am: 23a4c2b1f4 am: 1c708af98e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2018296

Change-Id: Idbbbd339d0ffcaefd1d267bb9acb3a51196e2c49
2022-03-09 23:03:23 +00:00
Sam Gilbert
28e41289fb Suppress ChangedDefault (in another location)
Change-Id: I71fe558bd379818e254bb031a6a8dc855bb8235d
Test: N/A
Bug: 223382732
2022-03-09 17:01:29 +00:00
Treehugger Robot
92edbe38e8 Merge "Disable ChangedDefault" am: 4a5110f046 am: 61ebc18fd5 am: 4932817776
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2015695

Change-Id: I9afca3fb46a41003aa193bc3bf470fd7218bbd8e
2022-03-09 10:49:30 +00:00
Romain Jobredeaux
c9f48bbcd7 Merge "Add source extension information for java_*/android_* modules in module-graph.json." am: d9eba6611f am: 55b5ac1221 am: 1c1e60ef18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1875414

Change-Id: Iedc1f0ac6439d2ab37d92b096eb1129994df73f7
2022-03-09 10:48:46 +00:00
Paul Duffin
f9c70add3b Merge "List bootclasspath_fragments in module-info.json" am: d94e4f5554 am: efa9bd7422 am: 1482bcdc7c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2007227

Change-Id: I4095dcb27137b70090a23214cfdc2242df1cecb9
2022-03-09 10:48:28 +00:00
Sam Gilbert
675f0b41be Disable ChangedDefault
Bug: 223382732
Test: N/A
Change-Id: I45b70824650544b465fa656cb09983bf90f923b6
2022-03-08 11:24:44 -05:00