Commit Graph

3463 Commits

Author SHA1 Message Date
Treehugger Robot
66a854d585 Merge "Add LOCAL_LICENSE_KINDS to build/soong" am: b68036f44b am: 0a1087f291
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575543

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I17bbc2d510465587580cf26e55e4f65a952e198c
2021-02-10 08:30:03 +00:00
Treehugger Robot
b68036f44b Merge "Add LOCAL_LICENSE_KINDS to build/soong" 2021-02-10 07:18:29 +00:00
Bob Badour
1ceaa1295c Merge "Allow cross-cutting dependencies like licenses." am: a3348295d4 am: c54c5770db
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1579112

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I684cfc27181c698d877be341c735cfe922b24357
2021-02-10 03:42:45 +00:00
Bob Badour
a3348295d4 Merge "Allow cross-cutting dependencies like licenses." 2021-02-10 02:46:40 +00:00
Treehugger Robot
ed2d9815c4 Merge "Add android_test_helper_app properties to java_defaults" am: a6cfcac727 am: 747e441f33
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1579791

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I50300bd49812dc509855e9343f93a3f4003f570c
2021-02-09 22:49:31 +00:00
Treehugger Robot
a6cfcac727 Merge "Add android_test_helper_app properties to java_defaults" 2021-02-09 21:10:27 +00:00
Colin Cross
cbce0b0dbd Add android_test_helper_app properties to java_defaults
Allows android_test_helper_apps to get their test_suites and
auto_gen_config properties from a java_defaults module.

Fixes: 179744452
Test: m checkbuild
Change-Id: Ifa09f9fd0a51d3a9682401e4c6bd2f82cd4f1b8a
2021-02-09 10:38:30 -08:00
Paul Duffin
2f48726a64 Merge "Move hiddenapi tools used by build/soong from frameworks/base" am: 937c91c406 am: d1f586407c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1579437

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4dd3d3c573eca04f6b8dcf92b18d73e019f1b46c
2021-02-09 16:48:45 +00:00
Paul Duffin
b6256e51cb Merge "Allow dex jars from prebuilt_apex to be used by hiddenapi" am: 320e170675 am: 915cb8c6d8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1578285

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic96272d781806b7afb5b4afb2e81130ac131b43d
2021-02-09 15:18:20 +00:00
Paul Duffin
061c4657d7 Merge "Refactor the hiddenAPI() method for reusability" am: b71a8de0d5 am: 714a66dfdd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1578284

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I09df412275fbfaa1ac67a36d5fc3f6b4b5ba0418
2021-02-09 15:18:14 +00:00
Paul Duffin
fd7610df22 Merge "Extract initHiddenAPI() from hiddenapi()" am: abe1abd224 am: 36d3011783
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1578283

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I75aeebfbfc844b45bc99b3c395b82e7c148e4a5b
2021-02-09 15:18:08 +00:00
Paul Duffin
937c91c406 Merge "Move hiddenapi tools used by build/soong from frameworks/base" 2021-02-09 15:17:42 +00:00
Paul Duffin
320e170675 Merge "Allow dex jars from prebuilt_apex to be used by hiddenapi" 2021-02-09 13:58:12 +00:00
Paul Duffin
b71a8de0d5 Merge "Refactor the hiddenAPI() method for reusability" 2021-02-09 13:57:52 +00:00
Paul Duffin
abe1abd224 Merge "Extract initHiddenAPI() from hiddenapi()" 2021-02-09 13:57:37 +00:00
Paul Duffin
fdada68320 Move hiddenapi tools used by build/soong from frameworks/base
Also, creates a python_binary_host module for generate_hiddenapi_lists
and uses that when constructing the build rule rather than using the
file directly.

