Commit graph

8331 commits

Author SHA1 Message Date
Ryan Prichard
b1c9d40b6f NDK sysroot: include each license file only once
bionic/libc/NOTICE file is 6000 lines long and is referenced by 10
modules in bionic/libc/Android.bp. We're currently including 10 copies of
the license file, which makes it hard to view a "platform prebuilts" CL
in Gerrit.

For example, click "Expand All" on:
https://android-review.googlesource.com/c/platform/prebuilts/ndk/+/730825

Bug: none
Test: m out/soong/ndk.timestamp
Change-Id: I857e70d7d900688532ab988800c98bbd0899cc31
2018-08-24 13:28:04 -07:00
Treehugger Robot
141fe713fa Merge "pom2bp support to specify which modules are host modules" 2018-08-24 19:46:17 +00:00
Chih-Hung Hsieh
9e88ba9f22 Remove flto dependent flags when -flto is removed.
* C++ source files could be compiled with "-fwhole-program-vtables"
  in cppflags. We need to filter out those flto dependent flags
  in flags.CppFlags and use flags.toolingCppFlags instead of
  flags.cppFlags.

Test: build with WITH_TIDY=1
Change-Id: Ic2b0f99b95a5f0422f879226e6f6060cab71456a
2018-08-24 18:42:22 +00:00
Nan Zhang
2760dfc03c Revert "Revert "Make Metalava checkapi a seperate run.""
This reverts commit ec716b4151.

Reason for revert:
This is second attempt for Make Metalava checkapi a seperate run.

The first attept didn't work since Metalava also need sources,
classpath, and etc, not like how old Doclava apicheck works.

Test: cherry-pick go/ag/4832335 in internal master, and do 'm clean && m
-j checkapi', it failed with erros which is expected.
Bug: b/113126618, b/113131828

Change-Id: I664b7838d15615905a2e798b1df832218031dfe7
2018-08-24 11:37:33 -07:00
Jeff Gaston
d492853a52 pom2bp support to specify which modules are host modules
Bug: 112804807
Test: cd prebuilts/sdk/current/support && pom2bp -regen Android.bp
Change-Id: Ib816db8274cb05c9d0ed2cb557799ddcf6ee74fd
2018-08-24 14:32:50 -04:00
Nan Zhang
cde4e89c27 Merge "Revert "Make Metalava checkapi a seperate run."" 2018-08-24 15:59:59 +00:00
Nan Zhang
ec716b4151 Revert "Make Metalava checkapi a seperate run."
This reverts commit ed0a39dba7.

Reason for revert:
it seems checkapi can be passed successfully even if we didn't do update-api for new changes. roll-back for now and do more investigation.  

Change-Id: Idd54ea8919671d54aa6401233156d6c0bcf5325f
2018-08-24 15:59:17 +00:00
Treehugger Robot
ea5019a407 Merge "Make Metalava checkapi a seperate run." 2018-08-24 06:03:23 +00:00
Nan Zhang
ed0a39dba7 Make Metalava checkapi a seperate run.
We should not squeeze all the args to one Metalava run, especially for
checkapi.

Bug: b/113126618
Test: m -j checkapi, and check out dir api-stubs-docs.
Change-Id: I8d0c75745c7861b6de9070ef69f8e9284473a5d7
2018-08-23 17:30:38 -07:00
Chih-hung Hsieh
9045aa89e5 Merge "Use simpler per-file syntax." 2018-08-23 22:26:13 +00:00
Chih-hung Hsieh
a644fbfa2c Merge "Add clang-tidy.sh to filter out troublesome flags." 2018-08-23 22:23:59 +00:00
Chih-Hung Hsieh
615834ae65 Use simpler per-file syntax.
* Add owners to clang.go and tidy.go.

Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I28e5b1feb89d24cb26c9907368fb5f01533d283e
2018-08-23 12:58:56 -07:00
Tom Cherry
7803a011d1 Add $PRODUCT_OUT/ramdisk to installclean
Bug: 79173823
Test: installclean removes this directory
Change-Id: I56dabba29064709112caad6549af7eacbe8469e8
2018-08-23 11:12:29 -07:00
Nan Zhang
a05ff57f29 Support API compatibility check in Soong
Test: m -j api-stubs-docs
Bug: b/78245848
Change-Id: Id88a3e3716f9f07f0dc0071aa56a328c4712fcc9
2018-08-22 18:28:58 -07:00
Nan Zhang
66dc236781 Add support for dumping proguard api file.
Test: ref go/ag/4783442
Bug: b/70351683
Change-Id: I0aedd41686535c9a662b935003b80634e56663e0
Merged-In: I0aedd41686535c9a662b935003b80634e56663e0
(cherry-picked from commit: 26c055258b)
2018-08-22 13:59:48 -07:00
Chih-Hung Hsieh
a7aa958e6e Add clang-tidy.sh to filter out troublesome flags.
* Some flags are accepted by clang but not clang-tidy.
  They could cause the diagnostic-unused-command-line-argument warning.
  Flag -flto messed up the -I flags.
