Commit Graph

702 Commits

Author SHA1 Message Date
Christopher Ferris ba14a8f4bb Add support for cortex-a55/cortex-a75.
Bug: 78133793
Bug: 78242072

Test: Builds when using cortex-a75 as a target.
Change-Id: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
Merged-In: Ie3fbe40b15f4d89eeba0d630a82097122fc83b33
(cherry picked from commit 0612597a41)
2018-05-11 00:43:39 +00:00
Colin Cross bfd347dc82 Pass platform version name as --version-name for framework-res.apk
framework-res.apk should get the platform version name ("9") as
--version-name, not the SDK version ("28").  It will get copied
to compileSdkVersionCodename in APKs compiled against it.

Bug: 78324052
Test: aapt dump badging $OUT/system/framework/framework-res.apk | grep -i version
Change-Id: I34a601cb2c14f66199066e7d598862108da0b950
Merged-In: I34a601cb2c14f66199066e7d598862108da0b950
(cherry picked from commit b691e24d89)
2018-05-09 15:56:46 -07:00
Colin Cross 37d46e43e7 Pass platform version name as --version-name for framework-res.apk
am: b691e24d89

Change-Id: I3fad46dcbc4f61aa5dbb66b4cc4a8eac1cd70e94
2018-05-09 14:40:27 -07:00
Colin Cross b691e24d89 Pass platform version name as --version-name for framework-res.apk
framework-res.apk should get the platform version name ("9") as
--version-name, not the SDK version ("28").  It will get copied
to compileSdkVersionCodename in APKs compiled against it.

Bug: 78324052
Test: aapt dump badging $OUT/system/framework/framework-res.apk | grep -i version
Change-Id: I34a601cb2c14f66199066e7d598862108da0b950
2018-05-09 12:26:06 -07:00
Tri Vo 64f343598a Merge "Expose selinux variables to Soong." am: c5934c55c7
am: 368e0ab5a2

Change-Id: I2377ca5f20e8c7c7ffb6ef856f4081b03b66fe85
2018-05-08 19:15:31 -07:00
Tri Vo c5934c55c7 Merge "Expose selinux variables to Soong." 2018-05-09 01:57:14 +00:00
android-build-prod (mdb) 30d728b786 Merge "Don't install modules in unexported namespaces" am: bd1dd19c3a
am: 263532199c

Change-Id: I2072191b468d571de3f6a2f81d6cfef2d5d0142d
2018-05-08 11:40:48 -07:00
Colin Cross 3607f21303 Don't install modules in unexported namespaces
Make builds handle modules with duplicate names in different
namespaces by passing a list of exported namespaces to Soong.
Soong-only builds can try to install both modules, leading to
a duplicate rule error.  Re-use the same list of exported
namespaces in Soong, which will be empty in all existing
Soong-only builds.  This will effectively only install modules
in the root namespace in Soong-only builds.

Test: m checkbuild
Bug: 79369665
Change-Id: Ie80d4b77e1dce165a33579fcf58b571989794b35
2018-05-07 15:28:05 -07:00
Tri Vo 35a5143aee Expose selinux variables to Soong.
Bug: 33691272
Test: manual
Change-Id: I4a568fb25a36331afb2ca51c3d8a676c3aba09e1
2018-04-30 11:26:55 -07:00
Jiyong Park 5edf8e8580 Add prebuilt_etc_xml am: 5a8d1bee89
am: 6455f181e9

Change-Id: I00e8d1adf36a2b0a0dbd2979ecf0d7f574ae66e0
2018-04-27 10:29:03 -07:00
Jiyong Park 5a8d1bee89 Add prebuilt_etc_xml
prebuilt_etc_xml installs an xml file to <partition>/etc[/<subdir>] and
validates the xml file against the given DTD file before installing it.

This change also includes some fixes for prebuilt_etc which is the super
module of prebuilt_etc_xml:

1) The module is changed to arch-specific module as the prebuilts are only
for devices (installed under the etc dir), but not for hosts.

2) Dependency to android.Prebuilt is removed because android.Prebuilt is
intended to be used for the case when a module can exist as prebuilts,
source or both. These prebuilt_etc_* modules are prebuilt only.

3) srcs property which accepts a list of source files is changed to src
that only accepts single source file, which makes more sense for
prebuilts.

Bug: 65686190
Test: m -j (xml_test.go)
Change-Id: I40484f3f6615b99f6b8d43176db0c40c5bfd838e
2018-04-28 00:13:00 +09:00
Logan Chien 5f4da1cd13 Introduce runtime_libs to cc_binary and cc_library am: 43d34c38d8
am: 2a2833185a

Change-Id: Ib2f0dfeb1b496b60942bbd0283299063b88fb924
2018-04-25 17:01:47 -07:00
Logan Chien 43d34c38d8 Introduce runtime_libs to cc_binary and cc_library
This commit adds `runtime_libs` to cc_binary and cc_library.

Similar to the `required` property, if a module specifies the
`runtime_libs` properties and it is installed, then the modules
specified in `runtime_libs` will be installed as well.

Differnt from the `required` property, if a module is using VNDK and the
module names specified in `runtime_libs` are resolved to the modules
with both core and vendor variants, then '.vendor' will be appended to
those module names.

For example, if `libb` is vendor_available and `libd` is a vendor lib,
then LOCAL_REQUIRED_MODULES will contain `libb.vendor` (instead of
`libb`).

Bug: 72343507
Test: lunch aosp_arm64_ab-userdebug && make  # this runs the unit tests
Test: Create a vendor module with runtime_libs property to a
vendor_available shared library and check the generated Android.mk.

Change-Id: I9e245d80004dab597a5d3db5acd8a09117118db7
2018-04-25 14:47:50 +08:00
Jiyong Park ec16fcbc89 Merge "Adding java_sdk_library" am: dcbc89a3ab
am: f4b9a287b1

Change-Id: I1a56aacfd2915b1d678416d21650178be716de08
2018-04-19 11:51:24 -07:00
Jiyong Park c678ad3f71 Adding java_sdk_library
java_sdk_library is to make a Java library that implements optional
SDK APIs to apps. It is actually a wrapper for several modules: 1) stubs
library that clients are linked against to, 2) droiddoc module that
internally generates API stubs source files, 3) the real runtime shared
library that implements the API, and 4) XML file for adding the runtime
lib to the classpath at runtime if requested via <uses-library>.

