Commit Graph

36748 Commits

Author SHA1 Message Date
Paul Duffin 9b76c7bee2 Merge "Extract common stub flags code" am: d631512659 am: d8d72e85f6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683865

Change-Id: I2aa0acb55e98e1399516f582525419d93fbadc14
2021-04-22 15:53:13 +00:00
Paul Duffin d8d72e85f6 Merge "Extract common stub flags code" am: d631512659
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683865

Change-Id: I894fd306eaae9ef0a58ee4a8b73269117cc68374
2021-04-22 15:34:25 +00:00
Paul Duffin d631512659 Merge "Extract common stub flags code" 2021-04-22 15:05:54 +00:00
Paul Duffin aae44728e4 Merge "Allow generate_hiddenapi_lists.py to work with no custom flag files" am: eee990820b am: 04378bd2ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682096

Change-Id: Iac0e41d260b473623ebb8be1df1ef1b2e5bb457c
2021-04-22 14:41:51 +00:00
Paul Duffin 13b9d25ed4 Merge changes I67589bcc,Ibcfae390 am: 7cbdf81e95 am: 33f495f305
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683868

Change-Id: I1b3d7fae197d3e072ac205cfe8e09a1c6bf0ddc3
2021-04-22 14:41:43 +00:00
Paul Duffin 04378bd2ba Merge "Allow generate_hiddenapi_lists.py to work with no custom flag files" am: eee990820b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682096

Change-Id: I092ad11719b3a1a4a861bb26cc7b5aebe04d1028
2021-04-22 14:23:15 +00:00
Paul Duffin 33f495f305 Merge changes I67589bcc,Ibcfae390 am: 7cbdf81e95
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683868

Change-Id: Ie19e2285fd129b52e17a8df6091ac53be126794b
2021-04-22 14:18:03 +00:00
Paul Duffin eee990820b Merge "Allow generate_hiddenapi_lists.py to work with no custom flag files" 2021-04-22 14:05:22 +00:00
Paul Duffin 7cbdf81e95 Merge changes I67589bcc,Ibcfae390
* changes:
  Replace boot image with bootclasspath fragment in sdk package
  bootclasspath_fragment must only depend on source contents
2021-04-22 14:02:43 +00:00
Paul Duffin 3e7fcc3fe7 Extract common stub flags code
The stubFlagsRule does three separate tasks:
1. It computes the set of modules that provide the stubs.
2. It scans all the modules to find the stub modules and retrieves the
   paths to their dex files.
3. It constructs the ninja rule.

Of those three tasks, 1 and 3 will be same for the
platform_bootclasspath. Instead of searching all the modules for the
ones that provide the stubs it will simply add dependencies onto the
stub modules and retrieve the dex file paths from them.

This change extracts tasks 1 and 3 into separate methods for reuse. It
also parameterizes the generation of the ninja rule.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I893845dbddc4b001dfd44d0e0b1c8a31b7f3f89f
2021-04-22 14:23:08 +01:00
Anton Hansson 05ecab28a3 Merge "Add new stub_only_static_libs attr for sdk_library" am: 24eac476d4 am: ec47b30e0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682097

Change-Id: Iafe4f8df922fc2234de596b1f1c3819accc50656
2021-04-22 13:11:33 +00:00
Anton Hansson ec47b30e0e Merge "Add new stub_only_static_libs attr for sdk_library" am: 24eac476d4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682097

Change-Id: If44f96ef58aad4453e76b6c6c458fd6942fa3f48
2021-04-22 12:54:17 +00:00
Anton Hansson 24eac476d4 Merge "Add new stub_only_static_libs attr for sdk_library" 2021-04-22 12:41:46 +00:00
Jingwen Chen 8bddaab06a bp2build: refactor/standardize cc_* bp2build converters am: ed9c17d033 am: 0a52f7276e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674326

Change-Id: I96a75997b408f7b17f1caf9107f544ad4a538388
2021-04-22 10:59:28 +00:00
Jingwen Chen 0a52f7276e bp2build: refactor/standardize cc_* bp2build converters am: ed9c17d033
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1674326

Change-Id: I1cc8f6c9681346d3d7dff316d2b37e5bdaccf30d
2021-04-22 10:36:37 +00:00
Anton Hansson dae54cd84f Add new stub_only_static_libs attr for sdk_library
Allow java_sdk_libraries to include libraries statically into their
stubs. The immediate use-case of this is to embed libcore notice files
into their stubs.

Also extend the java_sdk_library tests for impl/stub-only-libs, plus
some not assert utils.

Bug: 173186484
Bug: 184839599
Test: soong tests
Change-Id: I1ebf2f35c048eab5cec5125482a0304fe660f188
2021-04-22 10:20:13 +01:00
Jingwen Chen ed9c17d033 bp2build: refactor/standardize cc_* bp2build converters
This CL refactors the cc* bp2build converters to use the common
attribute extractors in cc/bp2build.go.

This also adds include_build_directory to be handled by the compiler
attr extractor to generate recursive headers as inputs.

This also turns include_dirs and local_include_dirs into the
execroot-relative -I flags.

