Commit graph

632 commits

Author SHA1 Message Date
Jiyong Park
596229feb4 Merge "Add PLATFORM_SYSTEMSDK_VERSIONS and BOARD_SYSTEMSDK_VERSIONS" am: d89f6621ae am: ee33e88111
am: a64cc46798

Change-Id: Ic3ea155a5f5dda891d59da2b9921f3cd5af96ddc
2018-01-23 19:00:09 +00:00
Ivan Lozano
8704d606cb Merge "Revert "Support enabling overflow sanitization by path."" am: e021b0405d am: a8388ac9e6
am: 0370b8c419

Change-Id: I04330526423727b61697734c3cf160e93a6ccfc4
2018-01-20 04:05:46 +00:00
Ivan Lozano
b7d0f52337 Revert "Support enabling overflow sanitization by path."
This reverts commit 17df3c1b76.

Change-Id: Id5dab777da591c24113c3048b8606547a661afdd
2018-01-20 01:44:38 +00:00
Ivan Lozano
bb20d98bb7 Merge "Support enabling overflow sanitization by path." am: c1fecc2dfa am: a613b55860
am: cbc5232329

Change-Id: I99e120a4e5442bf2715ffce7f2ac69c60085140b
2018-01-19 16:07:51 +00:00
Jiyong Park
1a5d7b1539 Add PLATFORM_SYSTEMSDK_VERSIONS and BOARD_SYSTEMSDK_VERSIONS
PLATFORM_SYSTEMSDK_VERSIONS is the list of System SDK versions that the
platform is supporting. Contrary to the public SDK where platform
essentially supports all previous SDK versions, platform support only a
few recent System SDK versions, since some of old System APIs are
gradually deprecated, removed from the following SDKs and then finally
deleted from the platform. This will be part of the framework manifest.

The list can be specified by setting PLATFORM_SYSTEMSDK_MIN_VERSION. If
it is set to an old version number, then System SDKs from the version
to the current version (PLATFORM_SDK_VERSION) are considered to be
supported by the platform. If PLATFORM_SYSTEMSDK_MIN_VERSION is not set,
only the latest System SDK version is supported.

Next, BOARD_SYSTEMSDK_VERSIONS is the list of System SDK versions that
the device is using. This is put to the device compatibility matrix
device is using. The device and the platform is considered as compatible
only BOARD_SYSTEMSDK_VERSIONS in the device compatibility matrix are
in the PLATFORM_SYSTEMSDK_VERSIONS in the framework manifest.