* Add clang-diagnostic-unused-command-line-argument to
  default clang-tidy checks.
* Move CLANG_TIDY_UNKNOWN_CFLAGS to build/make/core/clang/tidy.mk.

Bug: 111850071
Bug: 111885396
Test: build with WITH_TIDY=1
Change-Id: Iabeeb27715acf83ef6aafe3e77206b9a01a0d889
2018-08-22 09:21:45 -07:00
Treehugger Robot
158f2d9eaf Merge "Add C.utf8 to supported locales" 2018-08-22 00:56:54 +00:00
Treehugger Robot
9af53b4795 Merge "Fix overlaying android resources from static libraries" 2018-08-22 00:52:46 +00:00
Colin Cross
4aaa84af86 Fix overlaying android resources from static libraries
Match the make logic for combining app resources with static library
resources.

Bug: 112822358
Test: app_test.go
Test: aapt2 dump resources $OUT/system/priv-app/SystemUIGoogle/SystemUIGoogle.apk | grep -A1 ' string/config_systemUIVendorServiceComponent'
Change-Id: I565404e7ffb726dab952c72ab23600d6f2ee4ad4
2018-08-21 15:53:46 -07:00
Tao Bao
5761075443 Merge "Specify LOCAL_INSTALLED_MODULE_STEM for prebuilt_etc." 2018-08-21 22:35:48 +00:00
Tao Bao
e125532e12 Specify LOCAL_INSTALLED_MODULE_STEM for prebuilt_etc.
Otherwise the recovery variant gets installed with `.recovery` suffix.

Bug: 112780007
Test: Build with the mke2fs.conf change (using Android.bp to install
      mke2fs.conf). Check the installed filenames (under normal boot and
      recovery both).
Change-Id: I882be2fa07b530667a2dafc2bfe18730a42c4c08
2018-08-21 12:35:06 -07:00
Nan Zhang
443fa525df Hardcode "-source 1.8" for Doclava.
Due to various bugs hidden deeply within Doclava, running with
 "-source 1.9" is always failed for it.

So switch to "-source 1.8" for now. This includes the case of running the
combination of Metalava + Doclava. Once we have new documentation tool
in system, we can full deprecate Doclava.

Test: USE_R8=true EXPERIMENTAL_USE_OPENJDK9=true m -j core-docs
Bug: b/70351683
Change-Id: I9553f88d0dd9bc263a249c49075c0b931b5d4927
2018-08-21 11:19:53 -07:00
Aaron Kling
d236e0e4f5 Add C.utf8 to supported locales
Several Linux distros (e.g. Fedora) , use C.utf8 instead of C.UTF-8

Test: builds
Change-Id: I7e3dd73ec89bc34d7f2dc1834082cc90f9521ad1
2018-08-21 18:06:58 +02:00
Tao Bao
aefd64aacf Merge "Add recovery_available to prebuilt_etc." 2018-08-21 01:21:56 +00:00
Yifan Hong
7bbacf3478 Merge "s/product-services/product_services/g" 2018-08-21 01:07:56 +00:00
Treehugger Robot
9b4f9afbaf Merge "Add "hwaddress" sanitizer." 2018-08-20 23:22:35 +00:00
Treehugger Robot
06e36c737f Merge "Fix using defaults in android_app and android_test modules" 2018-08-20 22:21:32 +00:00
Treehugger Robot
910fff22e6 Merge "Append previous_api to "--migrate-nullness" option" 2018-08-20 22:12:54 +00:00
Colin Cross
b98c0f4c7d Fix using defaults in android_app and android_test modules
android_app and android_test modules weren't getting
InitDefaultableModule called on them.  Call InitJavaModule
which does both InitAndroidArchModule and InitDefaultableModule.