e.g. if a module in  bionic/libc has "private" in local_include_dirs,
the "-Ibionic/libc/private" copt is generated for it.

Fixes: 185139955

Test: TH
Test: Forrest for mixed_clean-droid
Change-Id: Ib67056482227e62068fbbea0455035bdf5d56319
2021-04-22 08:31:24 +00:00
Rupert Shuttleworth bd7a5537b8 Merge "Add various test files as testSrcs, so that they run on CI." am: dac451715b am: 950c2381dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683265

Change-Id: I9e1739c19cab87cdc17bed5a88e21e52f9d0f6df
2021-04-22 03:55:31 +00:00
Rupert Shuttleworth 950c2381dd Merge "Add various test files as testSrcs, so that they run on CI." am: dac451715b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683265

Change-Id: I778645f091d2278072423174dba25c9dd238413b
2021-04-22 03:35:53 +00:00
Treehugger Robot 5aab26cdda Merge "Add tempPathForRestat to improve consistency" am: f434cb5c1d am: 6c1532d37e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683867

Change-Id: I014911a6d439cdb52ddcc5372eaa6e03506e8ebb
2021-04-22 03:12:43 +00:00
Rupert Shuttleworth dac451715b Merge "Add various test files as testSrcs, so that they run on CI." 2021-04-22 03:08:21 +00:00
Treehugger Robot 6c1532d37e Merge "Add tempPathForRestat to improve consistency" am: f434cb5c1d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683867

Change-Id: I694cc0ae72c9679dcb3f7fa53f553dc9e6f7ca85
2021-04-22 02:48:06 +00:00
Treehugger Robot f434cb5c1d Merge "Add tempPathForRestat to improve consistency" 2021-04-22 02:22:58 +00:00
Treehugger Robot 13fc2fa05c Merge changes I9a08bbc0,I049d1bb9 am: 752d63cd83 am: e8bfb5a3a0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682583

Change-Id: I0a22747f144972c7378245980ce61640c1f01f9f
2021-04-22 00:07:28 +00:00
Elliott Hughes fd6c513703 Merge "Move some make variables from GNU binutils to LLVM equivalents." am: 7c0abf6f3c am: 6b4a5ab97b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683506

Change-Id: I7a5ef28206e54bad57664fb710abb95eee57e8a7
2021-04-22 00:07:19 +00:00
Treehugger Robot e8bfb5a3a0 Merge changes I9a08bbc0,I049d1bb9 am: 752d63cd83
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682583

Change-Id: I8192b0ee13a4eaa550ea34fb4e7b706e1ffc9d73
2021-04-21 23:49:26 +00:00
Elliott Hughes 6b4a5ab97b Merge "Move some make variables from GNU binutils to LLVM equivalents." am: 7c0abf6f3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1683506

Change-Id: I568de05d0b8225a5c554f46cd4723602a5ec4069
2021-04-21 23:48:44 +00:00
Treehugger Robot 752d63cd83 Merge changes I9a08bbc0,I049d1bb9
* changes:
  Add validations to RuleBuilderCommand
  Fix bug in RuleBuilderCommand.OrderOnlys
2021-04-21 23:06:33 +00:00
Elliott Hughes 7c0abf6f3c Merge "Move some make variables from GNU binutils to LLVM equivalents." 2021-04-21 22:59:09 +00:00
Paul Duffin 0b28a8d356 Replace boot image with bootclasspath fragment in sdk package
Bug: 177892522
Test: m nothing
Change-Id: I67589bccbde426de2caf513bd643d9484df86c1e
2021-04-21 23:54:17 +01:00
Nikita Ioffe 910efe3bbe Merge "Don't compress apexes when building in unbundled mode" am: 6681ef3101 am: aa3aee5205
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1679445

Change-Id: I321576e07289af1f6e0719296262cb873f7ae1d8
2021-04-21 22:47:56 +00:00
Paul Duffin d3c1513df9 Add tempPathForRestat to improve consistency
Previously, there were two approaches used to construct the temporary
path needed by the commitChangeForRestat method and neither was
suitable for general use. One was:
    android.PathForOutput(ctx, outputPath.Rel()+".tmp")
The other was:
    combinedAidl.ReplaceExtension(ctx, "aidl.tmp")

The first approach would not work if the supplied path had been created
by PathForModuleOut() or similar as it would drop the module directory.
That could lead to the same path being used for multiple rules.

The second approach would not work for files with a different
extension.

The tempPathForRestat combines the two approaches so it can be used
generally with any WritablePath.

Bug: 179354495
Test: verified that the ninja rules that used these files were not
      changed by these changes.
Change-Id: I4439dea0a823512c281eeb1366522fb49dceb4e3
2021-04-21 23:26:57 +01:00
Nikita Ioffe aa3aee5205 Merge "Don't compress apexes when building in unbundled mode" am: 6681ef3101
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1679445

Change-Id: I50aef82fc25f734d14e53809969248c9b796864b
2021-04-21 22:17:09 +00:00
Nikita Ioffe 6681ef3101 Merge "Don't compress apexes when building in unbundled mode" 2021-04-21 21:50:32 +00:00
Colin Cross ae89abe381 Add validations to RuleBuilderCommand
Add RuleBuilderCommand.Validation and RuleBuilderCommand.Validations
that propagate to BuildParams.Validations.

