Commit graph

11872 commits

Author SHA1 Message Date
Pete Gillin
a53ae43180 Merge "Don't specify -encoding twice in Jdiff javadoc invocations." 2019-06-11 11:21:37 +00:00
Treehugger Robot
b879fb6b4b Merge "Separate exported includes out of flags" 2019-06-11 04:57:47 +00:00
Treehugger Robot
588857b418 Merge "Refactor .aar resource compilation" 2019-06-11 04:03:51 +00:00
Treehugger Robot
d1fcc4a93d Merge "Add dependency to version script when linking stub libraries" 2019-06-11 03:59:42 +00:00
Josh Gao
a1738e2c00 Merge "Revert "Revert "Revert "Revert "Enable lld for windows""""" 2019-06-11 01:43:42 +00:00
Inseob Kim
6937844c29 Separate exported includes out of flags
Exported includes have been maintained along with other C/C++ flags.
This makes dependencies unclear, and users have had to parse flags to
get exported directories. This separates exported includes and
exported flags, thus making data more structured and explicit.

Bug: 132818174
Test: m
Change-Id: I5c25ac2224988c4a67e4db6fd6e4d39090b74041
2019-06-11 10:37:56 +09:00
Treehugger Robot
4b0cc8c3c5 Merge "Fix sysprop_library build err when using filegroup" 2019-06-11 01:21:44 +00:00
Dan Willemsen
939408aa22 Add dependency to version script when linking stub libraries
This isn't an effective issue with local builds currently, since the
version script is generated from the same rule as the sources used to
compile the objects that are also used in the link command. But if we
ever separated those paths or adopted restat, we could miss this
dependency.

This is also required for my RBE build to actually expose this file to
the link step.

Test: treehugger
Change-Id: I32bbb18cf7edddc88759d4f445d081868f3e9b44
2019-06-10 18:02:25 -07:00
Colin Cross
dc35e21124 Consolidate *MutatorContext and ModuleContext into BaseModuleContext
Following 99bdb2ab4fd5168a71a20aecf10611425be47ec4 in build/blueprint,
move more methods into BaseModuleContext.

This reapplies I9f8df94f1ae2b55d3cccf7b9468247f3e7cb2ebd after fixing
missing errors thrown for missing defaults modules when
AllowMissingDependencies == true.

Test: m checkbuild
Test: defaults_test.go
Change-Id: Ia17b2bcbf2bac6889c419b2e73953946f6aa40ad
2019-06-10 16:30:35 -07:00
Colin Cross
0e99175bb6 Add test for missing defaults modules with AllowMissingDependencies
Test: defaults_test.go
Change-Id: Ic71892c379f8850996ea4dd94f606f4e937591df
2019-06-10 15:51:06 -07:00
Colin Cross
b88b3c5e77 Capture missing dependency error rules
Allow missing dependency errors to be tested by capturing the
missing dependency error rule instead of the originally requested
rule.

Test: all soong tests
Change-Id: Id2b23b9ee354cdafc44fb9adfaf8fe7bab973478
2019-06-10 15:51:06 -07:00
Colin Cross
2ffb9a8d7d Share buildDir for android/soong/android tests
There is no need to create a separate buildDir for each test
file, use TestMain to create a global one for the package.

Test: all soong tests
Change-Id: I435ee7aa88b7e0bb8ccc1ba79f82833a7accf3e9
2019-06-10 15:51:06 -07:00
Colin Cross
6c4f21f3a1 Reimplement AddMissingDependencies
AddMissingDependencies is needed in BaseModuleContext in order
to allow PathsForModuleSrc and friends to be called in mutators,
It's not a simple move, as it currently writes to a module
field that would be lost if any mutators cloned new variants
by calling CreateVariations.  Reimplement it using a mutated
property instead.

Test: m checkbuild
Change-Id: I851125065e4c5302b552773dae4640426c62965e
2019-06-10 15:51:06 -07:00
Colin Cross
59037628f4 Add GenerateAndroidBuildActions to DefaultsModuleBase
Add an empty GenerateAndroidBuildActiosn to DefaultsModuleBase
so that every defaults module doesn't need to provide one.  This
will also allow adding an implementation in the next patch.

Test: m checkbuild
Change-Id: I13554bdb3a287c2f18e1efab74d4f08a1ba8620c
2019-06-10 13:51:17 -07:00
Josh Gao
75a50a2c15 Revert "Revert "Revert "Revert "Enable lld for windows""""
This reverts commit b20200b3f5.