Bug: 177317659
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: Ia11bb203ce5a74740d35f1b7e86716e15aad336e
2021-02-09 10:46:36 +00:00
Treehugger Robot
5e33cdde3c Merge "Turn missing jarjar output files into errors" am: ed7bfd9726 am: 5df2206de0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1580883

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I73c739173cf091fb83a65f93ff91a25eb17223fc
2021-02-09 01:22:01 +00:00
Treehugger Robot
ed7bfd9726 Merge "Turn missing jarjar output files into errors" 2021-02-08 23:47:13 +00:00
Bill Peckham
6603b7ab73 Merge "Enable android_app_import to supply framework-res." am: 5c2406bde9 am: 50b395b740
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1543901

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia87c7583798ab5c053a154dd8d67b579dd65d8e7
2021-02-08 20:19:59 +00:00
Treehugger Robot
98812a68a5 Merge "Remove duplicate entries from hiddenapi files" am: c6fcf29872 am: d32e59bb54
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575170

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If31c8c3b53942a9880266fe3623ee7cff6cb7703
2021-02-08 19:19:03 +00:00
Bill Peckham
5c2406bde9 Merge "Enable android_app_import to supply framework-res." 2021-02-08 19:15:10 +00:00
Paul Duffin
9d67ca6ab7 Allow dex jars from prebuilt_apex to be used by hiddenapi
Invokes hiddenAPIExtractInformation() on the dex jar provided by the
deapexer (on behalf of prebuilt_apex) so that hiddenAPI can extract the
information it needs, if anything, from the dex file (and accompanying
classes implementation file).

The dex file provided by deapexer has already had the hiddenapi
information encoded into it so it does not need to do that again.

This change adds the primary parameter to hiddenAPIExtractInformation()
and checks it (and also the hiddenAPI.active property) before it does
anything. That ensures that it behaves correctly when called directly
as well as when called from hiddenAPIExtractAndEncode().

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
      Also verified that the hiddenapi files created when using the
      prebuilts (using SOONG_CONFIG_art_module_source_build=false) are
      the same as when using the source. There is a slight difference
      in the order but otherwise identical.
Change-Id: I7abb63fd310bb94787ab7f4821e5fd283dc03046
2021-02-08 19:10:50 +00:00
Paul Duffin
4fd997bc13 Refactor the hiddenAPI() method for reusability
A follow up change needs to be able to contribute to the information
the hiddenapi process collates without having a dex file encoded. This
change pushes all the functionality related to information gathering
into the hiddenAPIGenerateCSV() method and then renames it and the
hiddenAPI() method to make it clearer what they do.

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: I04417720216a0fbadcd88e6185e7de6570af6216
2021-02-08 19:10:50 +00:00
Paul Duffin
4103e92c4b Extract initHiddenAPI() from hiddenapi()
Previously, the hiddenapi() method combined both checks to determine
whether a module contributed to/was modified by the hiddenapi process
and logic to create ninja rules to perform those tasks. This change
separates the former out into a new initHiddenAPI() method.

The main purpose of this is to simplify the process of allowing the
CSV generation to be separated from the encoding. That is required
because when a java_import retrieves its dex file from the apex it
has already been encoded.

The initHiddenAPI() method is only called for java.Library (and
indirectly for java.SdkLibrary) and java.Import modules which means
that the hiddenapi() method does nothing for any other module type.
That is consistent with the previous behaviour because while the
hiddenapi() method is called for other module types they fail because
the boot image jars only support java_library, java_sdk_library,
and java_import at the moment. While it will need to support
java_sdk_library_import once any of the libraries that are currently
provided as java_sdk_library modules switches to providing prebuilts
that is outside the scope of this work.

Bug: 178361284
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: Iaa91e0a8e2bffec03296dd894e9662556f4464c0
2021-02-08 19:10:50 +00:00
Colin Cross
d97cf63cdf Turn missing jarjar output files into errors
Jarjar doesn't exit with a nonzero return code when there is a syntax
error in a rules file and doesn't write the output file.  Without a
nonzero return code ninja prints a warning but continues, which leads
to stale results on incremental builds where the output file already
exists, or delayed errors on clean builds whre the output file didn't
exist.

Delete the output file before running jarjar, and then check if it
exists after running jarjar.

Fixes: 119516143
Test: m out/target/common/obj/APPS/TeleService_intermediates/classes.jar
Change-Id: I7e9f7ff34de565a986ab0dc6e375f606c91c3846
2021-02-08 10:14:04 -08:00
Paul Duffin
2229b27740 Add test for hiddenAPI index file generation am: 01289a2407 am: e510de2f58
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1575169

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7aa50863bc76dfb8f9a790b824da7fcc087626c9
2021-02-08 12:59:16 +00:00
Paul Duffin
fbd6af6226 Merge changes I9e94662d,I4b4e0dc8 am: 254aee4843 am: 3c4acc4279
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574746

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4321f7fb64832e85399a20bea30a5a07ca6e93eb
2021-02-07 15:29:20 +00:00
Paul Duffin
219b177279 Remove duplicate entries from hiddenapi files
Prevents the hiddenapi files index and metadata files from including
duplicate entries.

