Commit graph

20641 commits

Author SHA1 Message Date
Colin Cross
bca9028825 Set ANDROID_SDK_HOME when running lint
Lint tries to create ~/.android, set ANDROID_SDK_HOME to keep it
from attempting to write to the home directory, which may not be
writable.

Test: run lint
Bug: 159676171
Change-Id: I16375b88d309a8fa416b3a8efeabe15759889ae3
Merged-In: I16375b88d309a8fa416b3a8efeabe15759889ae3
(cherry picked from commit 977b6a822d)
2020-06-23 14:45:04 -07:00
Colin Cross
205a504053 Support adding extra lint checks
Add a lint.extra_check_modules property to list modules to use as
plugins to Lint.

Bug: 153485543
Test: m checkbuild
Change-Id: I25c7799438cfec43163e757637c65b8657488d36
Merged-In: I25c7799438cfec43163e757637c65b8657488d36
(cherry picked from commit 92e4b46af5)
2020-06-19 12:53:09 -07:00
Colin Cross
aaf58061a0 Allow kotlin modules to skip packaging the kotlin stdlib
Host tools like lint may package their own version of the kotlin
stdlib, and any jars loaded by them shouldn't contain the platform
version.  Add a static_kotlin_stdlib property that defaults to true
to allow building the module without staticalling including the kotlin
stdlib.

Bug: 153485543
Test: m ApiFinder
Change-Id: I7da78ef493806ce4ab0050e4ee9e8d330b0509c8
Merged-In: I7da78ef493806ce4ab0050e4ee9e8d330b0509c8
(cherry picked from commit 0b67a8bd0f)
2020-06-19 12:53:09 -07:00
Colin Cross
3791b45f67 Fix annotation processors in kotlin modules that generate resources
The kapt rule was only keeping the generated sources, and not the
generated classes directory.  The generated classes directory will
contain resources generated by the annotation processor and needs
to be added to the final jar.

Test: m ApiFinder
Bug: 153485543
Change-Id: I89197d0afcb1eee011c01aa400f9977e66f43768
Merged-In: I89197d0afcb1eee011c01aa400f9977e66f43768
(cherry picked from commit 9ca38d22a4)
2020-06-19 12:53:09 -07:00
Colin Cross
1e28e3c615 Add support for running Android lint on java and android modules.
Add a rule that runs Android lint on each java and android module
and produces reports in xml, html and text formats.

Bug: 153485543
Test: m out/soong/.intermediates/packages/apps/Settings/Settings-core/android_common/lint-report.html
Change-Id: I5a530975b73ba767fef45b257d4f9ec901a19fcb
Merged-In: I5a530975b73ba767fef45b257d4f9ec901a19fcb
(cherry picked from commit 014489c1e6)
2020-06-18 11:01:47 -07:00
Colin Cross
1c14b4ecf6 Consolidate adding common java properties
Use a method to add the properties that are present on all java modules.

Bug: 153485543
Test: m checkbuild
Change-Id: I7803b15eb0de810c8ab8d4b9acf2511935a26fb6
Merged-In: I7803b15eb0de810c8ab8d4b9acf2511935a26fb6
(cherry picked from commit ce6734e666)
2020-06-18 11:01:47 -07:00
Jiyong Park
8d6286befe apex_sets is added to apexkeys.txt
apex_sets is a new module type that can be used to deliver pre-signed
APEXes, which previously could be done only via prebuilt_apex.

Soon gnow understands apex_sets module types and emits the signing info
of the modules to apexkeys.txt

Exempt-From-Owner-Approval: cherry-pic from AOSP