Note: this is only the initial CL for the feature. Followings are features
currently missing and under development.

1) check for API consistency
2) install stubs libs as the dist artifacts
3) ensuring that apps have appropriate <uses-library> tag
4) disallowing linking to the runtime shared lib
5) HTML generation

Bug: 77575606
Test: m -j

Change-Id: I4a4ccf6e730e041703c63bb275d8860d0de96887
2018-04-19 08:57:30 +09:00
Colin Cross 3f49fcb62b Merge "Fix aapt2 --min-sdk-version after finalized SDK" am: 59bcf6e631
am: 9d0af2e737

Change-Id: I9d43e2d829aac6273be319968c9afb37b8331570
2018-04-18 15:35:23 -07:00
Colin Cross 10f450962a Merge "Reverse RRO dir paths when passing to Make" am: 5ddf292268
am: f5a9cca054

Change-Id: I90e4766ef62487963dd10b7138af01effcafef79
2018-04-18 15:35:11 -07:00
Colin Cross 9ccbc6036d Reverse RRO dir paths when passing to Make
LOCAL_RESOURCE_DIRS puts the highest priority overlay first, but
aapt2 expects the highest priority overlay last.  Soong stores the
list in aapt2 order (low to high priority), but that means when it
exports to Make as LOCAL_SOONG_RRO_DIRS, which goes to
build_rro_package.mk and then package_internal.mk, it gets reversed
again and comes out backwards.

Bug: 78032566
Test: m checkbuild
Change-Id: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
Merged-In: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
(cherry picked from commit a140bb05f1)
2018-04-18 15:26:55 -07:00
Colin Cross 59bcf6e631 Merge "Fix aapt2 --min-sdk-version after finalized SDK" 2018-04-18 22:22:25 +00:00
Colin Cross 5ddf292268 Merge "Reverse RRO dir paths when passing to Make" 2018-04-18 22:22:06 +00:00
Pirama Arumuga Nainar 6c77d18183 Fix few issues with filegroups am: 955dc4999e
am: daf0ac55ea

Change-Id: I28fe1931c64564cf1a0f34e4a0cc042e6c9ccc9e
2018-04-18 14:15:29 -07:00
Colin Cross e20c1b1904 Fix aapt2 --min-sdk-version after finalized SDK
aapt2 --min-sdk-version was using AppsDefaultVersionName(), which
is OMR1 for a non-finalized SDK, but 8.1.0 after finalization.
Add PlatformSdkCodename() for non-finalized SDKs, use it for
DefaultAppTargetSdk(), and pass it for aapt2 --min-sdk-version.

Bug: 78224641
Test: TestAppSdkVersion in app_test.go
Change-Id: I622eaf92f8a940f79007c2a579536da325700b06
Merged-In: I622eaf92f8a940f79007c2a579536da325700b06
(cherry picked from commit d09b0b653b)
2018-04-18 12:48:02 -07:00
Colin Cross d09b0b653b Fix aapt2 --min-sdk-version after finalized SDK
aapt2 --min-sdk-version was using AppsDefaultVersionName(), which
is OMR1 for a non-finalized SDK, but 8.1.0 after finalization.
Add PlatformSdkCodename() for non-finalized SDKs, use it for
DefaultAppTargetSdk(), and pass it for aapt2 --min-sdk-version.

Bug: 78224641
Test: TestAppSdkVersion in app_test.go
Change-Id: I622eaf92f8a940f79007c2a579536da325700b06
2018-04-18 12:39:25 -07:00
Pirama Arumuga Nainar 955dc4999e Fix few issues with filegroups
Bug: http://b/64121881
Bug: http://b/78188880

- Allow filegroup's properties to be extended by a LoadHook
- Support a filegroup (':module') in a prebuilt's 'Srcs' property to
export files from a different path as the prebuilt's sources.

This change also includes a refactoring that moves genrule/filegroup.go
to android/filegroup.go so that FileGroupFactory is visible in
prebuilt_test.go.

Test: Test
https://android-review.googlesource.com/c/platform/development/+/469159
in clang-tools branch on Linux, Darwin.  Test regular build in
aosp/master.

Change-Id: I3ff6215ab2e62955f039fd1086c31f1bd50ebcf6
2018-04-18 18:56:33 +00:00
Colin Cross a140bb05f1 Reverse RRO dir paths when passing to Make
LOCAL_RESOURCE_DIRS puts the highest priority overlay first, but
aapt2 expects the highest priority overlay last.  Soong stores the
list in aapt2 order (low to high priority), but that means when it
exports to Make as LOCAL_SOONG_RRO_DIRS, which goes to
build_rro_package.mk and then package_internal.mk, it gets reversed
again and comes out backwards.

Bug: 78032566
Test: m checkbuild
Change-Id: If72bf929fbf1d126f9051a2f21ec1eb4e3030e6e
2018-04-17 10:53:54 -07:00
Dan Willemsen 8328367c44 Add VendorConfig for board-level Soong plugin configuration
This allows Soong (Go) plugins to get custom configurations set in the
current product's BoardConfig.mk.

I'll have some more comprehensive documentation later, but the general
concept is that you'd have one namespace per plugin, defined in the
BoardConfig.mk (though they would work in the product.mk files too):

  SOONG_CONFIG_NAMESPACES += myPlugin

Within that namespace you can set key-value pairs:

  SOONG_CONFIG_myPlugin := key1 key2 ...
  ...
  SOONG_CONFIG_myPlugin_key1 := value
  ...
  SOONG_CONFIG_myPlugin_key2 := true

Then in your plugin, you can ask for your namespace:

  vars := ctx.Config().VendorConfig("myPlugin")

And then use them:

  str := vars.String("key1")
  if vars.Bool("key2") { ... }
  if vars.IsSet("key3") { ... }

Warning: It's not a good idea to fail on missing inputs, since an
android tree may contain plugins from multiple owners, and we may
configure your modules (but not build/install them) even if they're not
meant for the currently configured product.