Bug: 178361284
Test: m droid
      Compared hiddenapi files before and after change
      Verified that the only differences were due to the removal of duplicates
      Used sort -u to remove duplicates from before file and compared with after file
Change-Id: I0b9e420aec42cdcf4584099a7ffd2ed9c3715d6d
2021-02-07 10:58:24 +00:00
Paul Duffin
01289a2407 Add test for hiddenAPI index file generation
The index file and the metadata file both currently include duplicate
entries due to them including both the <x> and <x>.impl libraries
created by java_sdk_library in their inputs, plus including both source
and prebuilt versions of the same named module. This change adds a test
to illustrate that behavior. A follow up change will correct the problem
and update the test accordingly.

This change only adds a test for the index file because the metadata
file depends on files from frameworks/base which makes it difficult to
test. Bug 177317659 will fix that and allow the metadata file
generation to be tested too.

Bug: 178361284
Test: m nothing
Change-Id: I33921d7267c9f4bb42726343d73f8a396d536aaa
2021-02-07 10:58:24 +00:00
Paul Duffin
254aee4843 Merge changes I9e94662d,I4b4e0dc8
* changes:
  Export implementation class jars for java_boot_libs
  Improve module filtering in hiddenapi stubFlagsRule()
2021-02-07 10:52:01 +00:00
Bob Badour
02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00
Bob Badour
07065cd360 Allow cross-cutting dependencies like licenses.
Test: m all

Bug: 171227245
Bug: 151953481
Bug: 151177513
Bug: 67772237
Change-Id: I6e8ce01898e174a9587469157485debbb7b96980
2021-02-05 19:59:11 -08:00
Bill Peckham
a036da9b27 Enable android_app_import to supply framework-res.
By enabling an android_app_import module to supply the
special framework-res module, it becomes possible to
create a split build that excludes the source of over
10,000 files under frameworks/base/core/res, replacing
this source with a prebuilt. However, since other parts
of a monolithic build use the source of framework-res,
this scheme works only if your split build manifest
excludes modules that depend on framework-res source.

Bug: 176851898
Test: lunch aosp_arm64-userdebug && m nothing
Test: new TestAndroidAppImportExportPackageResources
Test: local build without prebuilt framework-res
Test: local build with prebuilt framework-res
Change-Id: If00d9dbc656c8406c038448d09f93f767c1e06d1
2021-02-05 14:30:46 -08:00
Liz Kammer
595abf120a Merge "bp2build: convert paths/module refs to Bazel label" am: b7eab01167 am: 6d5454d0f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1564272

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I850a7a72980cd003afbb696ff0ae1beba110995a
2021-02-05 15:00:27 +00:00
Liz Kammer
b7eab01167 Merge "bp2build: convert paths/module refs to Bazel label" 2021-02-05 13:39:08 +00:00
Paul Duffin
22ff0aaf51 Export implementation class jars for java_boot_libs
Hiddenapi processing currently requires access to the class
implementation jars for libraries on the bootclasspath which means that
they need to be provided as part of the prebuilts. This change modifies
the java_boot_libs property on the sdk to make those files available.

Modularization of the hiddenapi processing will hopefully remove the
need for these to be exported so this should be temporary.

Bug: 178361284
Test: m art-module-sdk
      check generated snapshot zip contains implementation jars
Change-Id: I9e94662dddb0ddb85a477ae6d27e533085147e88
2021-02-05 13:35:25 +00:00
Paul Duffin
dd63d6d7bd Improve module filtering in hiddenapi stubFlagsRule()
Previously, it ignored any module that was not a platform apex variant
however that required every module that was referenced from the boot
jars to have a platform variant which is not the case when building
from prebuilts.

This change switches it to explicitly check that the variant is for
either the appropriate apex or the platform depending on what is
configured in the BootJars or UpdatableBootJars.

It partially duplicates some logic from the getBootImageJar() function.
It intentionally does not refactor the getBootImageJar() to allow for
reuse because coupling the hiddenapi and dexpreopt logic would make
refactoring either of them more difficult. Any duplicated code will be
deduped once they have both been refactored.