When BOARD_SYSTEMSDK_VERSIONS is set, a Java app or library in vendor or
odm partitions which didn't specify LOCAL_SDK_VERSION  is forced to use
System SDK. Also, the build system does the additional integrity check
to ensure that LOCAL_SDK_VERSION is within BOARD_SYSTEMSDK_VERSIONS or
PLATFORM_SYSTEMSDK_VERSIONS (if BOARD_SYSTEMSDK_VERSIONS isn't set).

Bug: 69088799
Test: m -j
Test: BOARD_SYSTEMSDK_VERSIONS=P m -j
Change-Id: Id38f02b4be86710411be22bc28109e6894f8a483
2018-01-19 15:42:18 +09:00
Ivan Lozano
17df3c1b76 Support enabling overflow sanitization by path.
Handle paths variable provided from Make about where integer overflow
sanitization should be enabled by default, and prepare to enable minimal
runtime diagnostics for integer overflow sanitizers in userdebug/eng builds.

This provides Soong support for on-by-default paths from Make for
integer overflow sanitization.

Bug: 30969751
Bug: 63927620
Test: Include paths passed from Make are being sanitized.
Test: Compilation succeeds with and without diagnostics enabled.
Test: See Make patch for further test notes.

Change-Id: I803a75646cc27ef5b4b5b74b8eb2981c39f8a6a3
2018-01-18 14:16:47 -08:00
Hirokazu Honda
8991335666 [Android.bp] Add cflags, include_dirs, shared_libs ans srcs to ARC++ Product
Test: Compile
Bug: None
Change-Id: I422f2194208ea14e976970de748d6d9238fe9f14
2018-01-17 14:00:33 +09:00
Stephen Hines
51207eb44d Merge "Remove unnecessary DeviceUsesClang." am: 2e020842dc am: 4bf625d7e6
am: 8d7ba61a81

Change-Id: Ibfd4b158180d54607d9b9d7c6de927b071f1d425
2018-01-12 18:49:32 +00:00
Stephen Hines
2e020842dc Merge "Remove unnecessary DeviceUsesClang." 2018-01-12 18:19:45 +00:00
Dan Willemsen
4955cd5610 Merge "Remove armv5te" am: 7d3e0709a5 am: c13dcf49aa
am: 36a5e07c00

Change-Id: Ia4d9eb34bc7217fc82082413acba9802db887c41
2018-01-12 06:01:41 +00:00
Stephen Hines
6ea0f81c3f Remove unnecessary DeviceUsesClang.
This build function is unnecessary now that GCC is completely
unsupported for Android platform builds. It is similar to
USE_CLANG_PLATFORM_BUILD from the build/make side of things.

Bug: http://b/64032869
Test: Builds
Change-Id: Iddf5f91cc997c337c77a644265cb8dc4e5a915b4
2018-01-11 14:29:41 -08:00
Dan Willemsen
e401a8315e Remove armv5te
This architecture only existed for unbundled use, but even the NDK is
removing support in their r17 release, so just remove support for it.

Test: build/soong/build_test.bash -only-soong
Change-Id: I4bd23babf567128d2d242cbdee3311abb198dd7c
2018-01-08 15:48:25 -08:00
Alan Leung
8588809ae2 Make D8 Desugaring default. am: e2fb6294e9 am: a7fc3b6e83
am: 3162a65ce8

Change-Id: Idf31f69ad1c53e6e85f6b0a5c0e6ef869bde597d
2018-01-04 19:52:26 +00:00
Alan Leung
e2fb6294e9 Make D8 Desugaring default.
Bug: 69329508
Test: m checkbuild

Change-Id: Ie74c2b27764aa5f2d60a0d33141735808bbc6d48
2018-01-04 11:36:27 -08:00
Tobias Thierer
04ddd45f4a Merge "Build with OpenJDK 9 -target 1.8 by default (attempt 4)." 2018-01-04 11:18:11 +00:00
Tobias Thierer
18099fd856 Build with OpenJDK 9 -target 1.8 by default (attempt 4).
This is cherry-picked from attempt 3, which was reverted
due to http://b/70862583.

Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Test: Treehugger
Test: art/test/testrunner/run_build_test_target.py -j40 art-interpreter
Test: dalvik/dx/tests/run-all-tests

(cherry picked from commit 13f23a2753)

Change-Id: I57abae73f9bdb21ef004a5118ff0e4ef70418ed9
Merged-in: Iac78122f58df0ebbb55134d55021ce6c57351b5f
2018-01-04 11:07:38 +00:00
Tobias Thierer
fa853e19a3 Build with OpenJDK 9 -target 1.8 by default (attempt 4).
This is cherry-picked from attempt 3, which was reverted
due to http://b/70862583.

Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Change-Id: Iac78122f58df0ebbb55134d55021ce6c57351b5f
Test: Treehugger
Test: art/test/testrunner/run_build_test_target.py -j40 art-interpreter
Test: dalvik/dx/tests/run-all-tests
2018-01-03 05:10:41 +00:00
Colin Cross
3f342dc62c Add VisitDirectDepsWithTag am: ee6143cde2 am: 3b986ef4e3
am: 00c6c91ad5

Change-Id: I4062d6dd2969dec940f4fdcb109b9d072aa14fbb
2018-01-03 02:38:09 +00:00
Colin Cross
ee6143cde2 Add VisitDirectDepsWithTag
Add a method on ModuleContext and TopDownMutatorContext to visit
direct dependencies that have a given dependency tag.

Test: m checkbuild
Change-Id: Ib875563091dcae6b7282b3e3427d0eb07d8c8af5
2018-01-02 18:23:43 -08:00
Colin Cross
ac734537d0 Merge "Revert "Build with OpenJDK 9 -target 1.8 by default (attempt 3)."" 2018-01-03 00:29:41 +00:00
Tobias Thierer
ac1e12846c Merge "Build with OpenJDK 9 -target 1.8 by default (attempt 3)." 2018-01-02 14:07:10 +00:00
Colin Cross
ab996ef6b0 Move string list utility functions to android package am: b4330e222b am: cda9710157
am: 796ecdfc99

Change-Id: I5594bcdacdfe468cad9e42d2810fe9ae9fc7fd19
2017-12-28 19:32:41 +00:00
Colin Cross
b4330e222b Move string list utility functions to android package
Test: m checkbuild
Change-Id: I50a7ccf9fd7ed82b688e3eb90489c0bc0af33287
2017-12-28 17:41:02 +00:00
Steven Moreland
6e1ab2b9e0 Merge "neverallows in Soong" am: 19454d50e3 am: c53f4ca97c
am: 69d8b5c9d7

Change-Id: Ib34270a298e42a6f30aac74eccd2d6f22eeb717d
2017-12-23 01:19:50 +00:00
Treehugger Robot
19454d50e3 Merge "neverallows in Soong" 2017-12-23 01:08:44 +00:00
Tobias Thierer
cc0f999806 Revert "Build with OpenJDK 9 -target 1.8 by default (attempt 3)."
After this revert CL topic, the default toolchain for Android
goes back to being OpenJDK 8.

This revert is being prepared ahead of time in case of
any problems with original change topic.

Bug: 69449021
Test: Treehugger
Change-Id: Idbaefeb5b88ecb5d5168e6b9b4a120f80dedd5b6
2017-12-21 20:06:14 +00:00
Tobias Thierer
3b08d14b07 Build with OpenJDK 9 -target 1.8 by default (attempt 3).
This is cherry-picked from attempt 2, which was reverted
due to http://b/70521453 and other issues.

Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Test: Treehugger
Test: art/test/testrunner/run_build_test_target.py -j40 art-interpreter
Test: dalvik/dx/tests/run-all-tests

(cherry picked from commit 13f23a2753)

Change-Id: I57abae73f9bdb21ef004a5118ff0e4ef70418ed9
2017-12-21 19:56:19 +00:00
Jiyong Park
eb7b1a2490 Merge "Add [soc|device|product]_specific" am: 95fba1a8f8 am: 0fffd6bca4
am: 4500bca56d

Change-Id: I6a3457b18df366aec5767ddb98314872e15be124
2017-12-21 18:35:16 +00:00
Dan Albert
42ef62bbe4 Merge "Update the NDK ARM ABI to armv7." am: 3b528a802d am: 526800c76c
am: a66fa17a89

Change-Id: I86d2c5990eab219e152bf22ec7970cd103bea4a1
2017-12-21 09:39:05 +00:00
Jiyong Park
2db7692a74 Add [soc|device|product]_specific
Added three properties (soc_specific, device_specific, and
product_specific) that shows what a module is specific to.

`soc_specific: true` means that the module is specific to an SoC
(System-On-a-Chip) and thus need to be installed to vendor partition.
This has the same meaning as the old `vendor: true` setting.

`device_specific: true` means that the module is specific to the entire
hardware configuration of a device includeing the SoC and off-chip
peripherals. These modules are installed to odm partition (or /vendor/odm
when odm partition does not exist).

`product_specific: true` means that the module is specific to the
software configuration of a product such as country, network operator,
etc. These modules are installed to oem partition (or /system/oem when
oem partition does not exist). These modules are assumed to be agnostic
to hardware, so this property can't be true when either soc_specific or
device_specific is set to true.

Bug: 68187740
Test: Build. path_tests amended.
Change-Id: I44ff055d87d53b0d2676758c506060de54cbffa0
2017-12-21 12:16:29 +09:00
Treehugger Robot
3b528a802d Merge "Update the NDK ARM ABI to armv7." 2017-12-21 00:37:29 +00:00
Dan Albert
d3c8ca4469 Update the NDK ARM ABI to armv7.
We don't support armv5 any more, and we can't build bionic as armv5.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: I4026d48e7d5db78f6aa4e9796da1ec9cf10021ca
2017-12-20 14:48:39 -08:00
Steven Moreland
35a468eeaf Merge "Remove sepolicy_split from soong." am: 57603998a6 am: 3fac38f544
am: 9bbc5b65e1

Change-Id: I0413a91f87446112d15e692a8a62230647ae48ea
2017-12-20 21:14:35 +00:00
Treehugger Robot
57603998a6 Merge "Remove sepolicy_split from soong." 2017-12-20 19:10:32 +00:00
Alan Leung
38db5aa270 Merge "Prep D8 default instead of CompatDX in build/soong" am: 731c8dac6d am: 3a3fff0368
am: d420648b7b

Change-Id: Ic94ad725ee3309d37613847e453f4223e83046ca
2017-12-20 02:15:00 +00:00
Alan Leung
731c8dac6d Merge "Prep D8 default instead of CompatDX in build/soong" 2017-12-20 02:00:45 +00:00
Colin Cross
7b49f1356e Merge "Ensure -I . is the first protoc argument" am: 32bf18b10a am: 2d1b27c08b
am: b61e4e6e47

Change-Id: Ieba70f66731f7fc5e616e97bda81b783dd172ce0
2017-12-20 00:49:38 +00:00
Steven Moreland
65b3fd900a neverallows in Soong
Straightforward way of expressing policy inspired by a similar
syntax in SELinux.

Bug: 70165717
Test: no neverallows hit
Test: manually checking neverallow rules by changing them/adding violations
Change-Id: I7e15a0094d1861391bfe21a2ea30797d7593c142
2017-12-19 15:26:08 -08:00
Steven Moreland
0afa55ae12 Remove sepolicy_split from soong.
No longer needed.

Bug: 62019611
Test: manual
Change-Id: Id485e6db4cc9b5a7cf553e5089fd85b667c7c660
2017-12-19 20:41:21 +00:00
Alan Leung
c37c6343e2 Prep D8 default instead of CompatDX in build/soong
Bug: 69329508
Test: m checkbuild tests
Change-Id: Ibaa2d787c644cf25104af78305a6eed16028dcf0
2017-12-18 23:56:30 -08:00
Colin Cross
a3b25001e8 Ensure -I . is the first protoc argument
The first include directory affects where protoc places the
output files.  Ensure -I . is always the first protoc argument.

Bug: 70704330
Test: m checkbuild
Change-Id: I4992e4074f612409865e6e18dc8993c6f68385fd
2017-12-15 13:42:09 -08:00
Steven Moreland
ec1c4d57eb Merge "Remove Treble/PRODUCT_FULL_TREBLE from Soong." am: e565435a7b am: 642948940e
am: 74fc159270

Change-Id: I8079e8d1704de5f465a56c7e9d3190ac687cefb8
2017-12-15 20:25:03 +00:00
Steven Moreland
dd0bb0b26c Remove Treble/PRODUCT_FULL_TREBLE from Soong.
This variable is being broken up because it isn't well
defined, and breaking it into smaller components makes
device bringup easier.

Bug: 62019611
Test: nothing uses it
Change-Id: I748958b7276f607f8a711289f3bde163a1a56596
2017-12-15 10:25:48 -08:00
Steven Moreland
631efe9318 Merge "Add split PRODUCT_FULL_TREBLE variables to Soong." am: 4c016b996e am: 3b81e0d9f6
am: 3ca2f36a19

Change-Id: I72f547172e6cac75d46b2b2f90e1ce417b7ad9c7
2017-12-15 17:57:18 +00:00
Treehugger Robot
4c016b996e Merge "Add split PRODUCT_FULL_TREBLE variables to Soong." 2017-12-15 17:41:27 +00:00
Colin Cross
2be8e07ad3 Export app certificates to Make for apkcerts list am: e1731a5803 am: 461aba31c6
am: 0c77c7c46d

Change-Id: I5b31a7359839e10c66f3dbdc4c2c1aeb80916012
2017-12-14 22:34:39 +00:00
Colin Cross
e1731a5803 Export app certificates to Make for apkcerts list
Bug: 70669383
Test: m apkcerts-list contains framework-res.apk
Change-Id: I38af458e4262371c9c8368b5eebcff063a9bc359
2017-12-14 12:28:41 -08:00
Steven Moreland
c2b9f060d9 Add split PRODUCT_FULL_TREBLE variables to Soong.
As a follow-up to this, Treble will be removed from Soong.

Bug: 62019611
Test: manual
Change-Id: I840e0d6130b834299d0cf3603443cc4c3f7f8e6d
2017-12-13 22:21:46 +00:00
Justin Yun
b41da7cd8e Install current VNDK libs to the versioned directories. am: 8fe1212261 am: df323367e7
am: 0de3759433

Change-Id: I70feaaa31fe8b66714cedeede3b6692ed283301f
2017-12-13 03:00:05 +00:00
Justin Yun
8fe1212261 Install current VNDK libs to the versioned directories.
If PLATFORM_VNDK_VERSION has a version $VER other than "current",
install current VNDK libs to /system/lib[64]/vndk[-sp]-$VER.
Otherwise, they will be installed to /system/lib[64]/vndk[-sp].

Bug: 69883025
Test: device boot
Change-Id: Ifa8564f39687dab5b407bf2178b13022625a94f3
2017-12-13 10:47:44 +09:00
Colin Cross
796802e2ad Allow Soong to generate its own build documentation am: e87040b2eb am: 734adeb16f
am: 1846e89645

Change-Id: I80c1435d51c89b72619eeb4a3e66c22363039fc3
2017-12-13 00:10:53 +00:00
Colin Cross
242f06d7ae Make SingletonContext.Rule take a blueprint.RuleParams am: 59014396ba am: dfdd908ed0
am: a8c92e9298

Change-Id: I9c7d8a085d0b116fb984fe8359176aa4ad354740
2017-12-13 00:10:47 +00:00
Colin Cross
e87040b2eb Allow Soong to generate its own build documentation
Add a rule in soong that re-executes soong_build in order to
generate build documentation.  This allows Soong to customize
the documentation.

Bug: 70516282
Test: m soong_docs
Change-Id: If143cfacd6ac20274cd7bb8d8fab0c07025a5553
2017-12-12 11:12:32 -08:00
Colin Cross
59014396ba Make SingletonContext.Rule take a blueprint.RuleParams
Make the currently-unused SingletonContext.Rule match
ModuleContext.Rule and take a blueprint.RuleParams instead
of an android.RuleParams, and delete android.RuleParams.

Test: m checkbuild
Change-Id: I018685a3dc13f60825b5ba383ef365df2bc98dfc
2017-12-12 11:12:32 -08:00
Colin Cross
0ad2cf46bd Merge changes If54d9c69,Ibc253514 am: ae6bd3d758 am: 9b368d90f3
am: 6e975dce0f

Change-Id: I86099d50cad3f49dd68774d65cd72d6f97312e80
2017-12-12 04:20:34 +00:00
Colin Cross
74e3fe4cd4 Fix PathForPhony
PathForPhony was prefixing out/soong to all of the phony targets.

Test: m checkbuild
Change-Id: If54d9c692b79751a09eef76c734dd2a1f7db325b
2017-12-11 16:30:14 -08:00
Colin Cross
366938f268 Allow java manifest property to reference filegroups
Also factor out ExtractSourceDep and ExpandSource.

Test: m checkbuild
Change-Id: Ibc253514bc3109d84ec388a05c66b8108af5d6ab
2017-12-11 16:30:14 -08:00
Tobias Thierer
18d1ee4b1a Merge "Revert "Build with OpenJDK 9 -target 1.8 by default except for errorprone."" am: 8b6faf6c8e am: 2491fea5fb
am: 1a72258952

Change-Id: Ifea38fbce4431dbf33be2eda469bba0b7dcedd2b
2017-12-11 23:18:04 +00:00
Tobias Thierer
e29e109f92 Build with OpenJDK 9 -target 1.8 by default except for errorprone. am: 13f23a2753 am: 86277b4017
am: a8e1fec173

Change-Id: I87cb5fe8faa6f223b1d075f2e62fe13b5555a5eb
2017-12-11 19:29:32 +00:00
Tobias Thierer
e05f3a5f3f Revert "Build with OpenJDK 9 -target 1.8 by default except for errorprone."
After this revert CL topic, the default toolchain for Android
goes back to being OpenJDK 8.

This revert is being prepared ahead of time in case of
any problems with CL topic:
https://r.android.com/#/q/topic:bug69449021_attempt2

Bug: 69449021
Test: Treehugger
Change-Id: I9ead8d569226bd487baee3c6d5be9ec7033eb56a
2017-12-11 14:54:10 +00:00
Tobias Thierer
13f23a2753 Build with OpenJDK 9 -target 1.8 by default except for errorprone.
(This is cherry-picked from the first attempt to submit this CL
topic, which was reverted after 3 hours because of bug 70286093;
robolectric 3.{1.1,4.2} now stick with OpenJDK 8 to avoid that bug).

Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Test: Treehugger
Test: Running robolectric tests succeeds on internal-master
      after cherry-picking this CL topic, using the command
      line from http://b/70286093#comment1
(cherry picked from commit 0ae8b548af)

Change-Id: Ide6a7e55126d919a44f89ef8e0bd14fb12ff470e
2017-12-11 14:53:52 +00:00
Colin Cross
114db0a93f Merge "Split logtags implementations for cc and java" am: e304cc4575 am: b18d19f9ba
am: 40e8b3dc40

Change-Id: Iadaeec9973069815bb116be3b7f6e6180a8a9025
2017-12-08 16:43:42 +00:00
Colin Cross
5beccee92c Split logtags implementations for cc and java
Logtags files in cc and java are treated fundamentally differently.
In cc, they are not used for compiling at all, but need to be passed
to Make to be combined into the global logtags list, and logtag files
are listed in a logtags property.  In java they are listed in srcs
and produce generated code that is compiled in, and so shouldn't
also need to be listed in a logtags property.

Move the logtags property to cc and export it to Make from there,
and have java extract logtags files from srcs to be exported to
Make.

Test: m checkbuild
Change-Id: I31d49289efe72db60d2f33566df771b4a3ebc8a0
2017-12-07 15:32:30 -08:00
Tobias Thierer
8bd31ca2a2 Merge "Revert "Default to building with OpenJDK 9 -target 1.8."" am: c7efdd9b36 am: 38f7173524
am: c249101b08

Change-Id: If49432cc429fd03a218f8131c3001c0ad839ca12
2017-12-06 14:18:41 +00:00
Tobias Thierer
c7efdd9b36 Merge "Revert "Default to building with OpenJDK 9 -target 1.8."" 2017-12-06 14:00:47 +00:00
Tobias Thierer
db10b13533 Merge "Build with OpenJDK 9 -target 1.8 by default except for errorprone." am: cf8d83de82 am: 51512a1848
am: bbc4897b9e

Change-Id: Ib9b80d89fc488ddf7c3d380aa944b1bcc070fe7c
2017-12-06 11:22:03 +00:00
Tobias Thierer
cf8d83de82 Merge "Build with OpenJDK 9 -target 1.8 by default except for errorprone." 2017-12-06 11:05:31 +00:00
Colin Cross
a489390d5e Split java_binary modules into common and binary variants am: 6b4a32d771 am: 21fafc6298
am: 957ba7455c

Change-Id: I00f8b4ce743ea60a078395293cb3fff0e30fb8ad
2017-12-06 04:32:34 +00:00
Colin Cross
6d790918de Make (Source|Output)Path.Join("foo").Rel() return "foo" am: 0db5568612 am: a244a33418
am: 510005cb28

Change-Id: I5f15d7e5948935d0d09abc2ae2b5a82788c9aa09
2017-12-06 04:32:30 +00:00
Colin Cross
9dea654334 Make TestModule.Output print a list of all outputs on error am: 9cf27db425 am: 799ed60b06
am: b1e8caba31

Change-Id: I025adfc4aabe955e3fbfca51c4198e262549b960
2017-12-06 04:18:28 +00:00
Colin Cross
6b4a32d771 Split java_binary modules into common and binary variants
Add a common_first multilib type and use it for java.Binary
so that the java part is compiled as a "common" arch type
but the wrapper script is installed as a "linux_glibc" arch
type.  This allows java_binary to be used as a tool dependency
for a genrule.

Bug: 68397812
Test: TestJavaBinary
Change-Id: I809060839ce8878300da3fb76426ceb1ea6b0e8e
2017-12-06 04:16:21 +00:00
Colin Cross
0db5568612 Make (Source|Output)Path.Join("foo").Rel() return "foo"
This allows TestModule.Output("foo") to be used to find
a file called "foo" that was installed using ctx.InstallFile.

Test: soong tests
Change-Id: I04833c9ee8ac5baa6b6afd35715d1191c1622a78
2017-12-06 04:16:00 +00:00
Colin Cross
9cf27db425 Make TestModule.Output print a list of all outputs on error
Debugging when writing tests using TestModule.Outputs is
unnecessarily hard, it panics when an incorrect output path
is given but doesn't provide any help to figure out why.
Follow the pattern used by TestContext.ModuleForTests
and print the list of valid output paths on failure.

Test: m checkbuild
Change-Id: I50e8e2dfc2070bd538d47cf6495a489f727b1564
2017-12-06 03:55:08 +00:00
Jeff Gaston
251e2cf90b Merge changes from topic "soong-namespaces" am: 73c2099534 am: 40573a7456
am: 0b97da65fe

Change-Id: I43e1f9844414ce329e6dd87c25267fe4f12387a4
2017-12-05 04:01:59 +00:00
Jeff Gaston
c2daa54bcc require namespaces to be declared only in files named Android.bp am: 5c3886de5a am: 3f51258096
am: 7167a0811b

Change-Id: Ic219976a53aeaafcb385590db37d00533cdab7d1
2017-12-05 04:01:55 +00:00
Jeff Gaston
729ee1dd4f Revert "Revert "Soong support for namespaces"" am: 088e29ed38 am: 994f9e7a92
am: e2a73fe8f5

Change-Id: Ib4f244a1e2d91b5acbf2dcc251a041ad7798e64d
2017-12-05 04:01:47 +00:00
Tobias Thierer
7c05949407 Revert "Default to building with OpenJDK 9 -target 1.8."
After this revert CL topic, the default toolchain for Android
goes back to being OpenJDK 8.

This revert is being prepared ahead of time in case of
any problems with original change topic,
https://r.android.com/#/q/topic:bug_69449021

Bug: 69449021
Test: Treehugger

This reverts commit 0ae8b548af.

Change-Id: Ief7646a94f1a264085cd299b4327d244b78a1537
2017-12-05 02:10:55 +00:00
Tobias Thierer
0ae8b548af Build with OpenJDK 9 -target 1.8 by default except for errorprone.
Before this CL topic, the build toolchain for .java source files
used OpenJDK 8, targeting 1.8 (v52 class files) by default.

This CL topic switches the default to OpenJDK 9, but still
targeting 1.8 (v52 class files) by default. If USE_ERROR_PRONE
is set to true, then the default remains OpenJDK 8.

Code in the Android platform should generally be unaffected,
but if host tools that are now compiled and run using
OpenJDK 9 are causing problems for your team, then let me
know.

To manually switch back to the old behavior for now (continue
using OpenJDK 8), run this command in your shell:
export EXPERIMENTAL_USE_OPENJDK9=false

Bug: 69449021
Test: Treehugger
Test: "make core-oj", checked that compilation now uses
      OpenJDK 9 javac -target 1.8
Test: Checked that this is still compiled using OpenJDK 8.
      export EXPERIMENTAL_USE_OPENJDK9=false
      make core-oj

Change-Id: Ic87e9bb2a2e5da0ff13a2e51845b5365901c1507
2017-12-05 02:07:30 +00:00
Justin Yun
3978135eea Install VNDK snapshot libraries for system build am: 7154928c93 am: 702a40d5cd
am: bc90006024

Change-Id: I4bbfc018d62fb67bdad7828fa8a2a2298d4b2369
2017-12-05 01:59:44 +00:00
Jeff Gaston
5c3886de5a require namespaces to be declared only in files named Android.bp
Bug: 65683273
Test: m -j nothing # which runs unit tests

Change-Id: I5edf0e0482809f5ac9fb9dfff342fb404e1c52da
2017-12-04 17:44:32 -08:00
Jeff Gaston
b274ed3252 Make ninja file deterministic even with dup module names
Bug: 65683273
Test: ./build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm '' ''

Change-Id: Ie01ff579d69e94b12363f53aec5d25810211c451
2017-12-04 17:44:32 -08:00
Jeff Gaston
088e29ed38 Revert "Revert "Soong support for namespaces""
This mostly reverts commit 178d5fefc0
and mostly reapplies change I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c .

Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/blueprint:work^ build/soong:work^' \
      'build/blueprint:work build/soong:work'
      # and see that the only changes were:
      # 1. adding some new files
      # 2. changing some line numbers
Test: m -j nothing # which runs unit tests

Change-Id: I32baae00277a547fdcdd1c2219fe6625ee0e45d7
2017-12-04 17:44:29 -08:00
Justin Yun
7154928c93 Install VNDK snapshot libraries for system build
When BOARD_VNDK_VERSION := <VNDK version>, or
PRODUCT_EXTRA_VNDK_VERSIONS includes the needed <VNDK version> list,
the prebuilt VNDK libs in prebuilts/vndk/ directory will be
installed.

Each prebuilt VNDK module uses "vndk_prebuilt_shared" for shared
VNDK/VNDK-SP libs.

Following is the sample configuration of a vndk snapshot module:
vndk_prebuilt_shared {
    name: "libfoo",
    version: "27",
    vendor_available: true,
    vndk: {
        enabled: true,
    },
    arch: {
        arm64: {
            srcs: ["arm/lib64/libfoo.so"],
        },
        arm: {
            srcs: ["arm/lib/libfoo.so"],
        },
    },
}

The Android.bp for the snapshot modules will be auto-generated by a
script.

Bug: 38304393
Bug: 65377115
Bug: 68123344
Test: set BOARD_VNDK_VERSION := 27
      copy a snapshot for v27
      build with make command

Change-Id: Ib93107530dbabb4a24583f4d6e4f0c513c9adfec
2017-12-05 10:19:43 +09:00
Colin Cross
1266743566 Fix builds outside of make am: e15ddaf4ae am: c9a8134399
am: eae19f6269

Change-Id: I2225b6b414e5f125389583bb57f4cea5c2414070
2017-12-04 21:21:18 +00:00
Colin Cross
e15ddaf4ae Fix builds outside of make
Builds outside of make use custom config files that may not set
some variables, which is causing nil pointer derefernces.  Use
wrapper functions that check for nil for the new config
variables.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I0f837094532aeb2ecdbe401affa55a7535075bf6
2017-12-04 11:24:31 -08:00
Colin Cross
dfff3da415 Use default app certificate from Make am: 61ae0b7eed am: 9d58bf0610
am: 04585ff7d8

Change-Id: I1918429630415d83b72ab04f630fccc9fba766d7
2017-12-02 04:54:11 +00:00
Colin Cross
61ae0b7eed Use default app certificate from Make
Bug: 69917341
Test: m checkbuild
Test: framework-res.apk is identical after converting to Soong
Change-Id: I6980afd94ea130740da0defeea045eddc2fc6439
2017-12-02 01:26:50 +00:00
Colin Cross
424d07d5bb Add enforced RRO support to Soong am: 890ff551f7 am: 4713d17c35
am: 946db4ba81

Change-Id: I7c5a3120f8e9f7c5f8bef26ecf570924fda6df26
2017-12-01 22:20:49 +00:00
Colin Cross
890ff551f7 Add enforced RRO support to Soong
Ignore overlay directories that have been selected for enforced RRO
by the product, and pass them to Make instead to be converted to
an auto generated RRO package.

Bug: 69917341
Test: m checkbuild
Change-Id: I8e2677f4c600acdd8dee0869bf4fbc3d5dbc8b44
2017-12-01 16:12:51 +00:00
Sundong Ahn
0926fae350 Add system_$(VER)
The system_$(VER) is added for vendor, similar to sdk.

Bug: 67724799
Test: build
Merged-In: I2545c92707591ca278066870c74e9f49e9825855
Change-Id: I2545c92707591ca278066870c74e9f49e9825855
(cherry picked from commit b8baff1fa3)
2017-12-01 00:41:59 +00:00
Colin Cross
946c84e98b Merge "Allow building framework.jar and framework-res.apk" am: 85c87cef01 am: 2fc6f692d1
am: 5f3053a307

Change-Id: Id93733384a0c3636098d457bc22a474da67561d1
2017-11-30 20:46:28 +00:00
TreeHugger Robot
90370098f5 Merge "Add system_$(VER)" 2017-11-30 06:52:39 +00:00
Colin Cross
5ab4e6d817 Allow building framework.jar and framework-res.apk
Update app support enough to build framework-res.apk, link
framework.jar against its generated files, and export it to
make.

Bug: 69917341
Test: m checkbuild tests docs
Change-Id: I7db29cd1f5fabb22e844483ecc7c38abfedbbe0a
2017-11-29 20:47:42 -08:00
Sundong Ahn
b8baff1fa3 Add system_$(VER)
The system_$(VER) is added for vendor, similar to sdk.

Bug: 67724799
Test: build
Change-Id: I2545c92707591ca278066870c74e9f49e9825855
2017-11-30 13:23:10 +09:00
Risan
ea004dd75f [Android.bp] Add ARC++ product variable
Test: Compile
Bug: 64500663

Change-Id: I92739eb46029f7c808e1f1a928947b3ec596a0b2
2017-11-30 04:20:04 +00:00
Colin Cross
6510f91a1c Replace ModuleContext.AConfig() with Config()
AConfig() now duplicates Config().  Replace the uses of AConfig()
with Config().  Leave AConfig() for now until code in other
projects is cleaned up.

Test: m checkbuild
Change-Id: Ic88be643049d21dba45dbd1a65588ed94bf43bdc
2017-11-30 00:44:18 +00:00
Colin Cross
aabf67968c Make *Context.Config return a Config instead of a interface{}
In Soong, a Config() method will always return a Config.  Make
ModuleContext, SingletonContext, TopDownMutatorContext and
BottomUpMutatorContext's Config() methods explictly return
a Config to avoid having to type-assert everywhere.  Overriding
the Config method requires duplicating the list of methods in
blueprint.BaseModuleContext and blueprint.BottomUpMutatorContext,
following the same pattern used by the other *Contexts.

Config() obsoletes the AConfig() method used in some places, which
will be cleaned up in the next patch.

Test: m checkbuild
Change-Id: Ibe21efde933959811d52443496967ab8ce71215e
2017-11-30 00:44:11 +00:00
Jeff Gaston
178d5fefc0 Revert "Soong support for namespaces"
This reverts commit 63a250a336.

Reason for revert: Some failures:
  namespace_test.go:648: dir1/Blueprints:2:4: a namespace must be the first module in the file 
  such as New Build Breakage: aosp-master/build_test @ 4475274

Change-Id: I1b5db8eb934e51ff22241bfca44199d886b1393b
2017-11-30 00:43:43 +00:00
Colin Cross
54855ddca4 Convert a missed Singleton
Convert EnvSingleton to android.SingletonFactory.

Test: m checkbuild
Change-Id: Ia18b0b97718ba7c08d3f136f6f4096477d90c0f4
2017-11-30 00:42:49 +00:00
Jeff Gaston
63a250a336 Soong support for namespaces
Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
      --products=aosp_arm \
      'build/blueprint:work^ build/soong:work^' \
      'build/blueprint:work build/soong:work'
      # and see that the only changes were:
      # 1. adding some new files
      # 2. changing some line numbers
Test: m -j nothing # which runs unit tests

Change-Id: I6d3e52ef62c4cabe85b9a135a54de0e1a6aab29c
2017-11-29 13:03:40 -08: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
Jayant Chowdhary
3e6584556d Merge "Copy abidiffs into /abidiffs on abi breakages." 2017-11-28 22:38:32 +00: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
b06ad36c1f Merge "Autodetect files named Android.bp in tests" 2017-11-22 22:30:13 +00:00
Jeff Gaston
e261615792 Merge "Prohibit accidental renames of product config json fields" 2017-11-21 20:20:42 +00: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
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
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
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
Colin Cross
fff8ad2f35 Merge changes I5059a1e3,I5a06a893
* changes:
  Add --write_if_changed argument to soong_zip
  Add searchable android.DirectorySortedPaths
2017-11-14 23:44:25 +00:00
Colin Cross
5e6cfbead9 Add searchable android.DirectorySortedPaths
Add an android.DirectorySortedPaths that stores paths sorted such
that all paths in a directory including subdirectories are in a
contiguous subslice.  This will allow efficient O(log(N)) finding
of all paths in a directory using a binary search on the directory
prefix.

Test: TestDirectorySortedPaths in paths_test.go
Change-Id: I5a06a89351ae06e88c06526be54a6b79075361b7
2017-11-13 15:11:08 -08:00
Dan Willemsen
cbf9e827a7 Update default configuration
This isn't often used, but the values were quite old. So update them to
something closer to aosp_arm64 from today.

Bug: 68803744
Test: m clean; m --skip-make libc
Change-Id: Id5c60b62e7c7a91635dea9669fc604d63d299778
2017-11-13 14:46:44 -08:00
Colin Cross
62255a7687 Merge "Add presingletons" 2017-11-11 00:53:53 +00:00
Colin Cross
a0059915d1 Merge "Add OncePer.Get()" 2017-11-10 22:48:38 +00:00
Vishwath Mohan
1fa3ac552d CFI include/exclude path support (Soong)
This CL adds the ability to centrally enable or disable CFI for
components using either an environment or product config
variable. This is a better, nore manageable option that enabling CFI
across each component individually.

Bug: 67507323
Test: CFI_INCLUDE_PATHS= system/nfc m -j40
Test: CFI_EXCLUDE_PATHS = frameworks/av m -j40

Change-Id: I38b77946759121aec99ab25f31aaee2e5d993f73
2017-11-08 18:56:10 -08:00
Treehugger Robot
c7b8e72c91 Merge "Change bool, and string properties to *bool, and *string for cc" 2017-11-08 18:41:33 +00:00
Nan Zhang
0007d810e2 Change bool, and string properties to *bool, and *string for cc
there's no use case for prepending/appending to bool, and string
properties within module struct. Declearing "*bool" and "*string" almost
cover everything user need.

I did see one case that user specify relative_install_path as
path prefix in cc_defaults, and concatenate with the one in real module
to get the final relative install path in Android.bp <bionic/tests/libs>.

Test: m -j checkbuild
Bug: b/68853585
Change-Id: If3a7a2689c3fc307aae136af6bc9c57f27a1e1a0
2017-11-07 15:57:16 -08:00
Colin Cross
5a79c83893 Add presingletons
Plumb blueprint's presingletons through register.go.

Test: m checkbuild
Change-Id: I5bc0f311740c9220f7afdf2999e6f080f5b0c5ab
2017-11-07 13:36:44 -08:00
Colin Cross
99c6dfaecc Add OncePer.Get()
Allow functions to get the result associated with a OncePer key without
also specifiying a function.  Panics if the key has not already been
set.  Also replace the open-coded concurrent map implementation with
the new sync.Map.

Test: m checkbuild
Change-Id: I814fdb1ffffaee8398dc877af146e29638c8a6a8
2017-11-07 13:36:44 -08:00
Colin Cross
519917db89 Let LoadHooks call CreateModule
Move AppendProperties and PrependProperties into TopDownMutatorContext
so that LoadHooks can be a subset of TopDownMutatorContext that also
includes CreateModule.

Test: m checkbuild
Bug: 35570956
Change-Id: Iffa6a6aec96f08821c2446e0e0f4622ab772b54c
2017-11-07 13:08:36 -08:00
Dan Albert
f45c6934c8 Stop building MIPS ABIs for the NDK.
Test: build/soong/scripts/build-ndk-prebuilts.sh
Bug: https://github.com/android-ndk/ndk/issues/272
Change-Id: Ia8d48b1ecef5e1a3b239e2817eeed5dbe43e52ef
2017-11-03 19:38:03 +00:00
Treehugger Robot
d1dec3bd72 Merge "Revert "Revert "Make some common properties overridden when used in defaults modules""" 2017-11-02 00:10:39 +00:00
Colin Cross
7d716baedf Revert "Revert "Make some common properties overridden when used in defaults modules""
This reverts commit 5c3c768187.

This reapplies I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890 along with
additional changes in other projects to match the new types.

Bug: 68337468
Test: m checkbuild
Change-Id: I2d2d876b291869f834a6468d3e2ad99148f94a15
2017-11-01 14:24:48 -07:00
Colin Cross
126a25cb3d Propagate PRODUCT_MINIMIZE_JAVA_DEBUG_INFO to soong and use it
Strip debug info in javac when PRODUCT_MINIMIZE_JAVA_DEBUG_INFO
is set.

Test: m with PRODUCT_MINIMIZE_JAVA_DEBUG_INFO=true
Change-Id: I167e742662801291c516bf1ff826486560d22147
2017-11-01 12:51:16 -07:00
Nicolas Geoffray
5c3c768187 Revert "Make some common properties overridden when used in defaults modules"
Bug: 68337468

Breaks HOST_PREFER_32BIT=true

This reverts commit 617016a6f2.

Change-Id: Ifb20f41cdf93dbfd73a3aac5b055e595e334350b
2017-11-01 09:32:53 +00:00
Colin Cross
617016a6f2 Make some common properties overridden when used in defaults modules
Switch commonProperties to *string and *bool so that defining them
in a module correctly overrides instead of appends to values set
in defaults modules.

Bug: 68337468
Test: m checkbuild
Change-Id: I70e45caa92f65dc6a3bc81ae33a5a8f34ad11890
2017-11-01 05:28:36 +00:00
Treehugger Robot
76530ec6f7 Merge "Import AAPT-related product variables from make" 2017-10-31 23:39:24 +00:00
Colin Cross
face4e4563 Import AAPT-related product variables from make
Test: m checkbuild
Change-Id: I22113c17d240ff26652cea7df801a183343faebd
2017-10-30 17:36:41 -07:00
Treehugger Robot
7e768301b9 Merge "ModuleFactoryAdapter -> ModuleFactoryAdaptor" 2017-10-27 23:20:31 +00:00
Steven Moreland
b1448e4e0b ModuleFactoryAdapter -> ModuleFactoryAdaptor
Fixes type

Test: none
Change-Id: If1a85537243390a0e0d65b8911767288e00538c2
2017-10-27 14:46:47 -07:00
Nan Zhang
9a36418089 Use prebuilt turbine jar for unbundled javac builds.
Test: m -j
Change-Id: If2ab85f8591fe7ab275a1d4fefdd80d871f2c36d
2017-10-25 11:11:37 -07:00
Colin Cross
0617bb85c6 Fix missing source module with ALLOW_MISSING_DEPENDENCIES=true
A module referenced with srcs: ":module" was not honoring
ALLOW_MISSING_DEPENDENCIES=true.  Don't fail if the module
doesn't exist, an error will already have been produced by
ExtractSourcesDeps.

Bug: 68183622
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Id806633d12ab2ecd78b532e1922e59824e5c20a8
2017-10-24 13:05:06 -07:00
Colin Cross
d11fcda940 Convert Visit*Deps from blueprint.Module to android.Module
Also adds checks that the dependencies are android.Modules and
are not disabled.

Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
2017-10-24 13:01:03 -07:00
Colin Cross
b671544973 Move first/last unique elements utility functions to android package
Move firstUniqueElements to android.FirstUniqueStrings,
lastUniqueElements to android.LastUniqueStrings, and lastUniquePaths
to android.LastUniquePaths.

Test: m checkbuild
Change-Id: Ieac840405126c7f8f98afb4a4ef35c01a18fe7fb
2017-10-24 12:12:32 -07:00
Colin Cross
ae88703df5 Move ModuleContext.ModuleBuild to ModuleContext.Build
Now that android.ModuleContext does not include blueprint.ModuleContext
we can rename android.ModuleContext.ModuleBuild to
android.ModuleContext.Build without colliding with
blueprint.ModuleContext.Build.  Leave ModuleBuild as a wrapper around
Build for now to avoid having to update all the users outside
build/soong simultaneously.

Test: m checkbuild
Change-Id: I18eb8cc04faf002049a11d9aac97e9732ff5d638
2017-10-24 10:59:00 -07:00
Colin Cross
3f68a1362b Make android.ModuleContext not include blueprint.ModuleContext
android.ModuleContext should replace the blueprint.ModuleContext
methods with ones that take android.Module parameters instead of
blueprint.Module parameters.  As a first step, don't include
blueprint.ModuleContext in android.ModuleContext and manually
specify the methods from blueprint.ModuleContext that we need.
Future patches will replace these methods with ones that take
android.* types.  Also do the same for TopDownMutatorContext.

Test: m checkbuild
Change-Id: If11c298eed98bc65712b4942d0283cafa058726c
2017-10-24 10:58:59 -07:00
Colin Cross
0d3f8c0db6 Use prebuilt dx for PDK builds
The source for dx may not be available in PDK builds, use the
prebuilt one from prebuilts/build-tools instead.

Bug: 67663308
Test: m TARGET_BUILD_PDK=true
Change-Id: I9090b5190539f901fc05264a472133c12d4ea2a1
2017-10-24 10:52:26 -07:00
Nan Zhang
ed19fc3e2c Support Turbine in Soong.
If sdk jars(android_stubs_current, etc) are compiled using soong java
modules, we have to filter them when running Java build with Turbine.

TODO: provide more unit-tests.

Test: m clean && m -j32; go test java_test

Change-Id: Iad7c241b0e8b0ca760950733f513124b56c84564
2017-10-20 16:26:18 -07:00
Alan Leung
9e07394fd0 Merge "Add D8 support" 2017-10-20 18:59:22 +00:00
Alan Leung
1d476fcbeb Add D8 support
Bug: 67754178
Test: m -j32 checkbuild && USE_D8=true m -j32 checkbuild

Change-Id: If63afc10ceb5e753bbb7f195bb8a895eaef10775
2017-10-19 16:27:42 -07:00
Colin Cross
702e0f8ab0 Use full relative paths to get module outputs in tests
Make Rel() on ModuleOutPath and ModuleGenPath return the path
relative to the module out and module gen directories respectively,
and make TestingModule.Output() match against the full relative
path to the module.

Test: java_test.go still passes
Change-Id: Id5b2ec3fdef41d4169b943e68d032fc64a2b6f92
2017-10-19 20:44:11 +00:00
Jeff Gaston
294356f045 Automatically reorder C/C++ link dependencies in Soong
This uses knowledge of transitive dependencies to reorder
linker command line arguments such that if module A depends
on module B, then module A is automatically listed before
module B in the linker command line.

This should mostly remove the need for Android.bp files to
list all of their static dependencies in link order

Bug: 66260943
Test: reorder the entries of static_libs in an Android.bp and see that linking still succeeds

Change-Id: I20f851ab9f2f30031254e4f30023b6140d15d6c3
2017-10-18 14:30:05 -07:00
Jeff Gaston
af3cc2d23c Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: I88c24a8a31ef68f428919087d206433659265684
2017-10-18 18:06:02 +00:00
Colin Cross
99967a7b34 Allow arch-specific modules to be disabled in the PDK
Modules may need to be disabled in the PDK for the device but not
the host.

Test: m checkbuild
Change-Id: Ie40555d1437d9f36ceec753884dc4045132998eb
2017-10-17 16:25:26 -07:00
Colin Cross
93e8595044 Initial kotlin support
Allow java libraries to specify .kt sources, precompile them with
kotlin, and then pass them in the classpath to javac.

Bug: 65219535
Test: java_test.go
Change-Id: Ife22b6ef82ced9ec26a9e5392b2dadacbb16546f
2017-10-17 16:25:22 -07:00
Colin Cross
1369cdb280 Initial support for converting jars to java9 system modules
Adds a java_system_modules module type that (when
EXPERIMENTAL_USE_OPENJDK9 is set to true) converts a list of
java library modules and prebuilt jars into system modules,
and plumbs the system modules through to the javac command
line.

Also exports the location of the system modules to make
variables, as well as the name of the default system module.

Test: TestClasspath in java_test.go, runs automatically as part of the build
Bug: 63986449
Change-Id: I27bd5d2010092422a27b69c91568e49010e02f40
2017-10-16 15:00:02 -07:00
Jiyong Park
6a43f04777 Squash vendor sources before linkageMutator runs
linkageMutator removes srcs property of the shared variant of a lib in
order to reuse *.o files compiled for the static variant also to the
shared variant.

However, this causes problem when vendor-specific srcs are specified in
target: {vendor: {srcs: ["..."]}}. For example, let's assume

cc_library {
    name: "libfoo",
    srcs: ["foo.c"],
    target: {
        vendor: {
            srcs: ["bar.c"],
        },
    },
}

Then,
static_vendor: inputs = foo.o, bar.o
shared_vendor: inputs = foo.o (from static_vendor), bar.o (from
static_vendor), bar.o

So, bar.o is included twice and this causes multiple symbol definition
error.

In order to handle the problem, vendor mutator is applied before the
linkage mutator and the vendor-specific srcs are squashed in the vendor
mutator.

Bug: 67731122
Test: build
Test: cc_test.go

Change-Id: I2a5390295dddfc41260e9b6f02746908cdf47228
2017-10-13 14:36:12 +09:00
Colin Cross
6ccbc913e4 Let tests override environment
Pass an environment to TestConfig that will be used for
all Config.Getenv calls.

Test: none
Change-Id: I683cd9c9e0db61c9bfd2adb27fca78f558f225c4
2017-10-10 23:28:43 -07:00
Colin Cross
92430106c3 Add hostdex support
If hostdex: true is specified for a java library, create an extra
Make module that copies the dex jar to a module with a -hostdex
suffix in the host output directory.

Bug: 67600882
Test: m -j checkbuild
Change-Id: I859dfaabeefdca714b566de94e00f74e03c85939
2017-10-10 08:02:20 -07:00
Colin Cross
05a39cbacc Fix mixing genrule dependencies with globs
Putting a genrule dependency after a glob in a srcs property
was causing the generated files to be treated as globbed files
and hitting an interface conversion panic.

Bug: 67364649
Test: TestGeneratedSources in later patch
Change-Id: I8a076c9998fdd07e53769922be433a793ca575a9
2017-10-09 15:35:47 -07:00
Dan Willemsen
9d93e33b1e Merge "Add target.linux for linux kernel based targets" 2017-10-06 19:43:34 +00:00
Jeff Gaston
60e38b613f Merge "Revert "Some clarifications in preparation to automatically order linker dependencies"" 2017-10-04 21:09:29 +00:00
Jeff Gaston
7b6118be6b Revert "Some clarifications in preparation to automatically order linker dependencies"
This reverts commit 2370af0e23.

Reason for revert: New Build Breakage: aosp-master/aosp_arm64_ab-userdebug @ 4376965

Change-Id: Ibe4b819c4292457c454bf42e6d94fba3071ec04b
2017-10-04 21:07:42 +00:00
Jeff Gaston
2ade0243ae Merge "Some clarifications in preparation to automatically order linker dependencies" 2017-10-04 17:45:40 +00:00
Jeff Gaston
2370af0e23 Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: Ia3fdb8f38e83ad8225a72c8de2804db23a90ef9b
2017-10-03 17:18:01 -07:00
Colin Cross
19ab372dd8 Merge "Add support for .proto files in java modules" 2017-10-03 23:02:51 +00:00
Dan Willemsen
86fc1ebac3 Add target.linux for linux kernel based targets
This includes android, linux_bionic, and linux_glibc currently.

Test: m nothing
Change-Id: I088eab583eee695c1f61a65a79a302837e5f4577
2017-10-03 14:44:06 -07:00
Dan Willemsen
5746bd481e Remove target.linux
Once this is submitted and we don't have any more references to
target.linux, it can be added back as a common target for all
linux-kernel based targets.

Test: m nothing
Change-Id: Iae5e82eaed65f58950115f21530ae04afd0602b9
2017-10-03 19:44:54 +00:00
Colin Cross
6af17aa022 Add support for .proto files in java modules
Test: m -j checkbuild
Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
2017-10-03 10:25:15 -07:00
Colin Cross
d5934c8bb7 Fix arch specific properties for java modules
Arch specific properties were not being applied to modules
with OS set to Common.

Test: java_test.go
Change-Id: I8f1b49ca51b0cf96f78006dfcd121672e581d9c5
2017-10-02 23:18:19 -07:00
Colin Cross
0f37af0c15 Add java file resources and flag to include sources
Add a properties to allow including files as resources, including
support for filegroups.  Also add a flag that causes module sources
to be included in the final jar.

Test: java_test.go TestResources
Change-Id: Ida8ee59b28df9fe66952170f46470d3a09fd5d65
2017-09-29 14:02:22 -07:00
Dan Willemsen
866b563d4c Add target.linux_glibc and target.bionic
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).