Test: TestRuleBuilder_build, TestRuleBuilder
Change-Id: I9a08bbc073a432fd0b53b87d8948ac0f6afcf637
2021-04-21 11:46:50 -07:00
Colin Cross da6401b770 Fix bug in RuleBuilderCommand.OrderOnlys
Order only dependencies that were added to a RuleBuilderCommand were
only propagated to the rule that was created for a missing dependencies
error.  Set them on the main rule instead.

Test: TestRuleBuilder_build
Change-Id: I049d1bb921778d18d678439d236f69081927dc70
2021-04-21 11:46:49 -07:00
Paul Duffin 6589805e2a bootclasspath_fragment must only depend on source contents
This change ensures that bootclasspath_fragment only depends on source
modules and prebuilt_bootclasspath_fragment only depends on prebuilt
modules.

It does that in two ways:
1. It adds the dependencies in ComponentDepsMutator method which is
   called before any renaming of prebuilts is done which makes it very
   easy to add a dependency directly onto either the source or prebuilt
   as required.
2. It uses a tag which prevents dependencies on a source module from
   being replaced with a dependency on a prebuilt module which ensures
   that a dependency on the source modules is not replaced with a
   dependency on a prebuilt module.

Bug: 177892522
Test: m nothing
Change-Id: Ibcfae39083afbc07fcf729ead3ed5f5d020845bf
2021-04-21 19:05:37 +01:00
Paul Duffin 3fb47c846b Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" am: eaa432d470 am: fb57372edb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682094

Change-Id: Ic125330d65870ec4572c0bdbe238c9e65a612fc8
2021-04-21 18:02:52 +00:00
Paul Duffin 1ac08937bc Merge "Add PrepareForDebug_DO_NOT_SUBMIT" am: 893b2fda41 am: fead82b508
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682088

Change-Id: Ib8c9f0a524b2c2e293b5c88dc18188efc235dea2
2021-04-21 18:02:46 +00:00
Paul Duffin fb57372edb Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" am: eaa432d470
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682094

Change-Id: Ie2ac4dcfbae771e8295edb8557971f3b250e78ad
2021-04-21 17:49:52 +00:00
Paul Duffin fead82b508 Merge "Add PrepareForDebug_DO_NOT_SUBMIT" am: 893b2fda41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1682088

Change-Id: I52979323ceeb73ca3c92dfc1e0866a27fc6cdf91
2021-04-21 17:40:33 +00:00
Elliott Hughes a960a0d5de Move some make variables from GNU binutils to LLVM equivalents.
There are others still to look at, but this set doesn't seem to break
anything for me.

Bug: http://b/147452927
Test: treehugger
Change-Id: I794684e23eee1326deb34bb4d5ed5831a47b8fa3
2021-04-21 10:22:55 -07:00
Paul Duffin eaa432d470 Merge "Skip initHiddenAPI check of prebuilt's boot dex jar for APEX modules" 2021-04-21 17:14:56 +00:00
Paul Duffin 893b2fda41 Merge "Add PrepareForDebug_DO_NOT_SUBMIT" 2021-04-21 17:10:40 +00:00
Treehugger Robot 407266b045 Merge "Remove unnecessary `android:"path"` tags in rust" am: f9b3e22293 am: b7dcc980cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1679694

Change-Id: Iec5d34127eb5c2638afee8ad3c0ac9b962f7b1b1
2021-04-21 16:49:06 +00:00
Treehugger Robot b7dcc980cd Merge "Remove unnecessary `android:"path"` tags in rust" am: f9b3e22293
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1679694

Change-Id: I26fd8019992c720c6f2f966ee66b4982052a6176
2021-04-21 16:24:27 +00:00
Paul Duffin 2082e695ce Allow generate_hiddenapi_lists.py to work with no custom flag files
Previously, if generate_hiddenapi_lists.py was invoked without any
custom flag files, e.g. hiddenapi-unsupported.txt, then it would fail.
This change allows it to be used for generating the hiddenapi lists
for modules that do not have any custom flag files,
e.g. framework-sdkextensions

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I455d453024c9f06ed59cbc1e9838234f8b7c7317
2021-04-21 17:15:25 +01:00
Treehugger Robot f9b3e22293 Merge "Remove unnecessary `android:"path"` tags in rust" 2021-04-21 15:53:44 +00:00
Rupert Shuttleworth b7e30760af Add various test files as testSrcs, so that they run on CI.
Test: go test
Test: TH (now that these are hooked up to TH)

Change-Id: Ia199794ef1a64074f3f9159f8c160ba3e45fd181
2021-04-21 11:23:57 -04:00
Rupert Shuttleworth cc48cb4651 Merge "Generate BUILD files for every directory that has an Android.bp file." am: 4949557d50 am: de3feaefd4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1677620

Change-Id: I6cf5d1a5940e9b9eaa3adb778a66b2e0cbbdda63
2021-04-21 15:20:25 +00:00