Bug: 178361284
Test: m droid
Change-Id: I4b4e0dc8ee40c1ba1713d7ef72df13d175e84af6
2021-02-05 13:33:25 +00:00
Ulyana Trafimovich
8c723918ee Merge "Don't write nonexistent DEX file paths to dexpreopt.config files." am: 9b91082452 am: 1fdefc2c57
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574745

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9f39d40678f0d818403c2ab2c6d015e34860e928
2021-02-05 12:24:15 +00:00
Ulyana Trafimovich
9b91082452 Merge "Don't write nonexistent DEX file paths to dexpreopt.config files." 2021-02-05 11:10:03 +00:00
Paul Duffin
b00bde6fb0 Merge "Detect empty apex in ConfiguredJarList" am: b8887127ba am: 6664c04ce9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574743

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I42edc356e4a6cc4ec548c36a023a4fee6d5d94dd
2021-02-05 10:50:07 +00:00
Paul Duffin
b8887127ba Merge "Detect empty apex in ConfiguredJarList" 2021-02-05 09:30:15 +00:00
Treehugger Robot
ef8d0e264a Merge "data dependency of java_test_host can be arch-specific" am: f860a2ab66 am: 685daa0dd9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1574806

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib39fd01d7c7f0a3360d71262e9d9819fca576090
2021-02-05 05:01:57 +00:00
Liz Kammer
356f7d45c1 bp2build: convert paths/module refs to Bazel label
This currently expands all globs, still need to support converting glob
syntax.

Test: go build_conversion_test
Test: GENERATE_BAZEL_FILES=true m nothing
Test: m nothing
Bug: 165114590
Change-Id: If7b26e8e663d17566fad9614ca87a8da1f095284
2021-02-04 13:45:56 -05:00
Jiyong Park
cdd9b8392d data dependency of java_test_host can be arch-specific
This allows java_test_host to have arch-specific data files. Currently,
VirtualizationHostTestCases needs this to have arch-specific kernels as
its data.

Bug: N/A
Test: m VirtualizationHostTestCases
Change-Id: Ib5680ef48b613955ad92c9bc212184ac75900d3e
2021-02-05 00:29:47 +09:00
Ulya Trafimovich
c0f64799da Don't write nonexistent DEX file paths to dexpreopt.config files.
A path to an nonexistent file caused dex2oat to write an empty path in
the class loader context stored inside of the OAT/ODEX file, which
resulted in class loader context mistmatch and a failure to load
dexpreopt code on device.

An example of a faulty class loader context for GoogleDialer, can be
seen either with oatdump or by grepping logcat for class loader context
mimatch messages (the first empty PCL[] is expected, note the second
empty PCL[] in the subcontext for shared libraries):

  PCL[]{PCL[]#PCL[/system/framework/org.apache.http.legacy.jar*22205474]

This CL removes the nonexistent path from the generated dexpreopt.config
file, which works in conjunction with a change in makefiles that stops
using the removed config field. This is possible because makefiles can
access DEX files using a module name and "intermediates-dir-for" macro.

Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
      adb wait-for-device && adb root && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
      # empty grep output, no errors
Change-Id: I8d16f77c6f76ad6234cc4114ad3545cbe572ef13
2021-02-04 12:14:51 +00:00
Paul Duffin
9c3ac96f1f Detect empty apex in ConfiguredJarList
Previously, ConfiguredJarList would accept an empty apex name,
e.g. ":jar" which makes no sense as every apex has to have a non-empty
name. This change makes an empty apex invalid.

In order to improve the test coverage of the TestConfiguredJarList test
this change also changes the implementation of
CreateTestConfiguredJarList([]string) to marshal the supplied strings
into a json list and then unmarshal into a ConfiguredJarList which more
closely matches how it is used at runtime.

Bug: 178361284
Test: m nothing
Change-Id: I7dfec6b4cc1923aa99746e976da0393922ef0791
2021-02-04 10:07:41 +00:00
Paul Duffin
f553a9f40d Merge "Switch hiddenapi to use OutputPath instead of ModuleOutPath" am: e1f9b35d92 am: 5a648cf0df
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1571202

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9a1e1890545da1fd16918831567f22f03e73cf65
2021-02-03 11:10:01 +00:00
Paul Duffin
e1f9b35d92 Merge "Switch hiddenapi to use OutputPath instead of ModuleOutPath" 2021-02-03 10:02:36 +00:00
Tobias Thierer
dec7caec15 Merge "go/Android.bp: Clarify sdk_version documentation." am: dadc62cdb4 am: 922e7f941a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1518598

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie46c8ea7ea179f2e87fe6f1a6741c0035cb87766
2021-02-02 19:34:48 +00:00
Tobias Thierer
dadc62cdb4 Merge "go/Android.bp: Clarify sdk_version documentation." 2021-02-02 18:19:38 +00:00