Bug: 76168832
Test: define some variables, use them
Test: m blueprint_tools
Change-Id: I4c38f5a4344022c6f332de279d9bbef24502e741
Merged-In: I4c38f5a4344022c6f332de279d9bbef24502e741
(cherry picked from commit 0fe7866897)
2018-04-17 10:34:23 -07:00
Dan Willemsen d57ed550fd Make Config.ProductVariables private
All access to these should be going through the methods on Config /
DeviceConfig.

Bug: 76168832
Test: m blueprint_tools
Change-Id: I47512dd58fb1a1a3f25838a9b1adaed2c41af8d3
Merged-In: I47512dd58fb1a1a3f25838a9b1adaed2c41af8d3
(cherry picked from commit 45133ac184)
2018-04-17 10:34:23 -07:00
Dan Willemsen cb3bff1b65 Expose ProductVariables from TestConfig
In preparation for unexporting ProductVariables, explicitly return a
pointer to the structure from TestConfig / TestArchConfig.

Bug: 76168832
Test: m blueprint_tools
Change-Id: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
Merged-In: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
(cherry picked from commit 674dc7f7f0)
2018-04-17 10:34:23 -07:00
Dan Willemsen 050ca73dbf Use Config/DeviceConfig functions to access ProductVariables
An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
Merged-In: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
(cherry picked from commit 3fb1faeeb9)
2018-04-17 10:34:23 -07:00
Dan Willemsen e9216117dd Add DistPath to reference the dist folder
Instead of open-coding the logic of whether there is one, or where to
find it.

Bug: 76168832
Test: diff out/soong/build.ninja without dist
Test: diff out/soong/build.ninja with dist specified
Change-Id: Ia3f1ef335e2d6e2175343338d04867d778a50300
Merged-In: Ia3f1ef335e2d6e2175343338d04867d778a50300
(cherry picked from commit bc0c509267)
2018-04-17 10:34:23 -07:00
Dan Willemsen bf4f0a0965 Switch PackageContext functions to take a ctx
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
Merged-In: I8cb524b09a84d0b8357d7c3501c71270af411e17
(cherry picked from commit 54daaf0371)
2018-04-16 19:27:14 -07:00
TreeHugger Robot 0f7e692fff Merge "Fix module rename inside namespace" into pi-dev 2018-04-17 01:07:32 +00:00
Colin Cross 4957e33b37 Merge "Fix module rename inside namespace" am: a42770b18a
am: 9684d4184d

Change-Id: I530604dfe74eadabdcae1e757f70814b1ea5329a
2018-04-16 16:22:30 -07:00
Colin Cross 2071266b28 Fix module rename inside namespace
Rename was expecting fully qualified names, but context.go always
passes it short names.

Bug: 77922456
Test: TestRename in namespace_test.go
Change-Id: I552ff39fd8ed6ba6da4262925060b45104840ff7
Merged-In: I552ff39fd8ed6ba6da4262925060b45104840ff7
(cherry picked from commit eafb10c23a)
2018-04-16 16:06:53 -07:00
Colin Cross eafb10c23a Fix module rename inside namespace
Rename was expecting fully qualified names, but context.go always
passes it short names.

Bug: 77922456
Test: TestRename in namespace_test.go
Change-Id: I552ff39fd8ed6ba6da4262925060b45104840ff7
2018-04-16 21:38:15 +00:00
Wale Ogunwale 7eb34fd4f0 Finalizing P SDK
am: 0148f91348

Change-Id: I136999e68af2352e36c00fd5e9f674f274f3a135
2018-04-13 14:07:17 -07:00
Chih-Hung Hsieh 505b2c69ac Add USE_CLANG_LLD and use_clang_lld. am: 02b4da53a7
am: 98fda157fb

Change-Id: I3fc25e6332ae02dc4736e1f77b6de52822968d80
2018-04-13 12:44:15 -07:00
Chih-Hung Hsieh 02b4da53a7 Add USE_CLANG_LLD and use_clang_lld.
* USE_CLANG_LLD is unedefined in current builds.
* When USE_CLANG_LLD is defined to 'true' or '1',
  use clang's lld instead of ld or ld.gold.
* When lld is enabled:
  * ld-only flags are not passed to 'lld'.
  * location_packer is disabled.
  * Use new lld's --pack-dyn-relocs=android.
* When lld does not work:
  * In Android.mk files use LOCAL_USE_CLANG_LLD := false.
  * In Android.bp files use use_clang_lld: false.
* Only arm, arm64, x86, and x86_64_devices have LLD flags;
  all other hosts and targets do not call lld yet.

Bug: 73768157
Test: make checkbuild and boot
Change-Id: I06b8a1e868a600997a7e70fe05c299d751d23d5f
2018-04-12 14:37:35 -07:00
Wale Ogunwale 0148f91348 Finalizing P SDK
Bug: 77588754
Test: builds
Change-Id: I07930ba9ca1f8b60a45109c4cc08ed2f17ea19fa
2018-04-12 06:43:59 -07:00
Colin Cross f5a4488d82 Merge "Consistently use Bool instead of proptools.Bool" am: b3f16dea37
am: e56f26526c

Change-Id: Idb3d752fa245e611454cbfe6dc2c3eae22d7b29c
2018-04-11 08:01:27 -07:00
Colin Cross ff3ae9da74 Consistently use Bool instead of proptools.Bool
Use Bool instead of proptools.Bool and String instead of proptools.String.

Test: m checkbuild
Change-Id: I32d84add9f27128c7a65413e9612fd920613584f
2018-04-10 22:50:34 -07:00
Dan Willemsen 32af22e2ef Add VendorConfig for board-level Soong plugin configuration am: 0fe7866897
am: 954230537d

Change-Id: I606059a27cdec3172ce38ffef2eaa5eca399f60d
2018-04-10 18:58:26 -07:00
Dan Willemsen 1fb615df28 Make Config.ProductVariables private am: 45133ac184
am: 1a837ac9fa

Change-Id: I73f7889bce4a6fe506d34623a68e337b5e290cb9
2018-04-10 18:58:20 -07:00
Dan Willemsen 0de9c08e03 Expose ProductVariables from TestConfig am: 674dc7f7f0
am: e4436b5ab2

