Commit Graph

3473 Commits

Author SHA1 Message Date
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
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
Jingwen Chen
cda22c9bb9 Refactor 'in_make' to mean Kati is not skipped.
In Nougat and before, Make wrote a marker file to indicate that
soong_build was invoked from Make to change certain behaviors of Soong
at build time.
https://cs.android.com/android/platform/superproject/+/android-7.1.2_r36:build/core/soong.mk;l=70-73;drc=ae18638b0406ad107b0882a02a13cdd8b92f2a4e

Things have changed, and now soong_build is invoked from soong_ui, which
supports a --skip-make configuration flag:
https://cs.android.com/android/platform/superproject/+/master:build/soong/ui/build/build.go;l=31-33;drc=680387bf1d3ce7cbc77f535be7c42cec411b1687

Thus, the various remnants of 'EmbeddedInMake' and 'inMake'
configuration are misleading, since soong_build is no longer invoked
from Make. This CL refactors all instances to actually mean that
Kati is enabled (not skipped with --skip-make), and will run after
soong_build finishes, so Kati-specific behavior like the AndroidMk
singleton should run.

Test: TH presubmit

Change-Id: I576ab8e54f99f5c8ddf9feaf9a828019b279e266
2020-11-23 00:29:18 -05:00
Paul Duffin
3131025d61 java_sdk_library: Allow dist artifacts to be named
Unless no_dist: true is specified the java_sdk_library will
automatically copy the stubs jar and the API specification file (but
not the removed API specification file) for each scope to the apistubs/
directory in the dist from which the sub-directories in prebuilts/sdk
are populated. Previously, the name of those artifacts was based on the
name of the module. This change adds the dist_stem property to allow
the name of those artifacts to be specified separately to the module.

The purpose of this is to allow the art.module.public.api,
conscrypt.module.public.api and i18n.module.public.api java_sdk_library
modules to use a different name when copying to the dist,
e.g. conscrypt.module.public.api should use conscrypt.

Additionally, as the artifacts in the dist end up being copied verbatim
to prebuilts/sdk and the prebuilt_apis module uses those names to
create a filegroup referencing the latest released version of the API
and removed API specification files the dist_stem property is also
used in constructing the name of those filegroups.

Bug: 173715943
Test: lunch sdk-eng && m dist sdk
      Compare the results of the above before and after the change to
      ensure that this change does not affect the contents of the dist.
      See the topic's other change in external/conscrypt for testing
      the behavior of this new property.
Change-Id: Ie81345021991ff91ca55fec15b02627135293308
2020-11-20 22:43:21 +00:00
Paul Duffin
6b11d02597 Merge "java_sdk_library: Stop disabling copy to dist when sdk_version: none" am: 05c2f3e29a am: d94bd1ddff am: b2c13926b1 am: 1b8d0482ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1506239

Change-Id: Ie73854634a2efd6bc953bfd5007baae46adabda4
2020-11-20 14:19:11 +00:00
Paul Duffin
50780b62b7 Merge "java_sdk_library: Allow no_dist to be explicitly set in .bp file" am: de6df73b44 am: fb873a3048 am: ee09b2228f am: ca5c6a4b42
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1506238

Change-Id: Idbe5601fef234c199af59d003f418be0a90248cd
2020-11-20 14:18:59 +00:00
Paul Duffin
05c2f3e29a Merge "java_sdk_library: Stop disabling copy to dist when sdk_version: none" 2020-11-20 12:48:11 +00:00
Paul Duffin
de6df73b44 Merge "java_sdk_library: Allow no_dist to be explicitly set in .bp file" 2020-11-20 12:47:43 +00:00
Paul Duffin
4fb01c1b0d Merge "java_sdk_library: Remove unused SetNoDist method" am: defa9403a3 am: 21ba518097 am: dad85cd671 am: 822b1b62f0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1506237

Change-Id: I9afa81cebb3c15523207808200737698ad289662
2020-11-20 11:42:54 +00:00
Paul Duffin
defa9403a3 Merge "java_sdk_library: Remove unused SetNoDist method" 2020-11-20 10:02:13 +00:00
Colin Cross
c29c94ed5a Merge "Support extra checks for ErrorProne in a dedicated property" am: 18e3e8fbc2 am: b742386721 am: c9ec32e084 am: 13186ae8ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1506659