target.bionic will apply to all OS variants using Bionic.

Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
2017-09-26 22:41:37 -07:00
Treehugger Robot
968df27a9c Merge changes I28a15bcc,I86cccefc
* changes:
  Add (host|host-cross|target)[-<OS>] phony targets when not using make
  Fix mma/mmma when soong is not embedded in make
2017-09-22 19:33:08 +00:00
Dan Willemsen
61d88b8fca Add (host|host-cross|target)[-<OS>] phony targets when not using make
Test: m --skip-make host-linux_bionic
Test: m --skip-make host
Change-Id: I28a15bcc690245f1a544a051868340b1dc818bb3
2017-09-20 18:23:32 -07:00
Dan Willemsen
d2e95fb295 Fix mma/mmma when soong is not embedded in make
Now `mma --skip-make` works.

Test: mmma --skip-make external/googletest
Change-Id: I86cccefc3c5174773d185c6e16bc52fe2c2010b3
2017-09-20 18:23:32 -07:00
Colin Cross
fc3674a607 Remove android_prebuilt_sdk modules
Forcing sdk modules to be declared explicitly is unnecessary, just
add the required dependencies on the jar and aidl files.

Test: java_test.go
Change-Id: Ib28bdc1051c5825e7c0efb6adff1f9282675560e
2017-09-20 13:20:45 -07:00
Colin Cross
ae4c6180a7 Add test infrastructure for running the arch mutator
Add TestArchConfig and NewTestArchContext to create a test context
that will run the arch mutator, which is necessary to test any code
that is inside a ctx.Device() block or similar.