Change-Id: Iafcdea1220e6bd7c4ced667e585e439792acf572
2018-04-10 18:58:15 -07:00
Dan Willemsen ce4f5b0ae7 Use Config/DeviceConfig functions to access ProductVariables am: 3fb1faeeb9
am: 906a608451

Change-Id: I67b75f04bd377fe2eb4865d9ad6397167c65bbef
2018-04-10 18:58:10 -07:00
Dan Willemsen 0fe7866897 Add VendorConfig for board-level Soong plugin configuration
This allows Soong (Go) plugins to get custom configurations set in the
current product's BoardConfig.mk.

I'll have some more comprehensive documentation later, but the general
concept is that you'd have one namespace per plugin, defined in the
BoardConfig.mk (though they would work in the product.mk files too):

  SOONG_CONFIG_NAMESPACES += myPlugin

Within that namespace you can set key-value pairs:

  SOONG_CONFIG_myPlugin := key1 key2 ...
  ...
  SOONG_CONFIG_myPlugin_key1 := value
  ...
  SOONG_CONFIG_myPlugin_key2 := true

Then in your plugin, you can ask for your namespace:

  vars := ctx.Config().VendorConfig("myPlugin")

And then use them:

  str := vars.String("key1")
  if vars.Bool("key2") { ... }
  if vars.IsSet("key3") { ... }

Warning: It's not a good idea to fail on missing inputs, since an
android tree may contain plugins from multiple owners, and we may
configure your modules (but not build/install them) even if they're not
meant for the currently configured product.

Bug: 76168832
Test: define some variables, use them
Test: m blueprint_tools
Change-Id: I4c38f5a4344022c6f332de279d9bbef24502e741
2018-04-11 01:45:37 +00:00
Dan Willemsen 45133ac184 Make Config.ProductVariables private
All access to these should be going through the methods on Config /
DeviceConfig.

Bug: 76168832
Test: m blueprint_tools
Change-Id: I47512dd58fb1a1a3f25838a9b1adaed2c41af8d3
2018-04-11 01:45:29 +00:00
Dan Willemsen 674dc7f7f0 Expose ProductVariables from TestConfig
In preparation for unexporting ProductVariables, explicitly return a
pointer to the structure from TestConfig / TestArchConfig.

Bug: 76168832
Test: m blueprint_tools
Change-Id: Iccfb4c912f8e0ee3f620cc1ee00f0cdc5cba7735
2018-04-11 01:45:22 +00:00
Dan Willemsen 3fb1faeeb9 Use Config/DeviceConfig functions to access ProductVariables
An upcoming change will stop exporting ProductVariables from Config, so
switch to using existing accessor functions, and add more when they're
missing.

Bug: 76168832
Test: out/soong/build.ninja is identical
Change-Id: Ie0135bdbd2df3258ef3ddb53e5f8fc00aa9b97f7
2018-04-11 01:45:14 +00:00
Steven Moreland ab4a214c76 Merge "Add vintf_fragments." am: 51ba4a7970
am: f974294c86

Change-Id: I0ed4fbbe7193687c9176a60bee639024b323612d
2018-04-05 16:24:34 -07:00
Steven Moreland 57a23d2f20 Add vintf_fragments.
Bug: 66917623
Test: fragments are loaded in the right place
Test: boot device which is depending on fragments
Test: androidmk file which uses LOCAL_VINTF_FRAGMENTS properly
    converted
Change-Id: I366b731cf8d5ecf51851866f441ff1c517da75cf
2018-04-05 20:33:01 +00:00
Jiyong Park ca700f704f Allow platform modules to link to vendor public libraries
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.

However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).

This change provides a way to make a vendor lib as public by defining a
module of type 'vendor_public_library' with a map file that enumerates
public symbols that are publicized:

cc_library {
   name: "libvendor",
   proprietary: true,
   ...
}

vendor_public_library {
   name: "libvendor",
   symbol_file: "libvendor.map.txt",
}

This defines a stub library module named libvendor.vendorpublic from the
map file. `shared_libs: ["libvendor"]` is redirected to the stub library
when it is from the outside of the vendor partition.

Bug: 74275385
Test: m -j
Test: cc_test.go passes
Merged-In: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
Change-Id: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
(cherry picked from commit 374510bcb6)
2018-03-30 12:59:06 +09:00
Jiyong Park 87da05effd Merge "Allow platform modules to link to vendor public libraries" am: 01b715e94e
am: 0ab76cd099

Change-Id: I661c4cf4f957888999b4278b2b9dbaa72fa476a0
2018-03-30 03:55:42 +00:00
Jiyong Park 374510bcb6 Allow platform modules to link to vendor public libraries
Normally, when building with VNDK, platform modules are not allowed to
link against vendor libraries, because the ABI of the vendor libraries
are not guaranteed to be stable and may differ across multiple vendor
images.

However, the vendor public libraries are the exceptions. Vendor public
libraries are vendor libraries that are exposed to 3rd party apps and
listed in /vendor/etc/public.libraries.txt. Since they are intended to
be exposed to public, their ABI stability is guaranteed (by definition,
though it is up to the vendor to actually guarantee it).

This change provides a way to make a vendor lib as public by defining a
module of type 'vendor_public_library' with a map file that enumerates
public symbols that are publicized:

cc_library {
   name: "libvendor",
   proprietary: true,
   ...
}

vendor_public_library {
   name: "libvendor",
   symbol_file: "libvendor.map.txt",
}

This defines a stub library module named libvendor.vendorpublic from the
map file. `shared_libs: ["libvendor"]` is redirected to the stub library
when it is from the outside of the vendor partition.

Bug: 74275385
Test: m -j
Test: cc_test.go passes
Change-Id: I5bed94d7c4282b777632ab2f0fb63c203ee313ba
2018-03-30 10:22:52 +09:00
Victor Khimenko b11219db87 Make arm_on_x86 symmetric
We only define arm_on_x86 in the x86 code, but sometimes arm code needs
to know that it's working in the emulated mode, too.

Test: CtsRsCppTestCases

Bug: b/75971275

