Commit graph

4792 commits

Author SHA1 Message Date
Jeff Gaston
0c573d383d Have diff_build_graphs.sh print the number of lines in the diff
Bug: b/69133815
Test: build/soong/diff_build_graphs.sh \
      'build/soong:work^' 'build/soong:work'

Change-Id: Iaeb66ba53e1b3d7ddd4b4551b3ac29b12ce227c5
2017-11-29 12:54:43 -08:00
Jeff Gaston
5313911912 Merge "Sort cfi static libs to make them consistent" 2017-11-29 19:58:38 +00:00
Treehugger Robot
8763169bdb Merge "Add TEST_MAPPING to finder's cache" 2017-11-29 19:16:50 +00:00
Colin Cross
3bc7ffa59b Replace aapt support with aapt2
Use aapt2 instead of aapt to compile Android app resources.
Also generate all files into srcjars instead of individual
sources.

Test: m checkbuild
Change-Id: I5a67991a0daf0017e8159b46fcff7d5564a91468
2017-11-29 05:05:07 +00:00
Colin Cross
0875c52de7 Wrap PackageContext and SingletonContext
Wrap blueprint.PackageContext so that the *Func methods can provide
an android.Config instead of an interface{}.  The modified signatures
means that every method in ModuleContext and SingletonContext
that takes a blueprint.PackageContext now needs to be wrapped to
take an android.PackageContext.

SingletonContext wasn't previously wrapped at all, but as long
as it is, wrap everything like ModuleContext does.  This requires
updating every Singleton to use the android-specific methods.

Test: builds, all Soong tests pass
Change-Id: I4f22085ebca7def6c5cde49e8210b59d994ba625
2017-11-29 05:04:30 +00:00
Jeff Gaston
7276539d6a Sort cfi static libs to make them consistent
To make it easier to diff the ninja files with diff_build_graphs.sh
Bug: b/69133815
Test: m -j

Change-Id: Ic08094f7dc3adb773ebb64a7d34125fc24641bf3
2017-11-28 16:39:12 -08:00
Elliott Hughes
f2a56f0e0d Merge "Skip MIPS headers when generating NDK prebuilts" 2017-11-28 23:26:03 +00:00
Jayant Chowdhary
3e6584556d Merge "Copy abidiffs into /abidiffs on abi breakages." 2017-11-28 22:38:32 +00:00
Colin Cross
88c24a38e5 Merge "Move java test resources in mock filesystem to a different directory" 2017-11-28 21:24:52 +00:00
Colin Cross
8b732c1cd5 Merge "Add Jacoco support" 2017-11-28 21:10:57 +00:00
Colin Cross
496d057ef3 Merge changes from topic "pathtools.Match"
* changes:
  Add support for --ignore_duplicates to merge_zips
  Support exclusions and Blueprint-style ** globs in zip2zip
2017-11-28 20:45:38 +00:00
Jeff Gaston
5921ab3347 Merge "Have Soong cc static linker dep order account for shared deps too" 2017-11-28 20:28:29 +00:00
Lazar Trsic
cdb710fed5 Skip MIPS headers when generating NDK prebuilts
When generating NDK prebuilts, skip installing MIPS headers, but keep
them when doing regular platform build. Ndk_abis property is only set
to true with build/soong/scripts/build-ndk-prebuilts.sh

Revert this once MIPS is supported in NDK again.

This effectively skips installing the following header modules when
creating NDK prebuilts:
- libc_asm_mips
- libc_asm_mips64

This fixes the issue introduced by commit:
050f046 Remove mips/mips64 headers from the NDK sysroot.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Test: build aosp_mips[64]-eng

Change-Id: I3af73649bc8ac304bca0e21ec81f156abe546c90
Signed-off-by: Lazar Trsic <Lazar.Trsic@mips.com>
2017-11-28 15:07:16 +01:00
Jayant Chowdhary
219139df8c Copy abidiffs into /abidiffs on abi breakages.
Bug: 64267858

Test: create reference abi dump for libjpeg locally. Change return type
      of libjpeg_std_err and build with :
      BOARD_VNDK_VERSION=current mm -j64 showcommands dist
      Build fails and abidiff report gets copied into out/dist/abidiffs.