Test: next patch
Change-Id: Ieb1a0326bc27fc18ba88b8d37655a7e0c6870d6c
2017-09-20 13:20:45 -07:00
Colin Cross
38f794ee49 Refactor proto in preparation for java proto support
Test: m -j checkbuild
Change-Id: Idf00ea0bacb2777458f9af2c7eb47e1e1854eeba
2017-09-11 12:41:58 -07:00
Colin Cross
5349941875 Use soong_java_prebuilt.mk to export soong jars to java
Instead of trying to squeeze soong jars through prebuilt_internal.mk,
make a separate soong_java_prebuilt.mk.

Test: m -j checkbuild
Change-Id: Idadef3c21a6f618d573110f04c80d7db3db92031
2017-09-07 20:23:43 +00:00
Colin Cross
32616ed3e0 Ignore environment variables in tests
The next change will cause java tests to fail if RUN_ERROR_PRONE=true
is set.  Make tests more hermetic by faking an empty environment.

Test: soong tests
Change-Id: I01057cb0c42ec08ebed8aea87505dd01e9981915
2017-09-05 22:08:13 -07:00
Colin Cross
aa76858e48 Fix path to notice file
Make expects notice files paths to be from the root of the tree.

Test: m -j checkbuild
Change-Id: Ic280a8a97797b9a088aeb4e4a52b79816d2d4197
2017-09-05 15:55:04 -07:00
Colin Cross
5aac362949 Add notice property to all modules
Add a notice property to all modules which, if set, propagates to
LOCAL_NOTICE_FILE in make.