Bug: 158729168
Test: m
Merged-In: I9507375342ec053309660d94c931a79bf4f21218
(cherry picked from commit 8d6c51ebcc)
Change-Id: I9507375342ec053309660d94c931a79bf4f21218
2020-06-17 13:17:11 +09:00
TreeHugger Robot
78bb73972d Merge "Installed APKs should not have prebuilt_ prefix" into rvc-dev 2020-06-16 23:27:33 +00:00
Anton Hansson
c3754ba042 Merge "Let APEX build against preferred java_sdk_library_import" into rvc-dev 2020-06-16 17:47:16 +00:00
Sasha Smundak
854c14f334 Installed APKs should not have prebuilt_ prefix
Bug: 159031374
Test: treehugger & manual
Merged-In: I48f2595781efc1303c777619e082ce7765b73038
Change-Id: I86d8036e277ef978256d0a69de0edbb30a2bc304
2020-06-16 10:29:18 -07:00
Paul Duffin
f642a31ab5 Let APEX build against preferred java_sdk_library_import
If a java_sdk_library_import has a corresponding java_sdk_library then
make the java_sdk_library_import export both the xml and impl modules
created by the java_sdk_library.

Makes java_sdk_library_import consistent with java_sdk_library by
providing libraries within the same APEX access to the implementation
library instead of the stubs.

Bug: 158304459
Test: m nothing
      Test what happens when building com.android.tethering with and without
      a preferred "framework-tethering" java_sdk_library_import. Make sure that
      it does not change the generated APEX.
Merged-In: I2f4edea937ac377431a5696c92cbd467bded62ef
Change-Id: I2f4edea937ac377431a5696c92cbd467bded62ef
(cherry picked from commit eedc5d55ce)
2020-06-16 10:43:19 +01:00
Colin Cross
f4a5492ec9 Merge changes from topics "soong-inclusive-language", "soong_inclusive_language2" into rvc-dev
* changes:
  Use inclusive language in Android.bp files
  Use inclusive language in build/soong
2020-06-16 03:28:15 +00:00
Colin Cross
c8697f6ae5 Merge changes from topics "soong-dist", "tests-PathForSource" into rvc-dev
* changes:
  Add DistForGoal to MakeVarsContext
  Define Soong phony rules in Make
  Remove paths from cc.TestConfig
  Remove most paths from java.TestConfig
  Allow tests to bypass PathForSource existence checks
2020-06-16 03:27:32 +00:00
Colin Cross
287638be7e Fix using generated test configs for sh_test, python_test and rust_test modules
Annotate the test config properties with android:"path", and always
use LOCAL_FULL_TEST_CONFIG to pass the path to Make.

Bug: 157621988
Test: manual
Change-Id: I1c020e642f83d994d63c9e9cb56e686086d5acaa
Merged-In: I1c020e642f83d994d63c9e9cb56e686086d5acaa
2020-06-15 16:46:47 +00:00
Colin Cross
a44a6b27f9 Use inclusive language in Android.bp files
Bug: 158889297
Test: m checkbuild
Change-Id: Id9efbd99be54b191193eae1c5672230ca54cf1d2
2020-06-15 09:46:32 -07:00
Colin Cross
871b80fb77 Add DistForGoal to MakeVarsContext
Add methods to MakeVarsContext to allow Singletons to dist
artifacts without manually adding $(dist-for-goals) in Make.

Bug: 153485543
Test: m checkbuild
Change-Id: Ia5ddb31afe29329f2df0ae1297ed963c8c28e590
Merged-In: Ia5ddb31afe29329f2df0ae1297ed963c8c28e590
(cherry picked from commit 3cda0d8df9)
2020-06-15 09:46:31 -07:00
Colin Cross
95f7b34e8e Use inclusive language in build/soong
Bug: 158889297
Test: m checkbuild
Change-Id: Id07890b7cbc2397291a658ca00e86b43c743aafc
Merged-In: Id07890b7cbc2397291a658ca00e86b43c743aafc
(cherry picked from commit 440e0d0542)
2020-06-15 09:46:31 -07:00
Colin Cross
9855207d0e Define Soong phony rules in Make
To support dist-for-goals in Soong, we need to define all phony rules
in Make so that dist-for-goals can insert additional dependencies on
them.  Collect all the phony rules in phonySingleton and write them
out as Make rules when Soong is embedded in Make, or as blueprint.Phony
rules when Soong is run standalone.