Test: m checkbuild
Change-Id: I26f3c04ea8bdfcacb59dcdbc63d6db5604c2598a
2018-08-20 13:45:45 -07:00
Colin Cross
91606c016e Fix template for native benchmark test config
Bug: 112851515
Test: rm libcore/AndroidTest.xml && atest libjavacore-benchmarks
Change-Id: I126550b6a90b06483e3ee1acec07659fa00fa8af
2018-08-20 13:45:32 -07:00
Nan Zhang
d05a436e8b Append previous_api to "--migrate-nullness" option
"--previous-api" option was not recommended after Metalava was
changed on how to consume the api file args.

Test: m -j api-stubs-docs
Bug: b/78245848
Change-Id: I1054173e11b4d47942dda0b95193277758aa8193
2018-08-20 13:28:41 -07:00
Dario Freni
95cf767918 s/product-services/product_services/g
Attempting to reduce the number of different spellings we have for
"product services" partition in the codebase.

Bug: 112431447
Test: m
Change-Id: I0a393a1d625e7ea3217d28735a4db709bce32395
Merged-In: I0a393a1d625e7ea3217d28735a4db709bce32395
2018-08-20 17:46:57 +00:00
Tao Bao
0ba5c94a94 Add recovery_available to prebuilt_etc.
The property is similar to the ones for cc_*, where it can additionally
create a recovery variant of the module when used.

Bug: 112780007
Test: Build mke2fs.conf with `recovery_available: true`.
Test: `go test -run TestPrebuiltEtc`
Change-Id: Ia04360d00453fa1f80022301feb369514f5e2b0b
2018-08-20 10:15:24 -07:00
Anton Hansson
43da16a440 Pass extra args from multiproduct_kati to config.
Allows specifying make goals when using multiproduct_kati, for example:
$ multiproduct_kati -only-config dump-products

This makes dumping products with multiproduct_kati easier than before.

Test: multiproduct_kati -only-config -products=full,aosp_arm64 -out=/tmp/p dump-products
Change-Id: If526bd2ba1b7bbadcb230c020202ef9e421e1852
2018-08-20 16:16:02 +01:00
Nan Zhang
55e0bf4231 Add update-api support for Metalava
Test: m -j api-stubs-docs-update-current-api
Bug: b/112668343
Change-Id: Ia91ae6969b01c21d88de7ceef4b25a73d0efd4a1
2018-08-17 12:38:15 -07:00
Nan Zhang
863f05b797 Removed Metalava related checks
Test: m -j checkbuild
Bug: b/70351683 b/78245848
Change-Id: Ie26e95081d8d90b626cfb43d017cb2ae500b7b25
Merged-In: Ie26e95081d8d90b626cfb43d017cb2ae500b7b25
2018-08-17 09:17:49 -07:00
Colin Cross
9b93a7dc70 Merge "Allow paths containing glob characters in glob results" 2018-08-17 02:43:22 +00:00
Colin Cross
a192c7370c Merge changes from topic "java_test_junit"
* changes:
  Don't pass resources to r8
  Support patch_module in java modules
  Make :module provide the output file for java modules
  Don't link java tests against junit by default
2018-08-17 02:35:40 +00:00
Colin Cross
e3924e180b Allow paths containing glob characters in glob results
Some paths contain glob characters.  For now allow paths with glob
characters as long as they are in glob results.  In the future we
may need to allow escaping glob characters.

Test: m checkbuild
Test: paths_test.go
Change-Id: I1cbeea658e8fc4975ca0b6a50a8c24ac2de026c5
2018-08-16 17:03:56 -07:00
Colin Cross
331a1213b0 Don't pass resources to r8
R8 complains when it gets dex files in the input jar, but some tests
use dex files or dex jars as resources.  Keep resources separate
from classes until after r8 has been run.

Test: java_test.go
Test: m checkbuild
Change-Id: I1d9164d60d6b054ebb138648da07d80ee769177f
2018-08-16 17:03:56 -07:00
Colin Cross
8144008360 Support patch_module in java modules
A few tests that have classes in the java.base module need to pass
--patch-module=java.base=<classpath> to javac.