Test: m -j checkbuild, examine out/soong/Android*.mk
Change-Id: I565a5624dfd7b376b976b1a43dac5cea96869026
2017-09-01 13:21:53 -07:00
Colin Cross
595a406f88 Pass --min-sdk-version to dx
Pass the sdk_version property, the platform sdk version, or 10000
to dx as --min-sdk-version.

Test: m -j checkbuild
Change-Id: I5fae03f44153dc2d6244c33f4c055e746980aefe
2017-08-31 13:48:52 -07:00
Colin Cross
5c51792926 Make binaries executable
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file.  Also remove InstallFile and rename
InstallFileName to InstallFile.

Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
2017-08-31 13:48:52 -07:00
Treehugger Robot
25393ebcc4 Merge "Remove more duplicated flags and dependencies" 2017-08-29 22:38:57 +00:00
Treehugger Robot
d1401c51af Merge "Add a name to API level map for O." 2017-08-29 21:04:31 +00:00
Dan Willemsen
fe92c968b9 Remove more duplicated flags and dependencies
All the stats below are for a hikey960-eng build on AOSP master.

Number of order-only inputs in out/soong/build.ninja:
Before: 2847162
After:   606508

Size of:                       Before  After
out/soong/build.ninja          572MB   233MB  -59%
out/soong/Android-hikey960.mk   15MB     9MB  -40%
out/build-hikey960.ninja       367MB   358MB   -2%