Change-Id: I7c8ecfac95361e731009e5913bd3a7bb323a9597
2017-11-27 17:16:29 -08:00
Jeff Gaston
f5b6e8f8c7 Have Soong cc static linker dep order account for shared deps too
Bug: b/69639803
Test: m -j nothing # which runs unit tests
Test: m -j checkbuild
Change-Id: I2eedfe8b88ec5c715ef729bf113d168a2bc3524d
2017-11-27 17:14:06 -08:00
Colin Cross
824bee347d Move java test resources in mock filesystem to a different directory
Move the java test resources from res to java-res to avoid confusion
with Android app resources that are implicitly expected in res.
Also allow tests to provide extra files.

Test: java_test.go
Change-Id: I13349a21da5c6d449cd23947c2628efbed3eb230
2017-11-24 11:22:21 -08:00
Colin Cross
cb9335932f Add Jacoco support
Add support for instrumenting jars with jacoco.  Unlike in Make,
Jacoco in Soong is done entirely using jars.

Instrumentation is enabled by EMMA_INSTRUMENT=true, and affects
all apps.  If EMMA_INSTRUMENT_FRAMEWORK=true then it also affects
any java libraries listed in InstrumentFrameworkModules.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false
Change-Id: If699715b277529cd7322ffca67c23b0746e1cccd
2017-11-22 16:08:53 -08:00
Colin Cross
e909e1e079 Add support for --ignore_duplicates to merge_zips
Add a --ignore_duplicates option to cause merge_zips to
silently take the first entry in the case of duplicate entries
in the zips to be merged.  This will be used for soong Jacoco
support to combine the instrumented jar with the original jar
to pick up any classes that were excluded.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true SKIP_BOOT_JARS_CHECK=true WITH_DEXPREOPT=false
Change-Id: I49ede3f07ce0ed7701b4db7058da2e4f11b8043e
2017-11-22 16:08:35 -08:00
Colin Cross
b4972e3d96 Fix passing dex_preopt value to make
dex_preopt defaults to true, only pass LOCAL_DEX_PREOPT := false
if dex_preopt is explcitly set to false.

Test: m, examine framework.jar
Change-Id: Ica6ce06d14bbc720da9c5b26559b9768a8a7f5a8
2017-11-22 16:08:34 -08:00
Colin Cross
f3831d0e08 Support exclusions and Blueprint-style ** globs in zip2zip
Jacoco support will use zip2zip to create a jar that is a subset
of another jar, and will need exclusion filters and recursive
globs.  Switch zip2zip from filepath.Match to pathtools.Match,
and check each included file against the exclusion list.

Bug: 69629238
Test: zip2zip_test.go
Change-Id: Ibe961b0775987f52f1efa357e1201c3ebb81ca9c
2017-11-22 16:08:34 -08:00
Dan Shi
cc3d9b304e Add TEST_MAPPING to finder's cache
Build target test_mapping will create a tarball of all TEST_MAPPING
files in source code based on the cached TEST_MAPPING.list

Bug: 69678490
Test: m -j blueprint_tools && cat out/.module_paths/TEST_MAPPING.list
Change-Id: Iba3479363137609d6631cf1851a8ce4613078f61
2017-11-22 15:35:09 -08:00
Jeff Gaston
b06ad36c1f Merge "Autodetect files named Android.bp in tests" 2017-11-22 22:30:13 +00:00
Treehugger Robot
5c986c3dc3 Merge "Reduce how often both mutated variants are needed." 2017-11-22 00:05:30 +00:00
Vishwath Mohan
e712879d5d Reduce how often both mutated variants are needed.
This CL rolls back how often we bubble up both sanitized and
un-sanitized variants of a component. With this change only
CFI-enabled target static libraries will do this, all other cases
suppress one of the two variants (both from being installed and from
being exposed to Make for make-embedded builds).

This means we shouldn't need a separate sanitizer suffix for ASAN at
all (.asan), and similarly for non static-lib CFI components (.cfi),
so this CL changes that as well.

Lastly, because the version of ar meant for the host is not built
with plugin support (which CFI requires), this CL disables CFI for
host targets.

This CL should fix the following 2 issues:
(1) Removing warnings about multiple rules existing for the same
installable target.

(2) Fixing VTS packaging, which had been broken by the generation of
the .asan suffix.

Bug: 69172424, 69059192, 67507323
Test: m -j40 # Soong generated .mk file does not have duplicate rules.
Test: SANITIZE_TARGET="address" m -j40 libstagefright # installed
correctly.