Bug: 153485543
Test: m checkbuild
Change-Id: I68201eff30744b0f487fc4f11f033767b53a627d
Merged-In: I68201eff30744b0f487fc4f11f033767b53a627d
(cherry picked from commit c3d87d3112)
2020-06-15 09:46:31 -07:00
Colin Cross
5a3458ddc0 Remove paths from cc.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove them from cc.TestConfig.

Bug: 153485543
Test: all soong tests
Change-Id: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
Merged-In: I90cd7b4dfc49c156afbb0eea9a77159c3e1860fa
(cherry picked from commit 2fce23ae6d)
2020-06-15 09:46:31 -07:00
Colin Cross
f5f663b0c3 Remove most paths from java.TestConfig
Now that tests don't need to specify every path passed to
PathForSource or PathForModuleSrc, remove most of them from
java.TestConfig.  Leave a few that are globbed by lots of tests,
and move a few that are globbed by a single test into the tests.

Bug: 153485543
Test: all soong tests
Change-Id: Ica91d7203a6a7dbca0fd4fed84c78f149b8699e1
Merged-In: Ica91d7203a6a7dbca0fd4fed84c78f149b8699e1
(cherry picked from commit 238c1f3903)
2020-06-15 09:46:31 -07:00
Colin Cross
f77c720b08 Allow tests to bypass PathForSource existence checks
Forcing every test to specify every file it wants to pass to
PathForSource or PathForModuleSrc is painful to maintain and
doesn't add any value.  Allow tests to reference paths through
PathForSource and PathForModuleSrc without specifying them in
the mock FS.

Bug: 153485543
Test: all soong tests
Change-Id: Ia8a8fd965a338d0645b3721314bf91f50146ad21
Merged-In: Ia8a8fd965a338d0645b3721314bf91f50146ad21
(cherry picked from commit 5e6a797982)
2020-06-15 09:46:31 -07:00
Colin Cross
03aa290b52 Merge "Add eakammer and patricearruda to OWNERS" into rvc-dev 2020-06-15 16:38:27 +00:00
Colin Cross
0fd3329a3c Add eakammer and patricearruda to OWNERS
Bug: 0
Test: none
Change-Id: I4209fc5149dcce6bf75aef130afc69c4600c7f3b
Merged-In: I4209fc5149dcce6bf75aef130afc69c4600c7f3b
(cherry picked from commit b83929c944)
2020-06-15 16:38:09 +00:00
TreeHugger Robot
b1522d9990 Merge "Implement test config auto-gen for sh_test." into rvc-dev 2020-06-15 16:37:06 +00:00
TreeHugger Robot
a5fa9f6df9 Merge "Fix type assertion error regarding dex_import" into rvc-dev 2020-06-15 10:40:17 +00:00
frankfeng
d17bc61421 Implement test config auto-gen for sh_test.
Supports the following properties:
- Require_root
- Test_config_template
- Auto_gen_config

Test config template is in a separate CL.

Bug: 148805488
Bug: 151761373

Test: make
Test: unit tests
Test: verified with bc_test & toybox-tests
Change-Id: I63d60a153a6abda4ce30b74d3eb915fbf6389cb8
Merged-In: I63d60a153a6abda4ce30b74d3eb915fbf6389cb8
(cherry picked from commit c5b8749853)
2020-06-15 16:46:35 +08:00
TreeHugger Robot
ddac56e375 Merge "Make override modules compatible with prebuilts." into rvc-dev 2020-06-12 03:44:53 +00:00
Ramy Medhat
8321caa129 Merge changes from topic "metalava_sandbox" into rvc-dev
* changes:
  Turn on metalava sandbox warning in all droiddoc metalava invocations.
  Add support for Metalava implicit dependencies for remote execution.
  Add sourcepath to inputs of remoteable metalava action.
  Add support for the remote execution of metalava actions.
