Commit Graph

3511 Commits

Author SHA1 Message Date
Colin Cross
dbedb52c42 Merge "Pass pctx and ctx to NewRuleBuilder" am: 897a5ad507 am: c5666f9231 am: e4e955818a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1500984

Change-Id: I7363070bee2d127e96e15433fc76d3bb2aaf3477
2020-12-04 01:36:00 +00:00
Colin Cross
897a5ad507 Merge "Pass pctx and ctx to NewRuleBuilder" 2020-12-03 20:07:30 +00:00
Jaewoong Jung
5c762ba3d4 Merge "Improve comments in java/aapt2.go" am: 6a96b82937 am: 446c6953d7 am: 5fe5372cf9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1507120

Change-Id: I11e54d86f03290af1cef763d9938da8244c1f9fe
2020-12-02 16:39:08 +00:00
David Su
950366c204 Merge "legacy_core_platform_api_usage: Remove FrameworksWifiTests" 2020-12-02 16:16:48 +00:00
Jaewoong Jung
6a96b82937 Merge "Improve comments in java/aapt2.go" 2020-12-02 15:19:56 +00:00
Treehugger Robot
f1ba003fe2 Merge "Fix the instructions for regenerating .txt" am: b28bd8cd66 am: db4e388423 am: 2d119df969
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1513924

Change-Id: Icb5fe0a4c0970cd6f6d7229ff32a7f0e91d1ccfd
2020-12-02 14:29:43 +00:00
Treehugger Robot
b28bd8cd66 Merge "Fix the instructions for regenerating .txt" 2020-12-02 13:01:37 +00:00
JaeMan Park
bd696ae847 Merge "Add java sdk library enforcement flag" am: a4d314c91c am: c11aa53de1 am: 828ed93814
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1475897

Change-Id: Ie2e54ca097b9936f9ff018a1f73d17fa5a5447e9
2020-12-02 06:42:07 +00:00
JaeMan Park
a4d314c91c Merge "Add java sdk library enforcement flag" 2020-12-02 04:39:10 +00:00
Colin Cross
f1a035e6be Pass pctx and ctx to NewRuleBuilder
Enable the RuleBuilder and RuleBuilderCommand methods to access
the BuilderContext by passing it to NewRuleBuilder instead of
RuleBuilder.Build.

Test: genrule_test.go
Test: rule_builder_test.go
Test: m checkbuild
Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
2020-12-01 16:22:16 -08:00
Treehugger Robot
47dbd19a4e Merge "Add test suite handling to central androidmk code" am: 464e6c71df am: 5ac52e71e5 am: 724510fec9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1513215

Change-Id: I0af64442017986754089a361e01dbecbc2450c5f
2020-12-01 23:59:09 +00:00
Treehugger Robot
464e6c71df Merge "Add test suite handling to central androidmk code" 2020-12-01 22:19:26 +00:00
Neil Fuller
96d016137f Fix the instructions for regenerating .txt
"make" hasn't worked for a while.

Test: None
Change-Id: Ic1319d32d4cc1b0930829fa6ed4d8d3f31deb351
2020-12-01 21:18:13 +00:00
Liz Kammer
57f5b33ad3 Add test suite handling to central androidmk code
MTS is introducing partial MTS test suites that are per-module, with
names of the format: mts-${MODULE}. By centralizing the code for test
suites, we can automatically add "mts" test suite when an
"mts-${MODULE}" test suite is specified, reducing duplication.

Test: m mts
Bug: 170318013
Change-Id: I8ce9d3c252fcc0a937bb5f2826d21cb6c6932d82
2020-12-01 12:23:56 -08:00
Ulyana Trafimovich
c594086a26 Merge changes from topic "soong-fixit-skavdrik" am: 0d18ef42ec am: e5b0fb9ee4 am: bfe4ba1fe7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1507578

Change-Id: Ia339e4b448e43883f63d4825bde2fb943c2cc775
2020-12-01 11:17:29 +00:00
Ulyana Trafimovich
0d18ef42ec Merge changes from topic "soong-fixit-skavdrik"
* changes:
  Documenting java/dexpreopt_bootjars.go
  Documenting dexpreopt/class_loader_context.go.
2020-12-01 10:01:43 +00:00
Treehugger Robot
29651b1c9a Merge "droidstubs: Remove unnecessary setting of DistFiles" am: 2f53f61d59 am: 1b639537e3 am: 764d40ff28
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511917

Change-Id: Ide57a779e9bea2ae680aa6975560820ee534e543
2020-11-30 23:24:47 +00:00
Treehugger Robot
648797d835 Merge "Add 'lo-prio' tag to temp blocklist." am: fd9fdec18e am: 58ab27473d am: b69e87b242
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1513211