Change-Id: Ib90fdbc8a6ad3924fc2a691b7277a8a1bc67cda8
2017-11-21 14:09:09 -08:00
Treehugger Robot
49b14daf03 Merge "Use -mcpu=cortex-a53 for devices with Kryo" 2017-11-21 22:05:44 +00:00
Chih-hung Hsieh
488131912f Merge "Add default -Wall -Werror or -Wall." 2017-11-21 21:19:01 +00:00
Jeff Gaston
e261615792 Merge "Prohibit accidental renames of product config json fields" 2017-11-21 20:20:42 +00:00
Pirama Arumuga Nainar
c17b275ed3 Use -mcpu=cortex-a53 for devices with Kryo
Bug: http://b/69481735

While Clang supports -mcpu=kryo, the GNU assembler doesn't.  Use
Cortex-a53 instead, which is close to Kryo.  The current alternative of
using Krait causes problems when also using armv8, which is not
available in Krait.

Test: Build marlin with internal CL 3248394 cherry-picked.
Change-Id: I571739e6ab4f1b37fafb304ecad2865c9394e04f
2017-11-21 09:35:42 -08:00
Chih-Hung Hsieh
64a38dcb18 Add default -Wall -Werror or -Wall.
* When -Wno-error and -Werror are not used:
  add -Wall to the front of cflags
  if the project is in the WarningAllowedProjects,
  otherwise add -Wall -Werror.
* Add -Wall -Werror to ndk_library build targets.
* Collect names of modules with -Wno-error or without -Werror,
  and pass them to makefile variables:
      SOONG_MODULES_USING_WNO_ERROR
      SOONG_MODULES_ADDED_WERROR
      SOONG_MODULES_ADDED_WALL
* Generate ANDROID_WARNING_ALLOWED_PROJECTS for old makefiles.

Bug: 66996870
Test: normal build
Change-Id: I31385e12b80ca946c7395a5a184ef259b029aac6
2017-11-20 18:28:26 -08:00
Jeff Gaston
f5f6e49478 Prohibit accidental renames of product config json fields
Can be caused by `json:"omitempty"` instead of `json:",omitempty"`

Bug: 69076024
Test: m -j # which runs unit tests
Change-Id: I92e3193d00a740c72d36a56748e0b0a8ad1d772e
2017-11-20 16:28:53 -08:00
Colin Cross
cf31fcfc71 Make AndroidRuleFunc callback take a Config
Convert the interface{} to android.Config before calling
the callback.

Test: m checkbuild
Change-Id: Iab1173d3c0bbeff662afcbc1d6ce7c982b6b7720
2017-11-20 12:23:00 -08:00
Tobias Thierer
6693613f11 Merge "kotlinc: Always pass -jvm-target 1.8" 2017-11-20 13:14:05 +00:00
Tobias Thierer
96427d63bc kotlinc: Always pass -jvm-target 1.8
AOSP's current version of kotlinc only supports -jvm-target
1.8 or 1.6. Previously, we were passing the javaVersion
(the value passed to javac -target) but that would fail if
javaVersion was eg. 1.9.

This CL changes the kotlinc invocation to always pass
-jvm-target 1.8, regardless of javaVersion.

Bug: 69160377
Test: Treehugger
Change-Id: Ib12a8c2afbe908319513861a5380e70bf09d0be0
2017-11-18 04:11:59 +00:00
Treehugger Robot
ea7b201536 Merge "Revert "Set -fomit-frame-pointer for all devices"" 2017-11-18 02:13:08 +00:00
Colin Cross
bc2c7c26e1 Revert "Set -fomit-frame-pointer for all devices"
This reverts commit 20823f95e6.

Reason for revert: caused a minor performance regression in some benchmarks.

Bug: 69470341
Test: builds
Change-Id: I1a852b5d7a2aa1d08ecb54617898f814cddd7600
2017-11-18 00:11:21 +00:00
Colin Cross
393667285e Replace root.bp with a comment
root.bp is no longer useful, replace its contents with a comment.

Bug: 64363847
Test: m checkbuild
Change-Id: I41f5bfa06edc26c86f372224c90300b687a32ab2
2017-11-17 23:05:41 +00:00
Colin Cross
d00350c61b Add license headers to all go and shell files
Test: none
Change-Id: I75c443e05f2b1e17fcb6823182717d2e6f5df7c4
2017-11-17 23:05:26 +00:00
Jeff Gaston
dea7e4d932 Autodetect files named Android.bp in tests
Bug: 65683273
Test: m -j nothing # which runs unit tests
Change-Id: I416530eba1f30ffe0c38609483d7e548b0a42198
2017-11-17 14:29:07 -08:00
Colin Cross
6dfde48ba1 Merge changes from topics "soong_logtags", "droiddoc_srcjars"
* changes:
  Fix genrules depending on Go tools
  Use logtags without merged file
  Export extract-srcjars.sh to Make
  Remove partial javastream proto support
  Add support for .srcjar files from genrules and srcs
  Fix java AIDL properties to match C/C++
  Fix proto flags in java