2020-06-12 01:24:14 +00:00
Jaewoong Jung
e50fe61acc Make override modules compatible with prebuilts.
Prebuilt's prefer flag doesn't work against override modules because
override modules are sort of virtual modules that delegate all the work
to their base modules. Therefore, even if a prebuilt module suppresses
installation of its src-counterpart override module, the actual build
actions are still performed in the base module.

This change fixes it by filtering out override modules that are being
replaced by prebuilts.

Test: prebuilt_test.go
Fixes: 152155285
Change-Id: I859b35c0629b2b6258dd1ec5e020ba2c77ff9612
Merged-In: I859b35c0629b2b6258dd1ec5e020ba2c77ff9612
2020-06-11 18:16:50 -07:00
Ramy Medhat
7f2006c091 Turn on metalava sandbox warning in all droiddoc metalava invocations.
Bug: b/156613606
Test: built aosp crosshatch userdebug with RBE_METALAVA=1 and dependency
file support.

Change-Id: I5ca637984429df12fe05bb07f5db154be9b24f97
Merged-In: I5ca637984429df12fe05bb07f5db154be9b24f97
2020-06-11 17:57:22 +00:00
Ramy Medhat
8e9b63b6ff Add support for Metalava implicit dependencies for remote execution.
Bug: b/156613606
Test: built aosp crosshatch userdebug with RBE_METALAVA=1
Change-Id: Ic64d98785e34717ef9bdad62b4885085f84f132a
Merged-In: Ic64d98785e34717ef9bdad62b4885085f84f132a
2020-06-11 17:57:12 +00:00
Ramy Medhat
46bad760ec Add sourcepath to inputs of remoteable metalava action.
Bug: b/156613606
Test: presubmit
Change-Id: Idd77abddac0a676302226eb62883c74d5d7489af
Merged-In: Idd77abddac0a676302226eb62883c74d5d7489af
2020-06-11 17:55:36 +00:00
Stephen Hines
26d6b7834c Update LLVM toolchain to r383902b.
Bug: http://b/149417653
Test: m
Change-Id: I0e191b463852da8b5eb5a4e092ef9b5da255df3d
(cherry picked from commit b31d77e57c)
2020-06-11 02:28:58 -07:00
Ramy Medhat
1fb3cd8496 Add support for the remote execution of metalava actions.
Bug: b/156613606
Test: built aosp crosshatch userdebug with RBE_METALAVA=1
Change-Id: I3d42d75b4522f99ff95ce8c997ead782e4322f6e
Merged-In: I3d42d75b4522f99ff95ce8c997ead782e4322f6e
2020-06-11 00:52:07 -04:00
Jiyong Park
e26a63e2fd Fix type assertion error regarding dex_import
Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f made it possible to add
dex_import modules into apex, but that change had a bug. When creating
Android.mk for the dex_import module, the code executed an unchecked
type assertion to convert java.DexImport to java.Dependency, which
cannot be successful. This change fixes the bug by doing a checked type
assertion instead.

Exempt-From-Owner-Approval: cp from AOSP

Bug: 157886942
Test: m (test added)
Merged-In: Id22c20d42effce539fab10b0d349bf340d467f02
(cherry picked from commit 9e83f0b531)
Change-Id: Id22c20d42effce539fab10b0d349bf340d467f02
2020-06-11 09:47:16 +09:00
Jaewoong Jung
829b7135f3 Use Targets[Android] instead of DeviceArch funcs.
NDK prebuit script doesn't set device arch product variables, and so
causes SupportedAbis to panic.

Fixes: 158673325
Test: app_test.go, apex_test.go
Test: build-ndk-prebuilts.sh
Change-Id: I8331ef5bca12301318510ec9712770fd8d3a26a9
2020-06-10 12:30:51 -07:00
Paul Duffin
4754d4451c Merge "java_sdk_library: Add system-server scope" into rvc-dev 2020-06-10 13:01:31 +00:00
Victor Khimenko
78f654c6cf Make it possible to specify separate rules for native_bridge case
This change make it possible to specify separate rules for native-bridge
case and non-native-bridge case.

