Commit graph

5728 commits

Author SHA1 Message Date
Isaac Chiou
c7bb9d47d6 Merge "Revert "Use kapt stubs for kotlin header jar for javac"" 2022-04-06 08:25:29 +00:00
Isaac Chiou
a23d994022 Revert "Use kapt stubs for kotlin header jar for javac"
This reverts commit c6ef485370.

Reason for revert: Multiple systemui presubmits are broken due to this change

Bug: 228262695
Change-Id: I1efed519c49d8d0583815c7bf2b3801bf0ba12fa
2022-04-06 07:04:09 +00:00
Wei Li
c055d88c16 Merge "Export provenance metadata for prebuilt APKs and APEXes." 2022-04-06 04:03:41 +00:00
Colin Cross
40f8c75752 Merge "Use kapt stubs for kotlin header jar for javac" 2022-04-05 23:59:34 +00:00
Colin Cross
bbf5f8c158 Merge "Enable turbine for api generating annotation processors when using kotlin" 2022-04-05 23:48:12 +00:00
Colin Cross
93d65fb60d Merge "Enable kotlin's jvm-abi-gen plugin to generate header jars" 2022-04-05 23:32:54 +00:00
Wei Li
340ee8e699 Export provenance metadata for prebuilt APKs and APEXes.
Bug: 217434690
Test: atest --host gen_provenance_metadata_test
Test: m provenance_metadata

Change-Id: I91c184b6e6fe5ccfc3fc65b55b09e7a3da9502a0
2022-04-05 16:16:16 -07:00
Colin Cross
209844ce1c Merge "Enable restat for sbox rules" 2022-04-05 22:49:10 +00:00
Treehugger Robot
ef03b3d8ba Merge "support errorprone javacflags" 2022-04-05 17:46:08 +00:00
Anton Hansson
71cf2a3cc6 Merge "Remove apex framework jars from hard-coded list" 2022-04-05 11:46:04 +00:00
Anton Hansson
51bbac2137 Remove apex framework jars from hard-coded list
All apex jars get auto-instrumented since
I2b1c0736202de26c5ea88c0ab14574bd7207a5fb

Test: $ EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m nothing && \
      $ grep LOCAL_MODULE.*framework-sdkextensions.com.android.sdkext$ \
            out/soong/Android-aosp_coral.mk  -A9 -B2 | grep JACO
Change-Id: I1de5ba6673bef93b16c302412f920d93129d4420
2022-04-05 09:00:57 +00:00
Treehugger Robot
5f58c378b6 Merge "Keep dependency files out of the apk file." 2022-04-05 05:53:22 +00:00
Bob Badour
2c8888edef Keep dependency files out of the apk file.
Bug: 227682036

Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97

Change-Id: I1a9775af7c652191bb1ce3b97c1cb9365b469c19
2022-04-04 19:21:18 -07:00
Colin Cross
c6ef485370 Use kapt stubs for kotlin header jar for javac
When compling kotlin code with annotation processors we are generating
java stubs for the kotlin sources using kapt, and parsing them in
turbine when running the annotation processors.  Passing --output
to turbine will also compile the stubs into a header jar that can
be used as a dependency to javac, allowing the javac and kotlinc
rules to run in parallel.  The turbine-apt header jar can't be used
as the header jar for downstream modules as it doesn't contain the
kotlin metadata needed by kotlinc rules, so the kotlinc gen-jvm-abi
plugin output is still used for the module's final header jar.

Test: TestKapt
Bug: 222095735
Change-Id: I82d0900f3dc30f3e3ebd7cab0693dfe741d9b955
2022-04-04 16:42:46 -07:00
Colin Cross
b5db401599 Enable turbine for api generating annotation processors when using kotlin
Normally turbine is disabled when an api generating annotation processor
is in use because the annotation processors are run in javac, so any
generated api would not be present in the turbine header jar.  When
compiling with kotlin and annotation processors, the annotation processors
(including any that generate api) are run in an extra turbine invocation
to generate sources to make the results visible to kotlinc, and so can
also be compiled by the normal turbine invocation.  Force turbine enabled
when kotlin sources are present.