Change-Id: I99564fbe9aeb284e2f11ffb593b18536a7755ea5
(cherry picked from commit 5eb8ec1e72)
2018-03-27 20:06:00 +02:00
Rajeev Kumar 6f80dfd857 Merge "Add product_variables.Use_lmkd_stats_log." into pi-dev
am: f65a99cee1

Change-Id: I235eb051a60b01039f4ee2b3dcb41802fa81b797
2018-03-26 23:33:53 +00:00
Rajeev Kumar 423e2db0f9 Add product_variables.Use_lmkd_stats_log.
Bug: 74443701
Test: Tested manually
Merged-In: I512d1a4b5e796b459a7ecdd3649ffd147bcf4cbf
Change-Id: I512d1a4b5e796b459a7ecdd3649ffd147bcf4cbf
(cherry picked from commit 1e6056a380)
2018-03-23 19:47:10 +00:00
Victor Khimenko 1913574ba6 Merge "Make arm_on_x86 symmetric" am: 9f66306050
am: 069a412cdc

Change-Id: Ie345c0303e5f7bb54c698e14ac4d9a793cbea9a8
2018-03-22 06:29:02 +00:00
Victor Khimenko 5eb8ec1e72 Make arm_on_x86 symmetric
We only define arm_on_x86 in the x86 code, but sometimes arm code needs
to know that it's working in the emulated mode, too.

Test: CtsRsCppTestCases

BUG=75971275