Change-Id: I1f6bae93f48d348c5dfdb565af8a75d1c37e2fc0
2020-11-20 04:10:05 +00:00
Julien Desprez
07659d70a7 Merge "Use java host unit tests template for unit tests" am: 62aa21508c am: 706ee179ae am: efff25ce93 am: 6c2b0d1c65
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1505512

Change-Id: I7b15989b29bd7d36af59e2a5a7b49f0be491e1e1
2020-11-20 02:51:25 +00:00
Colin Cross
18e3e8fbc2 Merge "Support extra checks for ErrorProne in a dedicated property" 2020-11-20 02:06:19 +00:00
Julien Desprez
62aa21508c Merge "Use java host unit tests template for unit tests" 2020-11-20 00:07:41 +00:00
Colin Cross
748b2d829a Support extra checks for ErrorProne in a dedicated property
Previous extra checks for ErrorProne were added using the plugins
proeprty to get them into the -processorpath argument.  This works
fine for java-only modules, but fails for mixed java+kotlin modules
because the processorpath is given to kapt and not javac.

Add a dedicated errorprone.extra_check_modules property (mirroring
the lint.extra_check_modules property), and add that to a separate
processorpath that is used only for errorprone rules and not cleared
when kotlin is used.

Test: TestKapt/errorprone
Change-Id: Id6ef02ce758532d1df8b8d969fad83bb44fe93ab
2020-11-19 14:20:12 -08:00
Paul Duffin
7f3e705ef2 Merge changes from topic "fix-stubs-source-snapshot" am: b479459ac9 am: 5248161eaf am: e3ec3ea345 am: 69cc037aa3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1503793

Change-Id: I21cf147c846d687f14a712080f424359306a6be8
2020-11-19 20:36:23 +00:00
Treehugger Robot
9af7306361 Merge "java link time error improve" am: e63ab5ea02 am: a5fc86f799 am: 4b4b9c5498 am: b5912057ec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1501002

Change-Id: I12794167b7b56fd68d959ff7417e5d86015d25ed
2020-11-19 20:36:15 +00:00
Paul Duffin
3aef8d2c1f java_sdk_library: Stop disabling copy to dist when sdk_version: none
Previously, setting "sdk_version: none" would have a side effect of
disabling copying to dist by default. This change removes that behavior
and will copy to dist by default unless explicitly specified.

This will have no impact on the dist because all java_sdk_library
modules that relied on the previous behavior to disable copying to
dist have been modified to explicitly disable copying to dist.

Test: lunch sdk-eng && m dist sdk
      compare out/dist/apistubs directories before and after this
      change to make sure that they have not changed.
Bug: 173715943
Change-Id: I376546b5a8b03de6c944961f7408dad22184fe49
2020-11-19 19:28:10 +00:00
Paul Duffin
4f5c1ef229 java_sdk_library: Allow no_dist to be explicitly set in .bp file
Currently, the no_dist property cannot be set in a .bp file and
defaults to true if the sdk_version property is set to none. That
behavior was added to prevent the output files from the libcore,
conscrypt and icu java_sdk_library modules from being copied to the
dist. It worked because they were the only java_sdk_library modules to
set "sdk_version: none".

Unfortunately, that default behavior is no longer required because
we want to be able to convert "conscrypt" module to a java_sdk_library
and have its public API output files be copied to the dist
automatically. This change allows the no_dist property to be explicitly
set in the .bp file so that those modules that rely on the implicit
behavior can explicitly specify it and allow the default behavior to
be removed.

This change:
* Removes the `blueprint:"mutated"` tag from the No_dist property which
  allows it to be specified in a .bp file.
* Only sets the default if the property has not been explicitly
  specified in a .bp file.

Test: lunch sdk-eng && m dist sdk
      compare out/dist/apistubs directories before and after this
      change to make sure that they have not changed.
Bug: 173715943
Change-Id: I8a1c97b690ae05bfe71ea72acc0831fa51aca7e9
2020-11-19 19:28:10 +00:00
Paul Duffin
e3ecd6c7a8 java_sdk_library: Remove unused SetNoDist method
This method was added for use in sysprop_library.go but it is no longer
used there. So, this change removes it.

