Commit graph

11967 commits

Author SHA1 Message Date
Roland Levillain
525d8dec66 Merge "Handle test_per_src test variations as dependencies of APEX modules." 2019-07-22 09:38:53 +00:00
Roland Levillain
0934737003 Merge "Create an extra variation in test_per_src mutator collecting all outputs." 2019-07-22 09:37:31 +00:00
Paul Duffin
2ac2befc9a Prevent runtime module paths being used in include_dirs
Adds a new StartsWith(string) ValueMatcher along with
With[Out]Matcher(...) methods to support new restrictions that prevent
any paths into runtime module repositories from being added to the
include_dirs.

Test: m nothing
Bug: 35624006
Change-Id: Ib954998e5fc190d8a11a8c6ac5f810cad927aac3
2019-07-19 19:36:25 +01:00
Paul Duffin
73bf054a52 Abstract property value matching logic behind an interface
Make it easy to add additional ways of matching property values. Needed
to add support for a 'starts with' matcher that can be used to restrict
allowable values in include_dir.

Test: m nothing
Bug: 35624006
Change-Id: I82e7d95f08847bf294aac311968e1d9f3e4b385d
2019-07-19 19:34:36 +01:00
Paul Duffin
60c0cd9a5f Merge "Add header_libs to cc_object" 2019-07-19 18:13:44 +00:00
Yi Kong
e6d0f62ce0 Merge "Use double dashes before llvm-strip arguments" 2019-07-19 16:55:27 +00:00
Yi Kong
93e6783410 Use double dashes before llvm-strip arguments
Newer llvm-strip no longer accepts single dash for multi-character
arguments.

Test: TreeHugger
Bug: 131328001
Change-Id: I4ca862d480860c00e7f8f644f79e300cb523dad0
2019-07-19 16:41:51 +00:00
Roland Levillain
9b5fde9ca4 Handle test_per_src test variations as dependencies of APEX modules.
If a test module with a `test_per_src` property set to `true` is
included in an APEX module, add all the variants for mutator
`test_per_src` as dependencies of the APEX module (not just the
first one).

This is done by adding variation "" of mutator `test_per_src` when
adding a test dependency to an APEX module, which creates an indirect
dependency of the APEX module on all the `test_per_src` variants of
the test module. When generating outputs for the APEX bundle, fetch
and include the set of test outputs from the "" variant.

Test: m (`apex/apex_test.go` amended)
Bug: 129534335
Change-Id: I1c99855971a8a9b2fc5b964a420e882b6791d4e6
2019-07-19 14:15:06 +01:00
Roland Levillain
f2fad97158 Create an extra variation in test_per_src mutator collecting all outputs.
Have `cc.testPerSrcMutator` create an additional variation named "",
having no sources (and generating no output file), but depending on
all other `test_per_src` variations and collecting their output files
in a new field named `cc.Module.testPerSrcOutputFiles`. This is useful
in the case where a module depends on all the `test_per_src`
variations of a test module.

Test: m
Bug: 129534335
Change-Id: I905decc0b9417f47cee9113466677d3bb61ad7b6
2019-07-19 14:15:06 +01:00
Treehugger Robot
b1469d53e7 Merge changes from topic "docs_circular_dep"
* changes:
  aidl include paths are exported to droiddoc
  filegroup.path is used to specify the include path for aidl files
2019-07-19 11:28:16 +00:00
Jiyong Park
19a7f251d3 aidl include paths are exported to droiddoc
This change fixes a bug that aidl include paths are not exported when a
java lib is used by a droiddoc module.

Bug: 135922046
Test: N/A
Change-Id: I367695677f60bfb4f324b788c7d09cd926cb75bb
2019-07-19 11:31:31 +09:00
Jiyong Park
2907459e43 filegroup.path is used to specify the include path for aidl files
filegroup {
    name: "foo",
    srcs: ["srcs/aidl/com/android/**/*.aidl"],
    path: "srcs/aidl",
}

cc_library { // or java_library, etc.
    name: "bar",
    srcs: [":foo"],
}

automatically adds "-Ipath/to/foo/srcs/aidl" when compiling the aidl
files from foo for bar. This allows us to omit aidl include path
when using sources in other places via file group.