Change-Id: I99564fbe9aeb284e2f11ffb593b18536a7755ea5
2018-03-21 20:30:54 +01:00
Logan Chien 24e716e603 Allow VNDK extensions under vendor or device
This commit allows VNDK extensions (vndk.enabled:true and vendor:true)
to reside under vendor/* or device/*.  VNDK extensions will be installed
into /vendor/lib[64]/vndk[-sp].  It is reasonable for their source being
under vendor/* or device/*.

Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests

Merged-In: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
Change-Id: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
2018-03-16 17:45:42 +08:00
Logan Chien b1ed497ca8 Add unit tests for android/neverallow.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests

Merged-In: Ibde685d7213713be219681cb039ad58a43d9c377
Change-Id: Ibde685d7213713be219681cb039ad58a43d9c377
2018-03-16 17:45:42 +08:00
Logan Chien d44aa3b5c8 Extract failIfErrored() to android/testing.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests

Merged-In: I1c09412d5988dca2cc1c5f041893b313ab1c163a
Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
2018-03-16 17:45:42 +08:00
Logan Chien 3985402d74 RemoveFromList() should remove all matches
RemoveFromList() should remove all matches.  Before this commit,
RemoveFromList() only removes the first match.  This commit rewrites
RemoveFromList() so that it will remove all matches.  Besides, a unit
test is written.

Note: aosp/461936 wants to make sure libc.so precedes libdl.so in
DT_NEEDED entries.  However, if there are two "libdl" in shared_libs,
aosp/461936 won't achieve its goal because RemoveFromList() (prior to
this commit) only removes the first "libdl".

Bug: 62815515
Test: Build sailfish and check libstagefright.so

Merged-In: I9bec563cbf800bff4bd508fb21e28869a92cfe56
Change-Id: I9bec563cbf800bff4bd508fb21e28869a92cfe56
2018-03-16 17:45:34 +08:00
Logan Chien 3b33eaa1c9 Add unit tests for android/util.go
Bug: 62815515
Test: lunch aosp_sailfish-userdebug && make   # runs soong unit tests

Merged-In: I34f06abdc78bfb28af3b5250491bbcddb7595c9b
Change-Id: I34f06abdc78bfb28af3b5250491bbcddb7595c9b
2018-03-16 17:45:25 +08:00
Logan Chien 2ced34b14e Merge changes I406c5bef,Ibde685d7,I1c09412d am: 45d4f09f2f
am: 6eaae1a84a

Change-Id: I1cf47a14f8245d01a783d98cff0c2fec46e1193b
2018-03-16 02:19:45 +00:00
Logan Chien 45d4f09f2f Merge changes I406c5bef,Ibde685d7,I1c09412d
* changes:
  Allow VNDK extensions under vendor or device
  Add unit tests for android/neverallow.go
  Extract failIfErrored() to android/testing.go
2018-03-16 01:57:31 +00:00
Logan Chien af29bada75 Allow VNDK extensions under vendor or device
This commit allows VNDK extensions (vndk.enabled:true and vendor:true)
to reside under vendor/* or device/*.  VNDK extensions will be installed
into /vendor/lib[64]/vndk[-sp].  It is reasonable for their source being
under vendor/* or device/*.

Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
2018-03-15 11:02:38 +08:00
Logan Chien ee97c3ed75 Add unit tests for android/neverallow.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: Ibde685d7213713be219681cb039ad58a43d9c377
2018-03-15 11:02:38 +08:00
Logan Chien 4203971351 Extract failIfErrored() to android/testing.go
Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: I1c09412d5988dca2cc1c5f041893b313ab1c163a
2018-03-15 11:02:38 +08:00
Dan Willemsen 15b159179d Add DistPath to reference the dist folder am: bc0c509267
am: bb8f0eed0f

Change-Id: Ic15f59a508065bbc2ef139413cdc76f49886fd3a
2018-03-14 00:33:38 +00:00
Dan Willemsen 74edf2fdbe Switch PackageContext functions to take a ctx am: 54daaf0371
am: f34acc112e

Change-Id: I11d13250bbe1b40179b764799ca607b2bacc607b
2018-03-14 00:33:31 +00:00
Jayant Chowdhary 070f605485 Consider binder bitness while looking for abi references.
Binder bitness does not always correlate directly with primary arch, as
assumed earlier. For example: it is possible to have devices with
primary arch 'arm' and use 64 bit binder.

Bug: 74362434

Test: utils/create_reference_dumps.py;
      m -j vndk_package for aosp_arm64_ab, aosp_arm_ab invokes
      header-abi-diff on both arm and arm64 arches.

Test: mm -j64 in system/libhwbinder on troublesome internal target.

Merged-In: Iea0a24b57cdb3033e25b6fe126c5d5d717f45b4e
Change-Id: Iea0a24b57cdb3033e25b6fe126c5d5d717f45b4e
(cherry picked from commit 34ce67d454)
2018-03-12 16:56:03 -07:00
Dan Willemsen bc0c509267 Add DistPath to reference the dist folder
Instead of open-coding the logic of whether there is one, or where to
find it.

Test: diff out/soong/build.ninja without dist
Test: diff out/soong/build.ninja with dist specified
Change-Id: Ia3f1ef335e2d6e2175343338d04867d778a50300
2018-03-12 15:48:30 -07:00
Dan Willemsen 54daaf0371 Switch PackageContext functions to take a ctx
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
2018-03-12 15:48:26 -07:00
Dan Willemsen 04f97ce059 Remove obsolete Brillo variable am: a052599bb6
am: 567eda6a7d

Change-Id: I69edc621c71a4a5dc80595392b8914e1cca07e52
2018-03-12 22:04:12 +00:00
Dan Willemsen a052599bb6 Remove obsolete Brillo variable
Test: none
Change-Id: I6a5ce57b317f0cdae1abef15def01e6a31e18d3e
2018-03-10 15:29:03 -08:00
Nan Zhang d6cc6b789e Merge "Fetch generated srcs from java libs for droiddoc." am: 0b9be36339
am: cc2631e883

Change-Id: Ib53b56a5204d0f0a6d86f5b298456ca702c5d621
2018-03-10 00:38:17 +00:00
Nan Zhang b2b33de3c0 Fetch generated srcs from java libs for droiddoc.
api-stubs, system-api-stubs and etc need generated sources and srcjars from "framework",
so add a property that tell module to fetch srcs and srcjars from its
dependency libraries. The libraries in that property has to be in the
module's classpath.

Also add doc_defaults targets.

Bug: b/70351683
Test: m -j
Change-Id: I05831fbcad488037710950e4f05dc8fb2a12f403
2018-03-09 10:53:42 -08:00
Logan Chien cb3b31063a Merge changes I9bec563c,I34f06abd am: 5a8d428dc7
am: 870e5d96cd

Change-Id: Idb504b33df063322ff8dc162df40953d86f5c7fd
2018-03-09 08:42:41 +00:00
Logan Chien 5a8d428dc7 Merge changes I9bec563c,I34f06abd
* changes:
  RemoveFromList() should remove all matches
  Add unit tests for android/util.go
2018-03-09 08:23:08 +00:00
Logan Chien 7922ab8da6 RemoveFromList() should remove all matches
RemoveFromList() should remove all matches.  Before this commit,
RemoveFromList() only removes the first match.  This commit rewrites
RemoveFromList() so that it will remove all matches.  Besides, a unit
test is written.

Note: aosp/461936 wants to make sure libc.so precedes libdl.so in
DT_NEEDED entries.  However, if there are two "libdl" in shared_libs,
aosp/461936 won't achieve its goal because RemoveFromList() (prior to
this commit) only removes the first "libdl".

Bug: 62815515
Test: Build sailfish and check libstagefright.so
Change-Id: I9bec563cbf800bff4bd508fb21e28869a92cfe56
2018-03-09 13:41:56 +08:00
Jayant Chowdhary c94e7cd2c4 Merge "Consider binder bitness while looking for abi references." am: 7ebe5d10ad
am: 97c050375f

Change-Id: Ibf7135dbc857f16a4e97260fffd6fec14d7206d6
2018-03-09 03:40:00 +00:00
Logan Chien 5e877b1a86 Add unit tests for android/util.go
Bug: 62815515
Test: lunch aosp_sailfish-userdebug && make   # runs soong unit tests
Change-Id: I34f06abdc78bfb28af3b5250491bbcddb7595c9b
2018-03-09 10:44:14 +08:00
Jayant Chowdhary 34ce67d454 Consider binder bitness while looking for abi references.
Binder bitness does not always correlate directly with primary arch, as
assumed earlier. For example: it is possible to have devices with
primary arch 'arm' and use 64 bit binder.

Bug: 74362434

Test: utils/create_reference_dumps.py;
      m -j vndk_package for aosp_arm64_ab, aosp_arm_ab invokes
      header-abi-diff on both arm and arm64 arches.

Test: mm -j64 in system/libhwbinder on troublesome internal target.

Change-Id: Iea0a24b57cdb3033e25b6fe126c5d5d717f45b4e
2018-03-08 16:49:59 -08:00
Jayant Chowdhary aa05ae5521 For abi diffing, factor in arch variant and primary arch. am: ac066c6b90 am: 1bb2bac825
am: 4486c87ccb

Change-Id: I706b4d853a8220788e9acd39cb11f37be95e9754
2018-03-02 02:01:27 +00:00
Jayant Chowdhary ac066c6b90 For abi diffing, factor in arch variant and primary arch.
binder_size_t has a different size for builds with different primary
arches.

Also maintain seperate reference dumps for different arch variants,
since different cflags may be legally specified for them (similar to
what GSI does)

Test: create reference dump for libjpeg at
      prebuilts/abi-dumps/vndk/current/arm64/arm64_armv8-a/source-based/libjpeg.so.lsdump.gz
      mm -j64; header-abi-diff gets invoked.

Change-Id: I55eae4d4811c9754fe8dbd1009c7929fea119eeb
2018-03-01 17:19:25 -08:00
Dan Willemsen f66010de07 Turn GlobFiles into a Glob for files, use it am: 540a78c1ce am: f49ff89266
am: a7070c158c

Change-Id: I06f6cc4481f826de7f7923630c2de344c84603a6
2018-03-02 00:29:39 +00:00
Dan Willemsen 540a78c1ce Turn GlobFiles into a Glob for files, use it
GlobFiles had allowed results to be anywhere in the source tree,
restrict it to results within the current module directory.

Then use it for ExpandSources and other places where we only want files.
This fixes using '*' in cc_test's `data` property, which can only
support files.

The only thing this changes today is that java_resource_dirs and
java_resources no longer pass directories to soong_zip's -f argument.
core-libart previously added some icu directories, now it only passes
files.

Bug: 71906438
Test: only expected changes in out/soong/build.ninja
Test: add data: ["**/*"] to a cc_test, build successfully
Change-Id: Iff1bd8c005a48e431c740706d7e23f4f957d8b1d
2018-03-01 14:05:20 -08:00
Colin Cross 439b95a68b Report errors when opening config files am: 15cd21a492 am: aa14355b6a
am: 2077c15150