Change-Id: Idd752fcb5e33ce7fb39c6c2f5924993481b05ac6
2020-11-30 23:24:13 +00:00
Jaewoong Jung
60d6d57771 Improve comments in java/aapt2.go
Test: N/A
Change-Id: I4b35a7c8707b9c4b173bb4587f7634e570d78674
2020-11-30 14:16:02 -08:00
Treehugger Robot
2f53f61d59 Merge "droidstubs: Remove unnecessary setting of DistFiles" 2020-11-30 20:49:17 +00:00
Treehugger Robot
fd9fdec18e Merge "Add 'lo-prio' tag to temp blocklist." 2020-11-30 20:37:47 +00:00
Paul Duffin
d8aed4b275 droidstubs: Remove unnecessary setting of DistFiles
Instead of setting DistFiles to use the api stub (if present) as the
default dist file this simply makes OutputFiles(tag) return the api
stub file for the DefaultDistTag.

Test: m nothing
      m dist sdk - before and after this change, compare result to
      make sure that there are no significant differences.
Bug: 174226317
Change-Id: I39d615c5bf8d20d59db7eeb98d942210ec0aa8ba
2020-11-30 17:20:09 +00:00
Paul Duffin
ac46dab804 Merge "java_sdk_library: Copy removed API specification file to dist" am: 8abcbdc0b3 am: dd60120cfb am: 40063a6317
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511916

Change-Id: I8e53b24ec110330a788fb73822b232ae5e47fb84
2020-11-30 13:55:10 +00:00
Paul Duffin
c63b7a6f7c Merge "Remove redundant setting of DistFiles by java.Library" am: a67ff601d9 am: e9b3c66e22 am: 9ff328fd08
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511914

Change-Id: Ib372f7abc778eed79c62aa8a7b578e5b3d7fde56
2020-11-30 13:54:53 +00:00
Paul Duffin
a5ab98c210 Merge "Differentiate between no dist tag and an empty dist tag" am: 4326e0e094 am: 982093faaf am: dd2b98baf4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511911

Change-Id: Iaeabd527ddd1c287be3a72209df15ad24f352894
2020-11-30 13:54:36 +00:00
Mathew Inwood
17a8cd9634 Add 'lo-prio' tag to temp blocklist.
This is a temporary measure to allow these APIs to be identified by
downstream tooling. Before S is finished, these APIs will be moved
to the max-target-R list anyway.

Adding the lo-prio flag should have no semantic impact on these APIs
but does allow them to be distinguished from the regular blocklist
APIs.

Test: m
Bug: 174455522
Change-Id: I031dcecbdef34a4f93a0fec1a92d95f769918486
2020-11-30 11:47:30 +00:00
Ulya Trafimovich
3bfabf2626 Documenting java/dexpreopt_bootjars.go
Test: m nothing
Bug: 173092919
Change-Id: I20018e1df6ad5e21172bb91435ae2c9cad7024e6
2020-11-27 18:10:22 +00:00
Paul Duffin
040e906fcf java_sdk_library: Copy removed API specification file to dist
Uses the dists property to copy the removed API specification file for
each API scope alongside the API specification file in the dist.

Bug: 158544979
Test: m nothing
      m dist sdk - before and after this change, compare result to
      make sure that there are no significant differences other than
      the after now contains -removed.txt files for each scope of each
      java_sdk_library
Change-Id: If23c594d29a12e49d2c5a8945ad488874bb1590c
2020-11-27 15:17:44 +00:00
Paul Duffin
620680516d Remove redundant setting of DistFiles by java.Library
A previous change handles dist properties automatically for all module
types and as a result has made the java.Library setting of DistFiles
redundant so this change removes that and the tests that duplicate
tests of the general mechanism.

Test: m nothing
      m dist sdk - before and after this change, compare result to
      make sure that there are no significant differences.
Bug: 174226317
Change-Id: Ib79a3bdd46897efd84a9c456c37c374bd6036303
2020-11-27 15:17:44 +00:00
Paul Duffin
74f05598eb Differentiate between no dist tag and an empty dist tag
Change https://r.android.com/1335521 added tag property to the Dist
struct so that it could be used to select one of a number of different
output files to copy to the dist instead of the single file that the
module type made available for dist. The output files were selected
by passing the tag to OutputFiles(tag).

Module types that wanted to support this new approach had to explicitly
set AndroidMkEntries.DistFiles = GenerateTaggedDistFiles(module).
Unfortunately, doing that had a side effect of changing the behavior of
dist entries without a tag.