Bug: 135922046
Test: m (unit tests added)
Change-Id: I9b42f316f2858fb6da72c2f58a314f391416e809
2019-07-19 11:31:31 +09:00
Colin Cross
eec9b286b0 Disable cc_fuzz darwin host modules
The fuzzer runtime is not present for darwin host modules, disable
cc_fuzz modules when targeting darwin.

Test: m on darwin
Change-Id: I9da319e00e36c3e0a5912329de7890a6409f1a55
2019-07-18 16:23:45 -07:00
Treehugger Robot
216e315a34 Merge "soong-ui: Redirect mmm to mmma." 2019-07-18 21:58:24 +00:00
Treehugger Robot
178f8fb732 Merge "Add the cc_fuzz target." 2019-07-18 20:38:33 +00:00
Treehugger Robot
80b562eb5b Merge "soong-ui: Redirect mm to mma." 2019-07-18 20:34:30 +00:00
Christopher Ferris
cc9a246063 Merge "Add liblog as shared dependency for isolated tests." 2019-07-18 19:00:46 +00:00
Jaewoong Jung
66bb414fb7 Merge "Java test code clean-up" 2019-07-18 17:35:18 +00:00
Jaewoong Jung
6f67daa93c Merge "Add overrides property to prebuilt_apex" 2019-07-18 17:35:07 +00:00
Patrice Arruda
a9e1215870 soong-ui: Redirect mmm to mmma.
This is the first part of deprecating the mmm command. mmm will simply
be redirected to mmma by building the list of modules with their
dependencies.

Bug: b/135187558
Test: Ran mmm external/libusb:libusb.
Change-Id: I50cf0d6a07197556ab6130e612561c6d5a3fb31e
2019-07-18 09:43:20 -07:00
Patrice Arruda
2274102f34 soong-ui: Redirect mm to mma.
This is the first part of deprecating the mm command. mm will simply
be redirected to mma by building the modules and their dependencies.

Bug: b/135187558
Test: Ran mm in external/protobuf directory.
Change-Id: Idad40f89e3768aeb459172f632a44fd7b0a201bc
2019-07-18 09:41:19 -07:00
Paul Duffin
a37832a3c3 Add header_libs to cc_object
Needed to allow removal of the include_dirs property from the
asm_defines.s module. Also, adds ObjectLinkerProperties to cc_defaults
so that default settings of header_libs are correctly prepended to the
properties in cc_object.

Bug: 35624006
Test: m cpp-define-generator-asm-support - compare output before and after change
Change-Id: Ib95d79c5eba4a89b7ab04b6c62090b720ec7e9fe
2019-07-18 15:58:58 +01:00
Jeffrey Vander Stoep
38aaf75e44 Merge "Renderscript: rename .rs extension to .rscript" 2019-07-18 02:02:00 +00:00
Christopher Ferris
34cbba6e16 Add liblog as shared dependency for isolated tests.
If liblog is a static library, then unit tests cannot properly
override log functions.

Test: Build isolated tests and run them.
Change-Id: Id202c5950518408ce66ceea70988dde8080fd1f9
2019-07-17 15:46:29 -07:00
Treehugger Robot
ed1f4def5c Merge changes Ieb4ffa10,I9458cbc4
* changes:
  soong_ui: Do not clean the OutDir path multiple times.
  soong_ui: Construct the proper MODULES-IN-<dir name> for m* build commands.
2019-07-17 20:53:38 +00:00
Jeff Vander Stoep
d612627169 Renderscript: rename .rs extension to .rscript
Reserve .rs extension for Rust.

Bug: 137365032
Test: make checkbuild
Test: cd frameworks/compile/slang/tests
    ./slang_tests.py
    Test: atest CtsRenderscriptTestCases
    Test: CtsRsCppTestCases

Change-Id: I0458009b8bb64a012fece364835d5b78d52e15e9
Merged-In: I0458009b8bb64a012fece364835d5b78d52e15e9
2019-07-17 18:57:32 +00:00
Treehugger Robot
7ad7e034f7 Merge "soong_ui: Do not find a build file if targets are specified." 2019-07-17 18:32:37 +00:00
Jaewoong Jung
f9a0443a9c Java test code clean-up
Remove unused parameters and make testJava return the config.