Test: m checkbuild
Change-Id: I246bad92dcde976969b064aace5e2856e2bac971
2018-08-16 16:14:09 -07:00
Colin Cross
3063b78ea5 Make :module provide the output file for java modules
Make :module on a java_library provide the output file, which is
normally the implementation jar.  For java_library modules with
installable: true or compile_dex: true this will be the dexjar
instead.  For android_app modules this will be the apk.

Bug: 80144045
Test: no change to out/soong/build.ninja
Change-Id: I739674aee60a38bfccb859369e4414b46f293d82
2018-08-16 16:13:58 -07:00
Evgenii Stepanov
d97a6e9483 Add "hwaddress" sanitizer.
This is a new sanitizer similar to ASan, but with a few differences
from the build system perspective:
* Only runs on AArch64.
* Supports static binaries.
* Bionic itself will be built with HWASan.
* Does not have any "if a library is sanitized than the binary must
  be, too" requirements unlike ASan. Even better, individual static
  libraries can be freely sanitized or not. We propagate "nosanitize"
  from binaries to static libraries anyway, because otherwise there
  is no good way to disable hwasan on a binary as a whole.

Same a CFI, we export a list of sanitized static libraries to make.
In fact, we export separate lists for vendor and regular libraries,
because it is possible for one to be sanitized without the other
(i.e. there can be mylib.hwasan.vendor w/o mylib.hwasan or vice
versa).

Bug: 112438058, 112709969
Test: manual, part of a bigger patch set

Change-Id: Ie4fdeb522ac03cf9684526882e84dfee3807b6a7
2018-08-16 13:18:47 -07:00
Dan Willemsen
00fcb26f2f Remove POSIXLY_CORRECT from the build environment
Setting this will cause our invocation of ninja to fail. Even if we
fixed that, it's likely to run into other differences during the build.

Fixes: 112443729
Test: POSIXLY_CORRECT=1 m nothing
Change-Id: I0315955c9fd9536cc6cb0d7c700eed207f35cc80
2018-08-15 15:37:07 -07:00
Colin Cross
b628ea5327 Don't link java tests against junit by default
There is more variety of java tests than I expected, don't
default to including junit, that's just going to lead to
unexpected junit classes for module authors that don't know
to set junit: false.  All existing uses of java_test are
already not using junit or setting static_libs: ["junit"],
and all test in Make are already specifying junit.

Bug: 70770641
Test: m checkbuild
Change-Id: I4393b70d87dd2b6e3bb719fdb758915053bee0c7
2018-08-15 11:08:59 -07:00
Dan Willemsen
42740f2c78 Add lsof and ps to the allowed tool lists
lsof is used by goma to find its proxy daemon
ps is used on Mac instead of pstree in soong_ui

Test: none
Change-Id: Ifed7d09d604c00b7eebac1488a6f4658788d6e33
2018-08-15 10:14:40 -07:00
Dan Willemsen
14eae19b1c Add du, paste, xxd to allowed PATH tools
du is used by build/make/tools/releasetools/build_image.py
paste is used by system/core/rootdir/update_and_install_ld_config.mk
xxd is used by device/generic/goldfish/tools/mk_qemu_image.sh

Test: none
Change-Id: I707668578d1babe1b149c2c3f989e5f8be37d897
2018-08-14 23:08:56 -07:00
Colin Cross
d96ca35779 Support data properties in java_test and android_test
Files in the data property will be passed to
LOCAL_COMPATIBILITY_SUPPORT_FILES in Make.

Test: m checkbuild
Change-Id: Ifc074317f957aba8f55daa30abc5b9737d1eceac
2018-08-14 15:44:39 -07:00
Colin Cross
303e21f695 Move autogenerated test config into Soong
Move autogenerating the test config for Soong modules into Soong
for java_test and android_test modules.

Bug: 70770641
Test: m checkbuild
Test: atest CtsUiRenderingTestCases
Change-Id: I02593add0407ef694b91c14cf27411a4f3cc4745
2018-08-14 15:44:08 -07:00
Colin Cross
bd1cef5618 Add proguard_flags_files to r8 command line
We were not passing the proguard_flags_files files as -include
arguments to R8.

Bug: 112462307
Test: m checkbuild
Change-Id: I8f3b10fc338aa4b15c0fb220ee2891efbb0b020f
2018-08-13 17:29:58 +00:00