That was because the change treated a tag that was not specified, as
being the same as "". So, prior to the change no tag meant use the
default dist file but after it meant use the paths returned by
OutputFiles(""). That changed the behavior of the java.Library type
which affected the behavior of the android_app module type.

Prior to the change the java_library would make the
Library.outputFile available for dist when no tag was specified. After
that change it would make Library.outputFile plus
Library.extraOutputFiles. The latter is usually empty except for
android_app which adds some extra files into there which will now be
copied to the dist. That change may have been intentional but there
was no mention of it in the change or the bug. Even if it wasn't
intentional it may still be beneficial.

Any module type that wants to add support for tags in dist runs the
risk of introducing similar changes in behavior. This change
differentiates between the tag not being set and the tag being set to
"" to avoid that possibility and to make the default behavior
explicit for those module types that have switched.

It does so as follows:
* Adds a DefaultDistTag constant that is used when the tag is not set.
  It is a string that is unlikely to be used as an actual tag as it
  does not start with a . and uses some special characters.
* The DefaultDistTag is used in MakeDefaultDistFiles(paths) to indicate
  that the supplied paths are the default ones and and also in
  GenerateTaggedDistFiles() for Dist structures that have no tag
  property set.
* The DefaultDistTag is passed to OutputFiles(tag) just in case the
  module type has explicitly defined the paths to associate with that
  tag in there. If it has then it overrides the legacy behavior. If it
  has not then it is just ignored and falls back to using the previous
  behavior.
* The java.Library.OutputFiles(tag) method explicitly handles the
  DefaultDistTag and returns Library.outputFile for it which restores
  the behavior from before the change that added dist.tag support.
* Similar change was made to apexBundle.OutputFiles(tag) in order to
  preserve its previous behaviour.
* The customModule used by TestGetDistContributions has been modified
  to also preserve its previous behavior after this change.

Test: m nothing
      m dist sdk - before and after this change, compare result to
      make sure that there are no significant differences.
      Test the effect on the apex by following instructions in
      http://b/172951145
Bug: 174226317
Change-Id: Ib8f0d9307751cc2ed34e3d9a5538d3c144666f6d
2020-11-27 15:17:44 +00:00
Ulyana Trafimovich
b7fbee665a Merge "Assume any <uses-library> is shared, add only toplevel ones to manifest." am: af07f732e6 am: 38352b8f69 am: e5b2f55684
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1511271

Change-Id: Ie8d573fc83c8f2426a1792b095fffeeced71997a
2020-11-27 12:19:12 +00:00
Ulyana Trafimovich
af07f732e6 Merge "Assume any <uses-library> is shared, add only toplevel ones to manifest." 2020-11-27 10:44:54 +00:00
David Su
f58a63d797 legacy_core_platform_api_usage: Remove FrameworksWifiTests
FrameworksWifiTests no longer depends on @CorePlatformApi's.

Bug: 173336987
Test: atest FrameworksWifiTests
Change-Id: I1b6e670055b42defb588b1cbfec2711b758f3cde
2020-11-25 11:07:06 -08:00
Ulya Trafimovich
78a7155c17 Assume any <uses-library> is shared, add only toplevel ones to manifest.
This patch reworks the approach introduced in
https://r.android.com/1450819. That patch based the decision which
libraries should be added to the manifest <uses-library> tags by the
manifest_fixer on the "shared" status of the library.

That approach is incorrect for two reasons:

  - It doesn't make sense to have a non-shared library in class loader
    context ("shared" libraries are those specified in
    frameworks/base/data/etc/platform.xml, and they are the only ones
    that PackageManager knows about).

  - It doesn't make sense to add anything but the top-level of the
    class loader context tree to the manifest, because this part of the
    tree is flattened to a sequence, and PackageManager cannot restore
    it to the previous tree shape (there is an information loss).

This patch removes the "shared" bit of information from class loader
context elements and assumes that all libraries that end up in class
loader context are shared. Consequently, only the top-level libraries
should be passed to manifest_fixer.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Bug: 168686456
Change-Id: I902690f0f38f1047fa79cf6ccbe956077eceaab0
2020-11-25 14:47:05 +00:00
Treehugger Robot
08e2c94504 Merge "Add comments about sysprop_library" am: c2acb8cbf0 am: 0acad3aa48 am: 4664086cc6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1508076

Change-Id: Ibed0fc2e3ec7675a5762370650445267a2ad92ef
2020-11-25 05:42:01 +00:00
Treehugger Robot
c2acb8cbf0 Merge "Add comments about sysprop_library" 2020-11-25 00:54:14 +00:00
Colin Cross
6c9e2c1791 Merge "Annotate dependency tags for dependencies of installed files" am: e5218b6be6 am: d1b7d243f6 am: 0d75566f49
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1501613