2017-11-17 21:32:27 +00:00
Treehugger Robot
fd9b570c5e Merge changes I0434b003,I1a1a01c5
* changes:
  Fix using aidl files from filegroups
  Add cc_library tests
2017-11-17 21:07:21 +00:00
Colin Cross
35143d0466 Fix genrules depending on Go tools
genrules lost the ability to depend on Go tools after
I05e945f38915d49cd3c0ab72a86576949bc7eff2 which converted
VisitDirectDeps from blueprint Modules to android Modules.
Add VisitDirectDepsBlueprint to visit all modules including
blueprint Modules, and use it in genrule.  Also add a check
for disabled modules that was being handled by
VisitDirectDeps.

Test: m checkbuild
Change-Id: I65724283166c63596d071e598c08fed87ef32896
2017-11-17 11:22:08 -08:00
Colin Cross
f18e11074d Fix using aidl files from filegroups
Compute sources including from filegroup and genrule dependencies
before determining if any sources will cause flags to be added.

Test: gen_test.go
Change-Id: I0434b003bbda07a58bb2ce1a0a72997918c8fae2
2017-11-17 11:22:08 -08:00
Colin Cross
b1bd1aabca Use logtags without merged file
Assume logtags files will have hardcoded tag numbers and don't
build against the merged file.  Simplifies the build when
logtags files are split across Make and Soong.

Test: m checkbuild
Change-Id: I1e995ec458690fcadb1b86d64864f277aa9fe3af
2017-11-17 11:22:08 -08:00
Colin Cross
1763da8eb9 Export extract-srcjars.sh to Make
Export extract-srcjars.sh to Make so that it can be used to add
srcjar support to droiddoc rules.

Test: m checkbuild
Change-Id: I203ba6dad731ec9167eb8706bbfb345a484f024b
2017-11-17 11:22:08 -08:00
Colin Cross
d243091381 Remove partial javastream proto support
javastream proto is rarely used and tricky to support directly
in java because it depends on an extra host tool.  It can be
supported with a genrule, so just remove the partial built-in
support.

Test: m checkbuild
Change-Id: Iffe75e7040cb889ca17fdd85ef3e8e64fc3aa9e9
2017-11-17 11:22:08 -08:00
Colin Cross
af05017b75 Add support for .srcjar files from genrules and srcs
Allow srcs to contain .srcjar files, which will be extracted just
before javac.  Also allow genrules and generated sources to directly
return .srcjar files.

Test: m checkbuild
Change-Id: Ie4cf60ecb9d2ec63a4c2275221544203b1383597
2017-11-17 11:22:08 -08:00
Colin Cross
ebe1a51c81 Fix java AIDL properties to match C/C++
The C/C++ aidl properties use:
aidl: {
    local_include_dirs: [],
    include_dirs: [],
}

But the Android.bp file was expecting:
aidl_include_dirs: [],
export_aidl_include_dirs: [],

Update java AIDL support to match the C support, which is
also what the androidmk conversion tool is creating.

Test: m checkbuild
Change-Id: I3df763d0b203b1b6556798a21b0553e7d35ad7d5
2017-11-17 11:22:08 -08:00
Colin Cross
d5dbfb78a0 Fix proto flags in java
Compute the common proto flags and pass them to the protoc invocation
when generating java files.

Test: m checkbuild
Change-Id: I0d4c23ad001d01eab03b404545383f009214106d
2017-11-17 11:22:08 -08:00
Colin Cross
ad59e75a56 Add cc_library tests
Add tests around reusing objects between static and shared
libraries.

Test: library_test.go
Change-Id: I1a1a01c5ea9f9edfbcaa5b29c39c281630e04f70
2017-11-17 11:22:04 -08:00
Tobias Thierer
a7cdd156a6 Support EXPERIMENTAL_USE_OPENJDK9=false.
This fourth possible value currently has the same semantics
as a default/unset EXPERIMENTAL_USE_OPENJDK9, but allows
people to explicitly switch back to the old semantics when
the default changes.

Test: make showcommands core-oj (in environments with
      EXPERIMENTAL_USE_OPENJDK9 set to "", "1.8", and "true").
Bug: 38177295

Change-Id: I25accf14344a05349a6e97572d7c2c1f6a7f2063
2017-11-17 13:14:11 +00:00