Change-Id: Ia4e8bda652317eed42a9e559f881eddf5a6ada12
2018-02-27 22:31:05 +00:00
Colin Cross 15cd21a492 Report errors when opening config files
The error handling when opening config files was ignoring all errors
except ENOEXIST.  Report other errors, instead of passing nil to
json.NewDecoder and getting:
config file: out/soong/soong.config did not parse correctly: invalid argument

Bug: 73951413
Test: touch out/soong/soong.config && chmod a-r out/soong/soong.config && m
Test: rm out/soong/soong.config && m
Change-Id: I4a609b7f060b760b76ee829b83c0eb405340f58f
2018-02-27 19:30:40 +00:00
Colin Cross 761955541f Merge changes I84868c92,If1690a70,Ia9aeb2ff am: d2092dbc0d am: 113265ec4c
am: a544914e5f

Change-Id: I5ffddc29b0006e763fef2cb2c4c315306a8a36d1
2018-02-24 01:08:43 +00:00
Colin Cross d2092dbc0d Merge changes I84868c92,If1690a70,Ia9aeb2ff
* changes:
  Use PathForSource instead of PathsForSource
  Move AllowMissingDependencies check from PathsForSource to PathForSource
  Pass nil instead of []string{} to ctx.Glob* functions
2018-02-24 00:39:56 +00:00
Dan Willemsen 6c3ba6c46c Merge "Add proto.canonical_path_from_root" am: 7c695eb797 am: c530837d4c
am: fb408c8e6d

Change-Id: I6bfe260cc2c8d67f73bdbb1eb70ee1df6bf33de4
2018-02-23 21:00:53 +00:00
Dan Willemsen 7c695eb797 Merge "Add proto.canonical_path_from_root" 2018-02-23 20:38:10 +00:00
Colin Cross 192e97a95c Move AllowMissingDependencies check from PathsForSource to PathForSource
This reapplies Id7925999a27ea75a05e9301bbf1eb9f9a6bc4652 with
additional fixes to not use PathForSource in PathForModuleSrc.

PathsForSource was handling the AllowMissingDependencies case, but
PathForSource was not.  Refactor PathForSource and
ExistentPathForSource, and add logic to PathForSource to fall back
to behavior similar to ExistentPathForSource when
AllowMissingDependencies is set.

PathForModuleSrc uses PathForSource, which causes too many
globs (>50k).  The AllowMissingDependencies check doesn't make
much sense for PathForModuleSrc, since we already know the
project containing the definition of the module exists, we can
expect its local source files to exist.  Use pathForSource and
do an manual existence check instead.

Test: paths_test.go
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: If1690a708393964d3030cb908beaf7b6897c0084
2018-02-23 11:31:45 -08:00
Colin Cross 461b445d62 Pass nil instead of []string{} to ctx.Glob* functions
[]string{} is unnecessary, just use nil.

Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: Ia9aeb2ffc483429787da0e473a7f1bc87eb4cad1
2018-02-23 11:31:45 -08:00
Colin Cross 0071b0d8bd Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource" am: c48c14369c am: 6fe8d17dd2
am: d543f37598

Change-Id: Id00030c0a6253237777b6ccf69bcb6ee63550668
2018-02-23 07:28:49 +00:00
Colin Cross c48c14369c Revert "Move AllowMissingDependencies check from PathsForSource to PathForSource"
This reverts commit 94a321045a.

Reason for revert: Broke builds with ALLOW_MISSING_DEPENDENCIES=true

Change-Id: I9604887f796a79809ef8d6c741597796219dcaf3
2018-02-23 07:09:15 +00:00
Colin Cross 10c7d51f6d Merge changes If1894fd9,Id7925999,I4fe11c3f,Iea2b0781,Id2c0a503 am: 1b5599e462 am: b3407069ee
am: 945aebf48e

Change-Id: Ie14264d306d957f92beca7070867d947773692b1
2018-02-23 02:44:01 +00:00
Dan Willemsen ab9f4268c0 Add proto.canonical_path_from_root
Historically, we've always passed '-I .' as the first argument to
protoc, essentially treating all proto file package names as their full
path in the android source tree. This would make sense in a monorepo
world, but it makes less sense when we're pulling in external projects
with established package names.

So keep the same default (for now), but allow individual builds to opt
into using local paths as the default names with
'canonical_path_from_root: false'. A cleanup effort and/or large scale
change in the future could change the default to false.

As part of this, run protoc once per input proto file, since the flags
may need to change per-file. We'll also need this in order to specify
--dependency_out in the future.

Bug: 70704330
Test: aosp/master build-aosp_arm.ninja is identical
Test: aosp/master soong/build.ninja has expected changes
Test: m
Test: Build protobuf test
Change-Id: I9d6de9fd630326bbcced1c62a4a7e9546429b0ce
2018-02-22 16:48:35 -08:00
Nan Zhang bfef411697 Droiddoc Support in Soong am: 581fd21e91 am: 2ea76706b3
am: a400bb400c

Change-Id: I5c317052e5b1cba68e04720db75cb07cdd7ca0f7
2018-02-22 23:25:14 +00:00
Colin Cross 94a321045a Move AllowMissingDependencies check from PathsForSource to PathForSource
PathsForSource was handling the AllowMissingDependencies case, but
PathForSource was not.  Refactor PathForSource and
ExistentPathForSource, and add logic to PathForSource to fall back
to behavior similar to ExistentPathForSource when
AllowMissingDependencies is set.

Test: paths_test.go
Change-Id: Id7925999a27ea75a05e9301bbf1eb9f9a6bc4652
2018-02-22 14:43:36 -08:00
Colin Cross 1ccfcc36bd Propagate errors out of validatePath
The next patch will need to more complicated custom error handling,
so make validatePath return an error and let the caller handle it.