Test: Ran all java tests.
Change-Id: Iaa123f3fd93188e2f55452b887e1d340429cc710
2019-07-17 11:15:09 -07:00
Treehugger Robot
a0eb5a899f Merge "fix: APEX prebuilts are disabled in platform build" 2019-07-17 04:00:48 +00:00
Colin Cross
223e6a65b6 Merge changes from topic "buildnumberfromfile"
* changes:
  Allow jar wrapper to take quoted arguments
  Add rspfile support to RuleBuilder
  Prepare droiddoc for using RuleBuilder
  Manually escape BuildNumberFromFile
  Fix android.Expand and ninja escaping
  Add RuleBuilder helper functions for built and prebuilt tools
  Add documentation to droiddoc.go module types
2019-07-17 02:45:03 +00:00
Jaewoong Jung
22f7d18a5d Add overrides property to prebuilt_apex
Bug: 137218697
Test: apex_test.go
Change-Id: I55a42e1e4af60d6d7185515a380c786312b8b29b
2019-07-16 18:45:26 -07:00
Treehugger Robot
2e16e2d9e1 Merge "Use LLD for partialLd." 2019-07-17 00:53:20 +00:00
Jiyong Park
ca8992ea0b fix: APEX prebuilts are disabled in platform build
This change fixes a bug that APEX prebuilts are auto-disabled in
platform builds (i.e. non-unbundled builds).

Bug: 137282010
Test: m com.android.conscrypt
check that the apex is from prebuilt directory

Merged-In: I935ef3896e80864bdcc1ca5f6fc12b63c9588c0d
(cherry picked from commit 895e224d8f)

Change-Id: I935ef3896e80864bdcc1ca5f6fc12b63c9588c0d
2019-07-17 08:34:03 +09:00
Mitch Phillips
da9a463794 Add the cc_fuzz target.
Adds the cc_fuzz target via a cc_fuzz module. Also implements the
libclang runtime interface for the x86 toolchain to allow host-built
fuzzers.

Bug: 133261679
Bug: 137398545

Test: Build a fuzzer (with all topic patches), notice that you now
have a host-built fuzzer :)

Change-Id: I7fa069603415f40b3f12a002c253fca6e2aa1988
2019-07-16 16:30:53 -07:00
Colin Cross
63f4b57a7f Merge changes Ia106d48e,Ib6c0e778
* changes:
  Remove use of deprecated ExtractSourcesDeps
  Dedup path properties across property structs
2019-07-16 21:31:09 +00:00
Peter Collingbourne
84d8385ae1 Use LLD for partialLd.
Clang will soon start using relocations that are currently unsupported by
the version of ld.bfd that Android uses when HWASAN is enabled. This will
cause partialLd to fail since the clang driver defaults to ld.bfd.

Switch to using LLD, since it will support those relocations.

Change-Id: I0964f53dc63773f3b52bb377f863df9c39961a07
2019-07-16 14:14:36 -07:00
Patrice Arruda
19bd53e39c soong_ui: Do not clean the OutDir path multiple times.
If OUT_DIR has been specified through the command line arguments,
it is sanitized first and NewConfig sets the OUT_DIR in the build
environment. When calling OutDir from Config instance, the out
was being sanitized again which is unnecessary.

Bug: b/118730755
Test: Ran unit test cases, "lunch" followed by "m" command.
Change-Id: Ieb4ffa1026c802c76c7369e8cdb3923a4c70f4b3
2019-07-16 11:22:22 -07:00
Patrice Arruda
0dcf27f639 soong_ui: Construct the proper MODULES-IN-<dir name> for m* build commands.
Previously, any of the build commands (mma, mmma, etc...) would traverse
up the directory path until an Android build file has been found. That
directory path would eventually become the MODULES-IN-<dir name> build
target. The directory where the m* command was executed may contain a
build file in a sub directory. For that case, the build target is the
MODULES-IN-<dir name> where dir is the directory of the executed m*
command since the target has been constructed by the core makefile.

Bug: b/118730755
Test: Wrote and ran unit test cases. Ran "lunch", "m". Went to a
      directory in AOSP that had build files in sub directories and
      executed mma. Went to a directory that had only build files in
      parent directories and executed mma.

Change-Id: I9458cbc4bf0fc25bfb0848e96e92d261442d5cb0
2019-07-16 11:19:05 -07:00
Colin Cross
e5cae33f5d Allow jar wrapper to take quoted arguments
Make the jar wrapper script correctly handle quoted arguments with
spaces in them.  Also allow JVM arguments in the form -J-XX, not just
-JXX.