Bug: 173715943
Test: m nothing
Change-Id: I0c2ae8a8d515faf2692eca2aaed63475fdb6a196
2020-11-19 19:28:05 +00:00
Paul Duffin
b479459ac9 Merge changes from topic "fix-stubs-source-snapshot"
* changes:
  Fix prebuilt_stubs_sources to work with no stubs sources
  Revert "Use glob for java_sdk_library_import stub_srcs"
2020-11-19 18:39:02 +00:00
Treehugger Robot
e63ab5ea02 Merge "java link time error improve" 2020-11-19 18:38:16 +00:00
Julien Desprez
70898c4006 Use java host unit tests template for unit tests
Test: make aoa-helper-tests
Bug: 172961860
Change-Id: I2eaee277961f29adfd22e7c65248c9403bd69b81
2020-11-19 09:44:39 -08:00
Paul Duffin
1a39332cf6 Fix prebuilt_stubs_sources to work with no stubs sources
The framework-sdkextension java_sdk_library module defines an API for
public, system and module_lib API surfaces but the public API is empty.
The empty public API results in an empty .srcjar being repackaged and
merged into the sdkextension-sdk snapshot and results in no directory
for the public API stubs sources being created. Unfortunately, the
Android.bp file in the snapshot is created by Soong and it does not
know that the public API will be empty and so it creates an Android.bp
file that references the directory into which the stubs sources should
be added but which ends up not existing in the snapshot. Referencing a
non-existent directory causes a build failure.

This change fixes that issue by using PathForModuleSrc with no path
components to get the path to the module directory (which must exist)
and then resolving the module relative local src directory against
that. The local src directory is globbed to find all the files, which
will return an empty set of paths if the directory does not exist.
Finally, the file paths are passed as an rsp file to soong_zip to avoid
exceeding any command line limits.

Many other different approaches were considered:
* Adding a property to the java_sdk_library to indicate that the public
  API was actually empty. That would require extra maintenance by
  developers and would require some extra checks to be performed after
  generating the stubs source to ensure that it was empty which would
  complicate the build process.