Bug: http://b/110800681
Test: manual
Change-Id: Id3eb45ed29f3977fef3da241ec2c43755116d60c
2019-06-10 12:59:11 -07:00
Treehugger Robot
b6fd6f75f2 Merge "Clean up sortedKeys function" 2019-06-10 19:16:14 +00:00
Colin Cross
90ef4b9c12 Merge "Revert "Consolidate *MutatorContext and ModuleContext into BaseModuleContext"" 2019-06-10 17:58:10 +00:00
Colin Cross
380c69aab4 Revert "Consolidate *MutatorContext and ModuleContext into BaseModuleContext"
This reverts commit 7e0a2cb590.

Reason for revert: broke TARGET_BUILD_APPS builds

Change-Id: I5316a62f77bb38f6195e3df5e31b073dbd1eb682
2019-06-10 17:49:58 +00:00
Colin Cross
a6bf56d4be Merge changes I9f8df94f,I2d7f5c56,I0ebb7381,Ieefcfc1a
* changes:
  Consolidate *MutatorContext and ModuleContext into BaseModuleContext
  Consolidate baseContext, BaseContext, and BaseModuleContext
  Rename ModuleBase receivers
  Remove repetition in android package names
2019-06-10 16:38:11 +00:00
Inseob Kim
da63a49338 Fix sysprop_library build err when using filegroup
.sysprop files are intended to be used only with sysprop_library, and we
can prevent build error by specifying dependencies upon CreateModule.

Bug: 131708148
Test: 1) try building sysprop_library module.
Test: 2) see liblog is correctly linked.
Change-Id: I702cedc255ee0b6a30c15e474dd6a88d9607b145
2019-06-10 14:18:13 +00:00
Roland Levillain
9efb8c773f Have symlink_preferred_arch: true honor the stem property.
If a module defines a `stem` property, use it to name the symlink
created for `symlink_preferred_arch: true` (instead of the module's
name).

Also always require suffixes when using `symlink_preferred_arch: true`.

Test: m
Change-Id: Ia8a56f94d21599194797ef8b259f5f03e08cb16a
2019-06-10 15:03:44 +01:00
Pete Gillin
2b1ea2edb3 Don't specify -encoding twice in Jdiff javadoc invocations.
The option '-encoding UTF-8' is included in the opts defined at L1754,
which are passed to transformJdiff (defined at L1594), and from there
to a javadoc rule (defined at L29), where they are included in a
command line string which already has '-encoding UTF-8' in it. The
result is that this appears twice in the command line. This is
apparently ignored by the version of javadoc currently used. Later
upstream versions of javadoc, however, fail with the error 'javadoc:
error - The -encoding option may be specified no more than once.'

Test: make system-api-stubs-docs
Test: make system-api-stubs-docs, using an OpenJDK 11 toolchain via OVERRIDE_ANDROID_JAVA_HOME
Bug: 131683177
Change-Id: Ib9382ada3c8259edfacb2be3ab14d4c09d8753a7
2019-06-10 14:37:41 +01:00
Inseob Kim
1a365c6a7f Clean up sortedKeys function
This introduces a generic function SortedStringKeys which can be used to
get a slice of sorted string keys for all kinds of maps having string
keys.

Bug: N/A
Test: m
Change-Id: I542194c68984d909b7ad1dbf060d4d3a98f0ef23
2019-06-08 16:10:38 +09:00
Lokesh Gidra
50e91c1a7a Revert "Switch to toybox timeout."
This reverts commit e9f471635f.

Reason for revert: Multiple art-test failures