Test: paths_test.go
Change-Id: I4fe11c3f319303d779596709f4819e828b5bdb9b
2018-02-22 14:43:36 -08:00
Colin Cross dc75ae70f3 Add t.Run and t.Helper to paths_test.go
Test: paths_test.go
Change-Id: Iea2b07815fe82a346c5384571ebc2b57538722cc
2018-02-22 14:43:36 -08:00
Colin Cross 32f3898f0b Remove unused intermediates parameter from ExistentPathForSource
Test: m checkbuild
Change-Id: Id2c0a5039c2ec3b3795385c135ffec022ccd691e
2018-02-22 14:43:36 -08:00
Nan Zhang 581fd21e91 Droiddoc Support in Soong
Support Droiddoc to Soong based on core/droiddoc.mk. The non-std doclet
based droiddoc compilation output is a "real" stubs.jar instead of a
directory of java files and a timestamp file.

The std doclet based javadoc compilation output is a "empty" stubs.jar
instead of a timestamp file.

The stubs.jar will be exported to
out/target/common/obj/JAVA_LIBRARIES/$(LOCAL_MODULE)_intermediates/classes.jar
and out/target/common/docs/$(LOCAL_MODULE)-stubs.jar

A $(LOCAL_MODULE).zip file will be generated also, and is exported to
out/target/common/docs/$(LOCAL_MODULE)-docs.zip if property: installable is not set
to false.

Bug: b/70351683
Test: unittest + convert libcore docs Android.mk to Soong manually.

Change-Id: I1cffddd138a5d9d445f86a3d4a3fd4de88a2bc0f
(cherry picked from commit 78188ec622cb1ee24171455867fc58ffab91562e)
2018-02-22 11:14:13 -08:00
Nan Zhang 73ca4ec589 Merge "Revert "Revert "Support filegroup in exclude_srcs""" am: f28e32a2a5 am: 3aa79ee5f5
am: 6df794ebb4

Change-Id: If6f3707008c217dec95f991f3c8fa3585ce42b0b
2018-02-19 18:35:36 +00:00
Nan Zhang 27e284d2b0 Revert "Revert "Support filegroup in exclude_srcs""
This reverts commit 606e9de344.

Reason for revert: <try to fix the broken build yesterday>

Change-Id: I2963b9af63c7c7398159e5e9a1e448266e1c81d5
Test: unittest
2018-02-15 14:38:40 -08:00
Pirama Arumuga Nainar beb1452783 Search for PGO profiles in PGO_ADDITIONAL_PROFILE_DIRS am: 49540800f0 am: 8f7ea0ebdd
am: 0ee536259f

Change-Id: I6b767ab0b947054ce3264ce0cf478c4d0403bb38
2018-02-13 21:15:24 +00:00
Pirama Arumuga Nainar 49540800f0 Search for PGO profiles in PGO_ADDITIONAL_PROFILE_DIRS
This variable can be set in BoardConfig.mk to specify a list of
additional paths that contain PGO profiles.  These directories are
searched after the predefined paths in soong/cc/pgo.go while finding
PGO profiles.

Test: Set this variable in a BoardConfig and verify that such profiles
are found and that these paths are searched after the predefined paths
in soong/cc/pgo.go.

Change-Id: I0bb9523de614d0f23aba8d51c887d8fc8f41c993
2018-02-13 09:41:13 -08:00
Tobias Thierer 6466ada7b9 Merge "Revert "Support filegroup in exclude_srcs"" am: f5801db4cc am: 62c06ce8ed
am: 019405de4a

Change-Id: Icb19a5b8d36d3333aadefc0d6ca471add9d08d3e
2018-02-09 10:20:18 +00:00
Tobias Thierer 606e9de344 Revert "Support filegroup in exclude_srcs"
This reverts commit f36a3d9b6d.

Reason for revert: Broke several builds. I'm acting build cop, reverting.

Bug: 70351683

Change-Id: I775ada4e9cb6473519d51420b41b818af163da44
2018-02-09 09:46:11 +00:00
Nan Zhang 7e78927715 Merge "Support filegroup in exclude_srcs" am: a9e0fabae1 am: 4357144070
am: 53509e591b

Change-Id: I625381c713986c42a5857b2252ecbbbf0e04749f
2018-02-09 07:06:48 +00:00
Nan Zhang f36a3d9b6d Support filegroup in exclude_srcs
Test: add unit-test, m -j32
Bug: b/70351683
Change-Id: Iff83c56d45dd668d9df6131c7df2e23e5c73a21b
2018-02-07 10:18:41 -08:00
Colin Cross 64ab8062ec Merge "Support filegroups for version_script and related properties" am: ca59511e21 am: 4009b12ead
am: bfbda64f6a

Change-Id: Iace6d60c3d05af33825a5066caacf169bf7b541c
2018-02-07 02:27:08 +00:00
Colin Cross 2383f3b693 Support filegroups for version_script and related properties
Bug: 71715793
Test: m checkbuild
Change-Id: Ibf78a5ec88e743f29504c91057d2cfced667c8b4
2018-02-06 14:42:06 -08:00
Dan Willemsen 8d7322a396 Merge "Move namespace mutator earlier to support defaults" am: 750024367e am: 4a93b0ea47
am: 73b2c92b82

Change-Id: I1910c4cff1d30d31c17a7c030dc55b58820580b7
2018-01-30 00:41:35 +00:00
Dan Willemsen 6e72ef7225 Move namespace mutator earlier to support defaults
The prebuilts and defaults mutators start adding some dependencies, so
for them to be able to reference imported modules, we need to
run the namespace mutator earlier.

Test: m nothing
Test: Try to use a global defaults module from a namespace
Change-Id: I6e853d20e32251d0fd33c8b2dcc26c0695b808fd
2018-01-26 20:21:18 -08:00
Jaekyun Seok e3e265939f Use product instead of oem for Product specific module am: 5cfbfbb67a am: 2b6236308b
am: be16d5e84f

Change-Id: I6ee908710e7d7b7fe9d3ce7e6c43287e3e8c0835
2018-01-25 04:17:04 +00:00
Jaekyun Seok 5cfbfbb67a Use product instead of oem for Product specific module
Bug: 64195575
Test: succeeded building product.img with BOARD_PRODUCTIMAGE_PARTITION_SIZE,
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE and PRODUCT_PRODUCT_VERITY_PARTITION.
Change-Id: Icc4f8c16bc389fe20db680849f311d02df1299c3
2018-01-25 07:50:35 +09:00
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