Change-Id: I1543615d61a1b3dd1008087ab02db9f2636a908c
2020-11-24 17:31:57 +00:00
Colin Cross
e5218b6be6 Merge "Annotate dependency tags for dependencies of installed files" 2020-11-24 16:01:35 +00:00
Treehugger Robot
67accb494a Merge "Remove restriction on exported plugins that generate APIs" am: 547471cffc am: 8f80c21ddd am: 8542299db8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1506204

Change-Id: I52ad6552d37596287dd270611845e24023e7054d
2020-11-24 09:51:53 +00:00
JaeMan Park
ff71556a53 Add java sdk library enforcement flag
Add java sdk library enforcement for inter-partition library
dependency, for ensuring backward-compatible libraries for
inter-partition dependencies.

Test: m nothing
Bug: 168180538
Change-Id: I6bfac54c3499b03003a3bc6c2bb62b165b4ce5f9
2020-11-24 17:56:15 +09:00
Inseob Kim
07def12d50 Add comments about sysprop_library
Bug: 173473767
Test: m nothing
Change-Id: I96395742ae369baf9d54be8f92b01860ee0351ab
2020-11-24 14:13:31 +09:00
Treehugger Robot
547471cffc Merge "Remove restriction on exported plugins that generate APIs" 2020-11-24 05:06:40 +00:00
Jingwen Chen
c887d1f6cb Merge "Refactor 'in_make' to mean Kati is not skipped." am: f87a720101 am: 628217737c am: c6d8a3e14f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1508061

Change-Id: I635b7c0848b73fccfe9c17d5b4c56c215294feff
2020-11-24 03:37:59 +00:00
Jingwen Chen
f87a720101 Merge "Refactor 'in_make' to mean Kati is not skipped." 2020-11-24 02:09:21 +00:00
Colin Cross
e9fe2949b8 Annotate dependency tags for dependencies of installed files
Relands Ic22603a5c0718b5a21686672a7471f952b4d1017 with a minor
change to track libc++ dependencies for python hosts and after
a fix to an internal genrule that depended on transitively
installed java libraries (ag/13068670).

Soong currently assumes that installed files should depend on
installed files of all transitive dependencies, which results
in extra installed file dependencies through genrules, static
libs, etc.

Annotate dependency tags for dependencies for which the
installed files are necessary such as shared libraries
and JNI libraries.

This avoids extra installed files, and is also a first step
towards genrules using their own copy of tools instead of
the installed copy.

Bug: 124313442
Test: m checkbuild
Test: java.TestBinary
Test: cc.TestInstallSharedLibs
Test: deptag_test.go
Change-Id: I725871249d561428e6f67bba6a7c65b580012b72
2020-11-23 18:06:08 -08:00
Colin Cross
c9fe10f5b8 Remove restriction on exported plugins that generate APIs
hilt_android requires seven separate annotation processors, which
is only feasible to support using exported_plugins to avoid having
to list all seven in every module that uses it.  Unfortunately they
all set generates_api: true.  Turbine is already disabled for modules
that directly use a plugin that sets generates_api: true, because
turbine doesn't run annotation processors.  Also add support for
disabling turbine if a module transitively uses a plugin that
generates APIs via exported_plugins.

Bug: 173397767
Test: TestExportedPlugins
Change-Id: If70354a3dd67efb4ce88bc9c934d41ccb6241b28
2020-11-23 11:42:26 -08:00
Paul Duffin
18fa4012c9 Merge "java_sdk_library: Allow dist artifacts to be named" am: 0dabd31057 am: bcd26ea516 am: 9a5c0f99b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1507582

Change-Id: I457227a18675fbc8eba5cefa4d6e0964bd1838d2
2020-11-23 14:24:16 +00:00
Paul Duffin
0dabd31057 Merge "java_sdk_library: Allow dist artifacts to be named" 2020-11-23 12:17:45 +00:00
Mathew Inwood
5aaabd3b97 Merge "Explicitly tag max-target-o APIs as "lo-prio"." am: 6ba603c8a1 am: c16bcd3efb am: 88afae4616
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1494180

Change-Id: I168bec3efc7fd12db0dbb1b6bcc556a973fd72f7
2020-11-23 10:51:49 +00:00
Mathew Inwood
6ba603c8a1 Merge "Explicitly tag max-target-o APIs as "lo-prio"." 2020-11-23 09:45:48 +00:00