Change-Id: I550864c23485a438889ab73c7e4a877cd730cabb
2019-06-08 00:46:09 +00:00
Elliott Hughes
7da326dd88 Merge "Switch to toybox sed (again)." 2019-06-07 23:25:06 +00:00
Josh Gao
46160c6423 Merge "Revert "Revert "Revert "Enable lld for windows"""" 2019-06-07 22:40:42 +00:00
Colin Cross
7e0a2cb590 Consolidate *MutatorContext and ModuleContext into BaseModuleContext
Following 99bdb2ab4fd5168a71a20aecf10611425be47ec4 in build/blueprint,
move more methods into BaseModuleContext.

Test: m checkbuild
Change-Id: I9f8df94f1ae2b55d3cccf7b9468247f3e7cb2ebd
2019-06-07 13:29:12 -07:00
Elliott Hughes
c1bfeed81b Switch to toybox sed (again).
The pathological case has been fixed, so let's see if it sticks this
time.

Test: treehugger
Change-Id: I043d823b05dd8796764e008c5e16e3563b80cec8
2019-06-07 13:10:04 -07:00
Elliott Hughes
0db3e1e667 Merge "Switch to toybox timeout." 2019-06-07 20:08:04 +00:00
Josh Gao
b20200b3f5 Revert "Revert "Revert "Enable lld for windows"""
This reverts commit 6d8c0a50bc.

The switchover to lld appears to be making adb crash on exit for unclear
reasons. Revert it as a quick fix pending further investigation.

Bug: http://b/134613180
Test: adb.exe under windbg
Change-Id: Ibdf5981c3c6828b3684974b7c30a7c96449c64c5
2019-06-07 12:34:18 -07:00
Pete Gillin
14bb14e0c3 Merge "Disable the system-modules plugin for jlink invocations." 2019-06-07 10:35:56 +00:00
Elliott Hughes
e9f471635f Switch to toybox timeout.
Test: treehugger
Change-Id: Ieea84deac5d0ccef0f3d4949aa1ba870d406e482
2019-06-06 21:41:48 -07:00
Colin Cross
0ea8ba82fc Consolidate baseContext, BaseContext, and BaseModuleContext
blueprint.BaseModuleContext is the set of methods available to all
module-specific calls (GenerateBuildActions or mutators).  The
android package split the same functionality across baseContext (nee
androidBaseContext), BaseModuleContext, and BaseContext.
Consolidate all of them into android.BaseModuleContext.

Test: m checkbuild
Change-Id: I2d7f5c56fd4424032cb93edff6dc730ff33e4f1e
2019-06-06 20:01:31 -07:00
Colin Cross
4157e88427 Rename ModuleBase receivers
I3b23590b8ce7c8a1ea1139411d84a53163288da7 renamed AndroidModuleBase
to ModuleBase, but left the receivers called 'a'.  Rename them to
'm' to match the type.

Test: m checkbuild
Change-Id: I0ebb738152febfd9a2a56ac0b197f19f9e01a1e7
2019-06-06 20:01:23 -07:00
Colin Cross
25de6c30d3 Remove repetition in android package names
Types in the android package don't need to be prefixed with 'android'.

Test: m checkbuild
Change-Id: Ieefcfc1a2c4161d9c412f40ef31867149ec21aec
2019-06-06 17:24:01 -07:00
Treehugger Robot
42729b481a Merge "Allow arch-specific symlink_preferred_arch properties." 2019-06-06 19:10:41 +00:00
Pete Gillin
4eb6be32f6 Disable the system-modules plugin for jlink invocations.
This jlink plugin is intended to optimise startup times for Java
runtimes by embedding a pre-processed and pre-validated module graph
in the system image.

This provides no benefit on Android, since the Android runtime does
not make use of the module graph it produces. (It doesn't seem useful
on Android anyway, since the system image only contains one module,
namely java.base.)

Furthermore, the plugin causes the jlink invocation to fail when using
the jlink tool from OpenJDK 11. The issue here is the plugin uses
classes in the jdk.internal.module package to describe the module
graph; that package is not part of libcore and therefore not listed in
the module-info.java for java.base on Android; but the plugin has the
side-effect of adding the package to java.base; this causes jlink to
subsequently fail with an error "Module java.base's descriptor
indicates the set of packages is : <lots of packages>, but module
contains packages: <same packages plus jdk.internal.module>". (The
implementation of the plugin changed significantly in OpenJDK 10,
which is presumably why this issue does not occur using OpenJDK 9's
jlink.)