Test: m SystemUI
Bug: 222095735
Change-Id: I5fcfe67e46cb4a4e90388f088327488959b6571f
2022-04-04 16:42:46 -07:00
Colin Cross
220a9a1245 Enable kotlin's jvm-abi-gen plugin to generate header jars
Kotlin's jvm-abi-gen plugin can generate header jars similar to the
turbine output for java sources, which can be used to avoid recompiling
downstream modules when the ABI hasn't changed.  Unlike turbine, the
plugin runs as part of the main kotlinc invocation, so it doesn't allow
the downstream modules to start compiling any sooner.

A future possible optimization is to use turbine to compile the kapt
stubs, at least for the  kotlin+annotation processor modules that already
generate them, which would allow compiling downstream modules before
invoking kotlinc or javac, as well as invoking kotlinc and javac in
parallel with each other.

Bug: 222095735
Test: TestKotlin
Test: m SystemUI
Change-Id: Ib1bb2ecea47c851a108a26f9ed4f827f289d1321
2022-04-04 16:42:46 -07:00
Colin Cross
e52c2ac7fb Enable restat for sbox rules
Add support to sbox for only writing output files if they are changed
to support enabling restat.  Move the clearing of the output directory
into sbox, and when write if changed is enabled delete obsolete output
files without deleting output files that will be replaced.

Enable restat for local metalava rules.  Restat for metalava rules
run remotely is still blocked on b/183630617.

Bug: 222095735
Test: TestRuleBuilder_Build
Test: m SystemUI
Change-Id: If8fc47e711f4a6f43947ab69f17cccc8ba6ae61a
2022-04-04 16:42:46 -07:00
Treehugger Robot
7a45d37e62 Merge "convert java_import jars with arch variants" 2022-04-04 16:06:55 +00:00
Bob Badour
3aae38d451 Merge "Revert "Revert "Build notice files from license metadata.""" 2022-04-02 00:43:34 +00:00
Bob Badour
de6a087d2d Revert "Revert "Build notice files from license metadata.""
This reverts commit 77807b3c27.

Reason for revert: fix and roll forward again

Change-Id: I80c796ca81ecf29df9522babe54d684a0d11b9e6
2022-04-01 18:00:00 +00:00
Ember Rose
1d3b79f78f Merge "Rename InvalidNullabilityOverride suppression" 2022-04-01 17:53:00 +00:00
Ember Rose
7c57af39e5 Rename InvalidNullabilityOverride suppression
Test: N/A
Bug: 227661934
Change-Id: I26fcb5b7de58e8c982054a5a54e3526e0b8be2a2
2022-04-01 10:38:54 -04:00
Wei Sheng Shih
77807b3c27 Revert "Build notice files from license metadata."
This reverts commit 43c2dcaef6.

Reason for revert: suspect build break

Bug: 227682036

Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97


Change-Id: Ibfb8b4fefc264f52f32ba661c269a9cd625d800a
2022-04-01 14:10:53 +00:00
Bob Badour
2a5c090c31 Fix breakage: bad path join using '/' literal
Typo in filename s/b NOTICE.html.gz not NOTICES.html.gz

Bug: 227682036

Test: TARGET_BUILD_VARIANT=userdebug UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_bundles.sh -j97

Change-Id: I75cc28e3ef22d975ad46f4e167071f6d82ba253d
2022-03-31 23:40:28 -07:00
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
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
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
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
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
c4ad11ec28 Merge "Prevent kotlinc from reading /tmp/build.txt" 2022-03-22 07:28:05 +00:00
Treehugger Robot
bc1217b4e7 Merge "Revert "225341614: Enforce ExtraText in platform builds"" 2022-03-21 21:40:12 +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
2cb89166df Merge "Make bootclasspath_fragment hidden API package checks exhaustive" 2022-03-18 18:42:37 +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
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