Bug: http://b/153609531

Test: build 4arch product

Change-Id: I60145bbb9c94318f14af3cabd9f5960fc9ee62de
Merged-In: I60145bbb9c94318f14af3cabd9f5960fc9ee62de
2020-06-09 23:35:37 +02:00
Alexander Smundak
feee554806 Merge "Cherrypick aosp/1318079 and aosp/1324841" into rvc-dev 2020-06-08 20:09:10 +00:00
TreeHugger Robot
50cea1a76e Merge "Include car project in grey list removed apis" into rvc-dev 2020-06-08 18:07:38 +00:00
Paul Duffin
5a757b1ebb java_sdk_library: Add system-server scope
Bug: 155164730
Test: m nothing
Change-Id: I49a2dab5c064b05f16691a3fae65f2b4ffc53bfd
2020-06-08 15:27:58 +01:00
Paul Duffin
a109682456 Merge "Copy removed.txt file to the snapshot correctly" into rvc-dev 2020-06-08 13:03:14 +00:00
Jiyong Park
afd3d11a79 dex_import that isn't available for platform isn't installed
This change fixes a bug that dex_import module is always installed to
the platform even when the module is not available to the platform.

Bug: 158284983
Test: OUT_DIR=/tmp/ndk build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I85570506e700be59ee63e4f1d7902a40e36df39c
2020-06-08 19:59:02 +09:00
Sasha Smundak
c4f0ff1d6c Cherrypick aosp/1318079 and aosp/1324841
Allow apex module to have android_app_set as its constituent.
Fix android_app_set documentation

Fixes: 157166068
Test: treehugger & manual
Change-Id: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: I9f91f1b761286f489d175eb0772f78f702e8a2d6
Merged-In: Id9b296d9301902deb463b299413491bc66d58944
2020-06-05 15:39:38 -07:00
Jaewoong Jung
0011ebcd34 [automerger skipped] Add apex_set module. am: 9c49b285f2 am: 60ff397cc8 -s ours
am skip reason: Change-Id I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7 with SHA-1 8cf307e754 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11721758

Change-Id: I70bff9201c2a1caf166e912ca4021c4bcd6ebfa8
2020-06-05 17:57:32 +00:00
Sasha Smundak
f1fee4a692 [automerger skipped] Implement android_app_set module am: 8539023170 am: 3ed701b6c5 -s ours
am skip reason: Change-Id Id0877476f9ae23311d92c0b59a9c568140ab4119 with SHA-1 4de27a5757 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11720097

Change-Id: I014e3fe4cb700041b6b461f4885f123270ab5889
2020-06-05 17:57:23 +00:00
Sasha Smundak
691c817e3a [automerger skipped] Implement extract_apks am: 97d511a16d am: f5eec5c80c -s ours
am skip reason: Change-Id Ia15d66e86c7bcfd52f5b776173ca1665b68ff438 with SHA-1 bbf0579ac7 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11720096

Change-Id: If5bf6165fb8d71109861611caca3f783031dbaf1
2020-06-05 17:57:21 +00:00
Jaewoong Jung
60ff397cc8 Add apex_set module. am: 9c49b285f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11721758

Change-Id: I9f4f988b0e654067aaa413a3734c0ec656e34170
2020-06-05 17:38:29 +00:00
Sasha Smundak
3ed701b6c5 Implement android_app_set module am: 8539023170
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11720097

Change-Id: I6c38c7268d3a325aa7526dddfc9a5f5b3589877d
2020-06-05 17:38:11 +00:00
Sasha Smundak
f5eec5c80c Implement extract_apks am: 97d511a16d
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/11720096

Change-Id: I347822a7e70aea5121135779a9f5cbb8a6de592f
2020-06-05 17:38:07 +00:00