Therefore, it is safe and beneficial to disable the plugin.

Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make core-all-system-modules, using an OpenJDK 11 toolchain via OVERRIDE_ANDROID_JAVA_HOME and changing the jmod create invocation to use --module-version 11
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make droid, flash to device & sanity check
Bug: 131683177
Change-Id: I52333f32c88aa85cd3652ad91d50d9927ff61daf
2019-06-06 18:59:46 +01:00
Treehugger Robot
6d376a0de8 Merge "Use correct system_modules with core.current.stubs" 2019-06-06 16:05:16 +00:00
Dan Willemsen
1945a4b47d Convert cc aidl to rule builder
This fixes an incremental build issue where we didn't clean up old aidl
header files (or necessarily notice that they were updated).

We do this by declaring the header files as outputs in the build graph,
but this means that the src file name needs to be convertible to the
aidl package name, as that's how the header file paths are created. In
many cases, filegroups can be used to strip path prefixes from the aidl
files.

Bug: 112114177
Test: treehugger
Change-Id: If534ff3dbfac329dea9a7402e30be74495754160
2019-06-06 08:23:53 -07:00
Jaewoong Jung
96eac767df Merge "Touch up manifest if there's no source code." 2019-06-06 13:52:37 +00:00
Neil Fuller
ba88c41274 Use correct system_modules with core.current.stubs
The system_modules defn used with core.current.stubs
was core-system-modules which doesn't match. Instead,
this change uses core-current-stubs-system-modules.

Test: build
Change-Id: Ifb9e77b02bbb04c1cb39c6b9f97932c20d44d8ba
2019-06-06 14:15:00 +01:00
Treehugger Robot
c4253b0ac9 Merge "system-clang-format: Add IncludeBlocks: Preserve" 2019-06-06 01:37:08 +00:00
Tom Cherry
c077eefc1e system-clang-format: Add IncludeBlocks: Preserve
As of [1], the Google format, which we default to, uses IncludeBlocks:
Regroup, which sorts all includes with <> and without .h into the top
group reserved for libc headers, e.g.:

+#include <android-base/properties.h>
+#include <android-base/strings.h>
 #include <ctype.h>
 #include <stdlib.h>
 #include <sys/system_properties.h>

 #include <iostream>

-#include <android-base/properties.h>
-#include <android-base/strings.h>

This is accurate to the Google C++ style guide, which states that
other library headers should be included with "", however we have a
strong tendency to use <> for these headers for Android, so we must
revert this change.

Note, clang-format allows regexes for creating the blocks as well,
however, short of including all possible libc headers, I don't think
there's a way to differentiate between <sys/wait.h> and
<other_lib/header.h>.

[1]:
62e3198c4f (diff-b689ebff2e51e675b346a88289e74542)

Test: clang-format doesn't do the above.
Change-Id: Ifef605ffd6b4c8a36512377644e64ddd26b68a21
2019-06-05 15:30:14 -07:00
Jaewoong Jung
4f67c42d76 Merge "android_app stl property bug fix" 2019-06-05 20:16:13 +00:00
Treehugger Robot
ac1d267368 Merge "Add .jar tag to java modules" 2019-06-05 19:23:38 +00:00
Roland Levillain
d9bf9be007 Allow arch-specific symlink_preferred_arch properties.
Test: m
Bug: 133864678
Change-Id: Ia6e62156adda2b3a51220552bbe4dab738753674
2019-06-05 19:38:45 +01:00
Treehugger Robot
b4c35f3378 Merge "Support tagged module references" 2019-06-05 17:17:32 +00:00
Treehugger Robot
933d2a8e63 Merge "Remove extra word in soong.android.archMutator's comment." 2019-06-05 17:04:52 +00:00
Treehugger Robot
e52b978c2a Merge "Soong: Define a new Soong module named prebuilt_firmware." 2019-06-05 16:17:10 +00:00
Treehugger Robot
fe49f17535 Merge "Soong: Add mk2bp conversion for prebuilt_firmare." 2019-06-05 16:16:52 +00:00