Ninja time in `m nothing`:
Before: 6.9s
After:  5.0s

Soong generation time:
Before: 11.6s
After:   6.6s

Test: m nothing
Test: wrote script that counted inputs, only duplicates were removed
Test: treehugger
Change-Id: I6b7c5ef5b1395014b7bf5fd0b8112d42bee127bf
2017-08-29 13:39:46 -07:00
Dan Albert
e3e4fc8693 Add a name to API level map for O.
O is released, so we don't get this knowledge from the development
codenames list any more.

Test: make ndk # with an API using introduced=O
Bug: None
Change-Id: I21104c5d97c89f2f85157ac7d73de8cd5a478571
2017-08-29 11:50:34 -07:00
Colin Cross
c6bbef326f Add error-prone support
Add support for compiling java sources with the error-prone tool.

Test: m -j checkbuild
Change-Id: Ieb4ee0e05f8f34a52ed7bcf1c7cbacf1c9c4d0b5
2017-08-28 11:12:38 -07:00
Dmitry Shmidt
dba5419dea Add product_variables.uml
Bug: 64985489
Test: Manual

Change-Id: Ief6f06770b4df54c3630fb8f1904da2336f294ff
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2017-08-23 15:57:20 -07:00
Dan Albert
fd7141ee24 Merge "Update the minimum NDK target API."
am: fb5a671c7c

Change-Id: I9c144909a9266d2fb45f77179166891c0874a2bc
2017-08-21 21:23:08 +00:00
Dan Albert
990419604a Merge "Expose the minimum supported SDK version to make."
am: fd697f4256

Change-Id: I1a7e7657258e6adbad88f9e51684e8238ab4ed18
2017-08-18 02:44:37 +00:00
Dan Albert
d4db4acffe Update the minimum NDK target API.
Gingerbread is no longer supported. ICS is now the minimum target.

Test: make checkbuild
Bug: None
Change-Id: I896b83d9984d90d907fe518cc722a4a3722626a1
2017-08-17 16:54:21 -07:00
Dan Albert
f5415d7cc6 Expose the minimum supported SDK version to make.
Right now this is hard coded in two places (here and in
core/binary.mk). Keep it in one place so it's easier to change.

Test: make checkbuild
Bug: None
Change-Id: I2a2c784d4c667b326f871e6144db92753c16c85f
2017-08-17 16:54:03 -07:00
Colin Cross
07b79f21dd Merge changes Id9717132,I3e3b7251,I021c7971,I8a117a86,Ia5196f1f, ...
am: b8245ea839

Change-Id: I9cd28715891eb9bbd6e0d1a3e0a3e83da2d1d00f
2017-08-12 01:19:58 +00:00
Colin Cross
0f86d186b1 Allow AndroidMkData.Custom handlers to extend normal values
Pass accumulated AndroidMkData to AndroidMkData.Custom handlers
and expose WriteAndroidMkData so that Custom handlers can write
out the normal make variables and then add their own.