Test: m checkbuild
Change-Id: Iec5105bc390f2a12c6a4cda7f76d37585c39f520
2019-07-16 11:12:04 -07:00
Colin Cross
0cb0d7b1c5 Add rspfile support to RuleBuilder
Allow RuleBuilderCommands to use an rspfile with FlagWithRspFileInputList.
This requires being more careful with ninja escaping, as the rspfile
will be $out.rsp, and the value for $out may not be known yet so it
must be inserted as a ninja variable that must not be escaped.

Test: rule_builder_test.go
Change-Id: Ifa91e24a0bb8f0ceeb5c9bfa5689be2a4ff3b9cd
2019-07-16 11:12:04 -07:00
Colin Cross
1563815780 Prepare droiddoc for using RuleBuilder
Move the ninja escaping of Args later so that they can be passed to
RuleBuilder without double escaping.

Test: m docs
Change-Id: Iac3560a12c05d010e6bd0ad9c2d6b1e18ebf5f89
2019-07-16 11:12:04 -07:00
Colin Cross
5822b552ef Manually escape BuildNumberFromFile
Change ctx.Config().BuildNumberFromFile() to be unescaped, and then
escape it manually where necessary.  This will allow passing
ctx.Config().BuildNumberFromFile() to RuleBuilder, which will handle
the necessary escaping.

Test: no change to out/soong/build.ninja
Change-Id: I5329ab2ba70ccea49958864488aa81794a7e4b56
2019-07-16 10:23:41 -07:00
Colin Cross
5cfc70d1f6 Remove use of deprecated ExtractSourcesDeps
Tag DexImportProperties.Jars with `android:"path"` and remove the
call to ExtractSourcesDeps.

Test: m checkbuild
Change-Id: Ia106d48ecf7e3fc98637a757a9812edcf65f5b82
2019-07-16 09:52:23 -07:00
Colin Cross
527f3e5511 Dedup path properties across property structs
Listing a property in multiple property structs would cause it to
add multiple dependencies with the same dependency tag, which would
trip the panic in getDirectDepInternal when calling
PathForModuleSrc.  Dedup the properties with the android:"path"
struct tag across all property structs.

Test: path_properties_test.go
Change-Id: Ib6c0e7789443d340ee7551721df0135c5ee64c0f
2019-07-16 09:52:23 -07:00
Dimitry Ivanov
2ca7a8835e Merge "Make relative path for native_bridge binaries configurable" 2019-07-16 09:17:35 +00:00
Treehugger Robot
0f7dbd0d55 Merge "soong: Fix AndroidMk with *Required properties" 2019-07-16 02:09:29 +00:00
Treehugger Robot
34b1b27981 Merge "Fix a bug in generateNoticeRule." 2019-07-16 00:47:58 +00:00
dimitry
8d6dde8831 Make relative path for native_bridge binaries configurable
This change introduces NativeBridgeRelativePath and
NativeBridgeSecondaryRelativePath product variables to
make relative path to native_bridge binaries configurable.

It also removes moves information about native bridge
host architecture to Target and sets it during decodeTargetProductVariables

Test: make PRODUCT-cf_x86_phone-userdebug dist
Change-Id: Ie736e81eae507e1775566ce9f29135011b12af27
2019-07-15 20:04:07 +02:00
Jaewoong Jung
825c8143f5 Fix a bug in generateNoticeRule.
A $ sign was missing in some commands, which caused an error to mac
builds.

Test: TreeHugger
Fixes: 137364089
Change-Id: Iabd03ed4053d1179fa65a66d1615fcdf279fba12
2019-07-15 11:03:22 -07:00
Jooyung Han
12df5fb471 soong: Fix AndroidMk with *Required properties
java.Module is using "Custom" function to write Android.mk.
And if "hostdex" is set to "true", it writes "hostdex" module definition
as well as original module.

As of now, Required/Host_required/Target_required props are filled in
the AndroidMkEntries structure(aosp/939505). But these are not
passed to old AndroidMkData.Custom function.

So, if a java_library declares "hostdex:true" and "required:[...]"
together, "required" is not applied to the "hostdex" variant.

This change copies *Required props from AndroidMkEntries to
AndroidMkData before calling its Custom callback.

Test: m (runs soong unit tests)
Change-Id: I5f85714f721a2a0917ab18072dbea52294c770e7
2019-07-16 02:28:29 +09:00