* Creating a directory with some placeholder file (empty directories
  don't work well with git) that would force the creation of the
  directory. That file would most likely be created whether the API
  was empty or not, would need to be stored in git alongside the source
  and could be quite confusing to reviewers.

Bug: 173508731
Test: m nothing - to run new tests
      Build sdkextension-sdk, unpack it and then build the .srcjar
      files for the public, system and module_lib API surfaces.
      Without this change the build failed, reporting that the
      stubs_sources directory for the public API did not exist.
      With this change the build succeeded.
      Checked the contents of the resulting .srcjar files and made
      sure that the public one was empty and the others contained
      the SdkExtensions.java class and a package-info.java file.
Change-Id: Ia468a3f37349f2dbc21db67744bda6461498d515
2020-11-19 12:42:18 +00:00
Paul Duffin
ab5ac8f169 Revert "Use glob for java_sdk_library_import stub_srcs"
This reverts commit 7f97957ded.

Reason for revert: breaks sdk snapshots b/173508731
Bug: 173508731
Test: Ran prebuilts/runtime/update.py and then m nothing
      Before revert it failed
      After revert it worked

Change-Id: I9c081681fac589e37788a0d592435e3224011c58
2020-11-19 12:03:51 +00:00
Joseph Murphy
fdb9f7f449 Revert "Adds a workaround to fix version inconsistency"
This reverts commit bc98d2ffe8.

Reason for revert: It was much to my chagrin that I realized the main purpose of this build target is an actually an internal branch which has the changes which make S the default for Robolectric.  This will complicate things a little bit in the short term, but in principle, this revert can be merged over with those changes down the line.

Change-Id: I053a32d89bfdf33486d95a30b145eb3b6f57df1d
2020-11-19 01:00:34 +00:00
Treehugger Robot
f828c49069 Merge changes Iba57c949,Ief43ff51,Ib1809a4d,I2ab64f36 am: b08a091502 am: 3f57de54b2 am: a088bff723 am: 6c4cdb0bb2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1480605

Change-Id: Ie0876cdaf142dbd75c094f9e680849efb4105b28
2020-11-18 23:35:27 +00:00
Colin Cross
dcc3c42355 Merge "Move genrule on top of RuleBuilder" am: d4a63eaeb7 am: 9fffe4cd19 am: e2732d4c9d am: dea73f7535
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498170

Change-Id: I798a24001dd1e8e0bcc6fb0d2770294bed384dea
2020-11-18 21:23:22 +00:00
Treehugger Robot
b08a091502 Merge changes Iba57c949,Ief43ff51,Ib1809a4d,I2ab64f36
* changes:
  Store ndkKnownLibs in the config
  Register the kythe singleton on the Context instead of globally
  Store ninja file deps from PackageVarContext in the config
  Store SingletonMakeVarsProviders in the config
2020-11-18 20:00:31 +00:00
Colin Cross
d4a63eaeb7 Merge "Move genrule on top of RuleBuilder" 2020-11-18 18:44:19 +00:00
Dan Shi
cf10c9c69d Merge "Add unit_test test option in test configs" am: ebb51503a4 am: fdd23ce534 am: b71498a327 am: d95774301f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1498167

Change-Id: I9b1a21f70ed9e615ab4ef2bbf2b0138d8c7c8665
2020-11-18 05:59:01 +00:00
Dan Shi
ebb51503a4 Merge "Add unit_test test option in test configs" 2020-11-18 04:40:37 +00:00
Steven Moreland
0029898a84 java link time error improve
Asked about error message including "against private API.Adjust
sdk_version", which is a bit hard to parse due to missing space. Also
tried to make error message less verbose, so that it is more clear what
to do, and fixed a grammar mistake.

Bug: N/A
Test: N/A
Change-Id: Ib9a30d86b5cb0e9b3b7d5576ecb9498a9b316042
2020-11-17 21:57:23 +00:00
Colin Cross
3d68051218 Move genrule on top of RuleBuilder
In preparation for more complicated sandboxing support in sbox, use
a single implementation of the sbox sandboxing by moving genrule to
use RuleBuilder's sbox support instead of creating an sbox rule
directly.

Also move genrule's input list hash support into RuleBuilder.

Test: genrule_test.go
Test: rule_builder_test.go
Change-Id: I292184d02743c7e6887ebbcd232ba565db2ab0cc
2020-11-17 11:23:45 -08:00
Colin Cross
95f1ca07ce Store ndkKnownLibs in the config
Storing ndkKnownLibs prevents multiple tests from running in parallel
as one may be writing to the list while another is reading from it.
Store it in the config so each test has its own copy.

Test: go test -race ./apex
Change-Id: Iba57c9494012c9e0ae9e5ffaa63b9b2bd2c77492
2020-11-17 10:50:19 -08:00
Colin Cross
06fa588d1a Store SingletonMakeVarsProviders in the config
Store SingletonMakeVarsProviders in the config instead of a global
variable to avoid races between tests running in parallel.

Test: all soong tests
Change-Id: I2ab64f368b5ac673fd985399d4421ed018abc562
2020-11-17 10:47:24 -08:00
Ulyana Trafimovich
cdcfd6e711 Merge changes Iebfbf2ff,Ibd974268 am: d8d8e726a5 am: c4232f60d6 am: f0c0057668 am: cd1d3a2141
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1478656

Change-Id: I128e7ce333b29eb55c478e1df7010cb196701dc1
2020-11-17 12:23:17 +00:00
Ulyana Trafimovich
d8d8e726a5 Merge changes Iebfbf2ff,Ibd974268
* changes:
  Rename fields and methods to reflect class loader context changes.
  Do not add dependencies of shared SDK libraries to manifest_fixer.
2020-11-17 10:22:00 +00:00
Colin Cross
17f97caac1 Merge "Revert "Annotate dependency tags for dependencies of installed files"" am: e3d308b5a5 am: 1e9bf4a2d4 am: 1c4a64d945 am: e0d4766afe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1500597

Change-Id: Ic89cbe63f9c323d64d5f937ee8f8d9ec08da1af8
2020-11-17 07:55:11 +00:00
Colin Cross
e3d308b5a5 Merge "Revert "Annotate dependency tags for dependencies of installed files"" 2020-11-17 06:32:57 +00:00