Test: No change to out/soong/Android-aosp_sailfish.mk
Change-Id: Id9717132bbd6c5cf3af8596f3eaa9bbb05d98e40
2017-08-11 15:24:11 -07:00
Colin Cross
a18e9cfa29 Remove error from AndroidMkDataProvider.AndroidMk
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808
2017-08-11 15:24:11 -07:00
Colin Cross
91825d2279 Remove error from AndroidMkData.Custom
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I021c7971ede3e11bbe08cf1601f4690ed4d1a036
2017-08-11 15:24:11 -07:00
Colin Cross
27a4b05441 Remove error from AndroidMkData.Extra
It's never anything except nil, and it unnecessarily complicates
the implementations.

Test: m -j checkbuild
Change-Id: I8a117a86aa39aeb07d9d8d0686ef869c52784f19
2017-08-11 15:24:11 -07:00
Colin Cross
6416271a1f Bring java support closer to current version of make
Make the javac arguments match what is used by make, and export them
back to make.  A future change will switch make to use the the
exported ones.

This makes a dx.jar compiled with soong have identical class files
as one compiled with make.

Test: manual
Change-Id: Ia5196f1f42bc564e99de22e32e72fd2930e9fbae
2017-08-11 15:24:11 -07:00
Colin Cross
74d73e2bfb Rename java_prebuilt_library to java_import
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.

Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
2017-08-11 15:24:11 -07:00
Colin Cross
7fcfcb180f Merge changes I047d103b,I35de5d93,I3327d275
am: ec0aca3a84

Change-Id: If2db96c28fe9276eacab1e39982546ce6eb39edf
2017-08-08 04:45:08 +00:00
Treehugger Robot
ec0aca3a84 Merge changes I047d103b,I35de5d93,I3327d275
* changes:
  Add prebuilts/misc to root.bp
  Export java modules to make
  Fix java prebuilts
2017-08-08 04:38:45 +00:00
Dan Albert
7e73d5f3c6 Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
am: 31384debd7

Change-Id: Ib27259053a381f98a73b4dbc0421efce3ef31516
2017-08-03 02:27:44 +00:00
Dan Albert
31384debd7 Adapt to PLATFORM_VERSION_FUTURE_CODENAMES.
Don't preserve the confusing names from make. Rename AllCodenames to
ActiveCodenames, add FutureCodenames, and add CombinedCodenames to
fetch the *real* AllCodenames.

To allow `introduced=P` in NDK library definitions, we need to know
that P exists. Use the combined list of current and future API
codenames generating stubs.

Test: make ndk
Test: check out/soong/api_levels.json
Bug: None
Change-Id: I435f9ce7446236edc268a84e33474044a55a6302
2017-08-02 17:14:10 -07:00
Dan Albert
35f9c2290d Merge changes from topic 'ndk-weak-stubs'
am: bbe3ff4c50

Change-Id: I00a2f6b59ee9e1dfa1f5dbf27e0dea332e686637
2017-08-01 23:19:34 +00:00
Treehugger Robot
bbe3ff4c50 Merge changes from topic 'ndk-weak-stubs'
* changes:
  Add NDK API codenames for old releases.
  Add support for weak symbols in the NDK stubs.
2017-08-01 23:11:12 +00:00
Colin Cross
5ea9bcc50b Fix java prebuilts
The java prebuilt tests weren't registering the prebuilts mutators,
which hid an issue where prebuilts modules weren't getting renamed
to avoid collisions with source modules of the same name, which
ended up causing the prebuilt module to try to add a dependency
on itself.

Test: java_test.go
Change-Id: I3327d27533591cb08a4b8b8b5e1668a6f72be8df
2017-07-31 23:50:01 -07:00
Junmo Park
30486cb174 Merge "Add support for Exynos-M1"
am: ed2c78ef4e

Change-Id: Icd449eec1dc95e456725e03e0663979c698c4a49
2017-08-01 01:07:07 +00:00
Treehugger Robot
ed2c78ef4e Merge "Add support for Exynos-M1" 2017-08-01 01:00:37 +00:00
Dan Albert
151027107d Add NDK API codenames for old releases.
Without these, we'd need to go rewrite all the stub templates to stop
using the codename and use the number instead whenever an API is
released.

Test: changed something in libc to use introduced=L, make ndk
Bug: None
Change-Id: I1b8703655664c567f8a5c36219e73f11ba27d99a
2017-07-28 12:31:28 -07:00
Josh Gao
eb08b587b1 Merge "Delete output files before copying to them."
am: 074a5d35bf

Change-Id: I37673bb2aae7076a18788b36a917625d95474302
2017-07-27 02:04:38 +00:00
Treehugger Robot
074a5d35bf Merge "Delete output files before copying to them." 2017-07-27 01:53:56 +00:00
Josh Gao
ae15271392 Delete output files before copying to them.
Avoid ETXTBSY when copying over a file that's being executed.

Test: manual
Test: m -j
Change-Id: I0427b5018e67e12f685bce95028831b5661eee2c
2017-07-26 15:38:40 -07:00
Dan Willemsen
a9d4cf2323 Use a unified ninja builddir
am: 05f17764c3

Change-Id: I61cc01591b05b476b7d1d5c495753edc7b5eb9aa
2017-07-25 12:50:49 +00:00
Dan Willemsen
05f17764c3 Use a unified ninja builddir
Instead of calling SetNinjaBuildDir, pass it to bootstrap.bash, so that
the bootstrap package can set it consistently during bootstrapping and
normal execution.

Bug: 63720725
Test: m -j nothing
Test: mkdir o; ../bootstrap.bash; ./soong
Change-Id: Ica88d2d5f1461b5be49bfe6316c6ec4ef4d89d49
2017-07-24 15:58:20 -07:00
Junmo Park
8ea4959279 Add support for Exynos-M1
Change-Id: Ie57507a5d0ea9101db603ff3538c51853083a314
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-24 07:14:55 +09:00
Junmo Park
8e0416b422 Merge changes I646f303b,I294ca692
am: 99cd671ac3

Change-Id: I435d78bc24058cb84fc2dcc9e687e03967112b74
2017-07-22 02:13:40 +00:00
Treehugger Robot
99cd671ac3 Merge changes I646f303b,I294ca692
* changes:
  Add support for Exynos-M2.
  Override mcpu option of ToolingCFlags when mcpu is eyxnos-m2.
2017-07-22 02:08:18 +00:00
Junmo Park
d86c902470 Add support for Exynos-M2.
Change-Id: I646f303b460556a9b36a44574f25dd992d42906c
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
2017-07-22 09:16:31 +09:00
Colin Cross
2947e85c2c Add support for java_defaults modules
am: 89536d4948

Change-Id: Ie88290932bd250629cfb7a02193d127bf212990f
2017-07-20 07:59:53 +00:00
Colin Cross
89536d4948 Add support for java_defaults modules
Test: java_test.go
Change-Id: I6dba1671c7eb019183af94bb7b10810296740101
2017-07-20 05:47:27 +00:00
Colin Cross
b6b050c4cf Merge "Don't pass same argument twice for defaults modules initialization"
am: 25167cdc7a

Change-Id: I46a2d77a2bb5f6597cc98eaffaa3f2f59ce21209
2017-07-20 04:01:39 +00:00
Colin Cross
1f44a3aa4f Don't pass same argument twice for defaults modules initialization
InitDefaultsModule and InitDefaultableModule were requiring the
module to be passed in as an argument twice, once as a
android.Module and once as an android.DefaultableMOdule.  Use
a type assertion instead.

Test: builds
Change-Id: I57d721e68a4f016e02c17a678af5f2ba25a9a430
2017-07-19 23:14:36 +00:00
Dan Willemsen
737623108d Merge "Switch owner to *string to disable concat"
am: 1651953ca5

Change-Id: I020d7e1ed733ccfc3035aca98fda0417771ecfda
2017-07-19 04:33:38 +00:00
Dan Willemsen
efac4a87ee Switch owner to *string to disable concat
If owner is specified in a defaults module, we shouldn't concat that
with the owner specified in a module using that defaults module. A
string pointer will produce the correct behavior (overriding the default)

Bug: 37330627
Test: out/soong/Android-*.mk looks correct after this change
Change-Id: I64574e2ba81c11b042248d7a44702ec4534ee932
2017-07-18 19:42:09 -07:00
Ivan Lozano
9f32b6b23b Merge "Allow integer_overflow sanitizer path exclusion."
am: 335565d300

Change-Id: Id19a2328970b540fcbcddb9421a2973eada302a7
2017-07-19 01:14:29 +00:00
Ivan Lozano
5f59553bca Allow integer_overflow sanitizer path exclusion.
Add support for excluding paths from having integer_overflow applied to
them when using SANITIZE_TARGET=integer_overflow via an
INTEGER_OVERFLOW_EXCLUDE_PATHS make variable. This covers the soong side
of the change.

Bug: 30969751
Test: Build with SANITIZE_TARGET=integer_overflow
SANITIZE_TARGET_DIAG=integer_overflow
INTEGER_OVERFLOW_EXCLUDE_PATHS=<path> and confirmed this was no
longer being applied to binaries in that path.

Change-Id: I298b772f5425da28dff1cf007825be19558db3a8
2017-07-18 13:38:20 -07:00
Colin Cross
daf9154992 Merge "Add integration testing infrastructure"
am: dddf50039a

Change-Id: I7e378c07ae859e45ad461545401f69fade6137f0
2017-07-18 00:07:20 +00:00
Colin Cross
cec8171420 Add integration testing infrastructure
Fix mutator registration for tests to allow different tests
in the same package to register different mutators.

Allow tests to track the resulting ModuleBuildParams objects
to use in assertions, and provide helpers for getting them.
For example:
    config := android.TestConfig(buildDir)
    ctx := android.NewTestContext()
    ctx.RegisterModuleType(...)
    ctx.MockFileSystem(...)
    ctx.ParseBlueprintsFile("Android.bp")
    ctx.PrepareBuildActions(config)
    ctx.Register()
    // Get the Inputs value passed to the javac rule for the foo module
    inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs

Test: java_test.go
Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
2017-07-14 14:19:51 -07:00
Jiyong Park
fc728d9598 add device_kernel_headers module for vendor-specific kernel headers
am: d773eb3e86

Change-Id: I5df3aded9d8ba25cde31eee61ca337eb74113ef4
2017-07-08 03:18:59 +00:00
Jiyong Park
d773eb3e86 add device_kernel_headers module for vendor-specific kernel headers
device_kernel_headers is a built-in heder-only lib that provides device-specific
kernel headers. The header path is configured via a new product variable
SystemIncludeDirs, which is currently the mirror of
TARGET_PROJECT_SYSTEM_INCLUDES in the make world.

Note: generic kernel headers (bionic/libc/kernel) have been added to the
include path by default. "device_kernel_headers" module is for device-specific
kernel headers such as /device/*/*/kernel-headers.

Note 2: this is opt-in for Android.bp modules (i.e. header_libs :
["device_kernel_headers"] required.) while it is always provided to
Android.mk modules.

Bug: 62939405
Test: choosecombo to aosp_sailfish (or any other Pixel/Nexus targets)
BOARD_VNDK_VERSION=current m -j gralloc.msm8996 (or any other vendor
libs using vendor-specific kernel headers)

Change-Id: I81c60abc13942c89fff723d1544b27a81b300db0
2017-07-08 09:29:04 +09:00
Ivan Lozano
1523dadc8b Add integer_overflow sanitization build option.
am: 0c3a1efae4

Change-Id: I5fcdec7b89b8104e532b945f30a966dc95c80518
2017-07-07 20:12:58 +00:00
Ivan Lozano
0c3a1efae4 Add integer_overflow sanitization build option.
Adds the SANITIZE_TARGET=integer_overflow build option to apply signed and
unsigned integer overflow sanitization globally. This implements the
Soong side of the build option.

An additional build option is provided to control whether or not to run
in diagnostics mode, controlled by SANITIZE_TARGET_DIAG. This works the
same way that SANITIZE_TARGET does and currently only supports
'integer_overflow' as an option.

A default sanitizer blacklist is added to avoid applying sanitization
to functions that are likely to exhibit benign overflows.

Bug: 30969751
Test: Building with and without the new flags, device boot-up, tested
various permutations of controlling the new flags from build files.

Change-Id: Ibc8a8615d3132f1a23faaf1cb4861f24c5ef734a
2017-07-07 09:52:23 -07:00
Dan Willemsen
b24b042eee Merge "Fix install location for vendor tests"
am: e9425b0277

Change-Id: Ia44a50350f0980cb1bec364088e53b6e0d39a388
2017-07-07 03:38:25 +00:00
Treehugger Robot
e9425b0277 Merge "Fix install location for vendor tests" 2017-07-07 03:30:13 +00:00
Dan Willemsen
00269f23ee Fix install location for vendor tests
These should be install in /data/nativetest* with the rest of the tests,
but had been moved to /vendor/nativetest* accidentally. Add some tests
so that this doesn't happen again.

Bug: 63393698
Test: m -j blueprint_tools
Test: compare out/soong/Android-aosp_arm64.mk
Test: compare out/soong/build.ninja
Change-Id: Id3b08a7e3908955df18a043a02ea576dc88086c3
2017-07-06 18:09:46 -07:00
Nan Zhang
9cfe44255b Merge "Fixed the unexpected scenario for "device_supported""
am: 195fb4183c

Change-Id: Ideac7ca40ce3e514e76356305ee456b7d8ad5447
2017-07-06 18:36:08 +00:00
Nan Zhang
1a0f09bc56 Fixed the unexpected scenario for "device_supported"
cc_defaults {
    name: boo,
    device_supported: false,
}

cc_library_static {
    name: foo,
    defaults: [boo],
}

Soong still tried to build foo_android_arm/arm64 device target which is not what we
expected.

Test: m -j checkbuild

Change-Id: I26a67c9ea024f5458f0818def0fa10cecc5fb7cf
2017-07-05 10:37:57 -07:00
Colin Cross
c59a0042a1 Refactor factories
am: 36242850fd

Change-Id: Ied58f93022523557a5d28edbcd79a76b8e2fb875
2017-06-30 22:54:46 +00:00
Colin Cross
36242850fd Refactor factories
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.

Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
2017-06-30 21:08:36 +00:00
Colin Cross
7c9bfa1f00 Fix panic in builds with no device am: 20e1365e61
am: 414e59cb8b

Change-Id: Id56046edf8bdb5a674f2517d9aba8d8757a536fb
2017-06-23 20:33:07 +00:00
Colin Cross
20e1365e61 Fix panic in builds with no device
Running prebuilts/build-tools/build-prebuilts.sh in a repo that
contains art/build/art.go panics because config.Targets[Device] is
empty.  Check the length before accessing the slice.

Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: Ifb9fe0fad07b22d6b574f505c08c5c761278aad0
2017-06-23 10:57:36 -07:00
Jeff Gaston
bdbcdda527 Have Soong try to enforce that genrules declare all their outputs. am: efc1b412f1
am: fe4bf0f9a7

Change-Id: Ib9276c8ed8c72103cc1cc6ead64c976cfaf22eb3
2017-06-09 22:20:57 +00:00
Jeff Gaston
efc1b412f1 Have Soong try to enforce that genrules declare all their outputs.
This causes Soong to put the outputs of each genrule into a temporary
location and copy the declared outputs back to the output directory.
This gets the process closer to having an actual sandbox.

Bug: 35562758
Test: make

Change-Id: I8048fbf1a3899a86fb99d71b60669b6633b07b3e
2017-06-09 17:57:18 +00:00
Vishwath Mohan
24f4655075 Merge "Fix install path for sanitized native tests. (Soong)" am: d20ac72951
am: 9132b17c47

Change-Id: I4724d2113177e89352f20eb9284ebe4d04888204
2017-06-08 03:02:25 +00:00
Vishwath Mohan
87f3b24418 Fix install path for sanitized native tests. (Soong)
This CL fixes a bug with how Soong builds the install path for native
tests. Tests are installed in /data/nativetest* by default, but the
logic was wrongly redirecting sanitized versions to
/data/asan/system/nativetest*. With this fix, they are correctly
redirected to /data/asan/data/nativetest* instead.

Bug: 37942061
Test: lunch marlin_asan-userdebug && \
        SANITIZE_TARGET="address" m -j70  \
        # nativetests are generated in /data/asan/data/nativetest*

Change-Id: I0c132af5d443151c44219d231770049fddf79bbe
2017-06-07 12:31:57 -07:00
Chris Larsen
48f2ffabb1 Merge "MIPS: Lower LibartImgDeviceBaseAddress() to fix ART tests." am: d55aa7bdad am: e75269a157
am: 24375a84ab

Change-Id: I73abfc65eabf6b0effef8d5e3ab2d888eb0d56a0
2017-05-31 11:47:21 +00:00
Treehugger Robot
d55aa7bdad Merge "MIPS: Lower LibartImgDeviceBaseAddress() to fix ART tests." 2017-05-31 11:32:31 +00:00
Chris Larsen
ae7f3e26ec MIPS: Lower LibartImgDeviceBaseAddress() to fix ART tests.
Some of ART tests fail to mmap memory unless
LibartImgDeviceBaseAddress() is further lowered.

Test: booted MIPS32R2 in QEMU
Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU
Test: test-art-target-gtest
Test: testrunner.py --target --optimizing
Test: repeat all of the above in configurations
      ART_READ_BARRIER_TYPE=TABLELOOKUP,
      ART_USE_READ_BARRIER=false
Test: repeat the above tests on CI20

Change-Id: I48cd9d8074e07073cc6abb2153660e00017b9e6b
2017-05-30 16:38:42 -07:00
Colin Cross
550b646480 Merge "Add pdk product variable" am: e5598169b3 am: 8a328382bf
am: 6a30684b33

Change-Id: Ie60495934426998d523f5f2c670c052fb08c22fb
2017-05-26 19:45:26 +00:00
Colin Cross
e5598169b3 Merge "Add pdk product variable" 2017-05-26 19:34:32 +00:00
Jayant Chowdhary
84c60fc8d5 Merge "Optimizations to abi checking." am: 4e87d89066 am: 87e5bd425c
am: dbfe6309ca

Change-Id: I1cc65bbf420e970c01680811e3d58bdf69fea2cc
2017-05-25 23:55:00 +00:00
Jayant Chowdhary
715cac3971 Optimizations to abi checking.
We now add export_static_lib_headers, export_generated_headers to the
filters while dumping the abi of a library using header-abi-dumper
(through -I<dir> additions to the invocation of header-abi-dumper and
header-abi-linker)

Also add support for zipped reference source based abi dumps.

Test: mm -j64 in hardware/interfaces/nfc/default/1.0 produces
android.hardware.nfc@1.0.so.lsdump with abi filtered out using generated
headers.

Test: Copied the linked abi dumps produced by mm -j64 in bionic/libc to
prebuilts/abi-dumps/ndk and gzipped them. Ran mm -j64 again in
bionic/libc and verified header-abi-diff getting invoked.

Bug: 32750600

Change-Id: I26210af908c87a6143e39fa25f50307acb68a387
2017-05-25 14:46:58 -07:00
Colin Cross
dab550d68b Add pdk product variable
The pdk product variable will be set by make when TARGET_BUILD_PDK
is set, and can be used to disable modules that won't build in the
PDK.

Test: builds
Bug: 62086238
Change-Id: I2191a57b9b06680fd741308e7464275a89773530
2017-05-25 10:18:24 -07:00
Steven Moreland
35d1479b03 Merge "Add Treble as soong variable." am: a9ec71f54f am: 8fc756987e
am: b3d3ced720

Change-Id: Icbb81962f6a735c2da22b1d0ee2c4fa8a93d9250
2017-05-20 00:19:37 +00:00
Steven Moreland
e24bc204c9 Add Treble as soong variable.
This exposes PRODUCT_FULL_TREBLE.

This is required so that we can add sane defaults to Treble code.

Test: manual
Bug: 38415912
Change-Id: Ia3ea4aeee799b998380a1600026075dab66286a3
2017-05-19 15:19:57 -07:00