Commit graph

5968 commits

Author SHA1 Message Date
Jiyong Park
9007838c93 Stubs libs are dist artifacts
stubs libs from a java_sdk_library are automatically registered as dist
artifacts for sdk and win_sdk targets.

They are installed under $(DIST_DIR)/apistubs/<apiscope>/<name>.jar
where <apiscope> can be public, system and test.

Bug: 605033
Test: m -j
Test: choosecombo 1 sdk_phone_armv7 userdebug; m -j sdk dist
the stubs libs are found under out/dist/apistubs

Change-Id: I3487634f1ec5bb3b5b60d636b64461d391add35a
2018-05-02 19:33:45 +09:00
android-build-prod (mdb)
96bbc2ff22 Merge "Save list of AndroidProducts.mk files" 2018-05-02 08:27:24 +00:00
Dan Willemsen
6ab79db2e6 Pass TARGET_DEVICE_DIR from dumpvars to later kati runs
The find commands used to locate the BoardConfig.mk can't be optimized
by Kati, so we're currently spending ~125ms three times during every
build (dumpvars, cleanspec, and the main kati run). Preserve the value
of TARGET_DEVICE_DIR from the dumpvars run so that we only need to run
the find commands once.

Bug: 78020936
Test: out/build-taimen.ninja is identical
Test: out/soong.log shows that we're not running these finds again
Change-Id: Iee56b454c3661de2b58c161169218ecaf2135398
2018-05-02 00:06:28 -07:00
Dan Willemsen
567851c9cc Save list of AndroidProducts.mk files
Bug: 78020936
Test: diff out/.module_paths/AndroidProducts.mk.list with existing find
      results
Change-Id: Ie09cc18b926b21d6d24a4cfc570686aed2893e00
2018-05-01 22:57:53 -07:00
Jiyong Park
d126f7b52f Merge "Property api_srcs added for api-only source files" 2018-05-02 03:04:40 +00:00
android-build-prod (mdb)
b1a96e5ebf Merge "CompilerDeviceProperties are added to the sdk impl library" 2018-05-02 02:22:11 +00:00
Jiyong Park
baaf9dd5ab Property api_srcs added for api-only source files
New property api_srcs is added to java_sdk_library. The property is used
to specify set of source files that will be part of the API but not part
of the runtime library. Currently, this is only for the legacy http
library (org.apache.http.legacy) where some framework classes (such as
android.net.SslError which are compiled into framework.jar) are
registered as its API for historical reason.

Bug: 77575606
Test: m -j
Change-Id: I36d153f4815f8e4c939d5eeec632a38e7943b4b0
2018-05-02 02:13:44 +09:00
Dan Willemsen
ebfe33ad80 Remove more problematic env vars
I got a report of a user exporting CDPATH in their shell and causing
strange issues in the build. We should never need this value (and it
probably shouldn't be exported from the shell either -- that was their
workaround).

NDK_ROOT causes issues with Android.mk files thinking that they're
building with the ndk (like external/googletest/googletest/Android.mk).

Bug: 78933670
Test: CDPATH=. NDK_ROOT=test m; check out/soong.log
Change-Id: Icce43d7e31ed5e5e1fb7a4e37fd4dfbf421af4b1
2018-05-01 10:07:50 -07:00
Jiyong Park
441a47d1c9 CompilerDeviceProperties are added to the sdk impl library
java_sdk_library now accepts properties in CompilerDeviceProperties,
such as dex_preopt.profile. The properties are passed to the impl
library which is the device-specific sub-component of a
java_sdk_library.

Bug: 77575606
Test: m -j
Change-Id: I7303068bb62ca860352db306a5462fa4453ee80f
2018-05-02 01:25:10 +09:00
Jiyong Park
5a2c9d7a46 Add hidden_api_packages to java_sdk_library
hidden_api_packages is used to set packages that must be hidden from the
API. org.apache.http.legacy will be using this to exclude
references to com.android.okhttp from its API signatures.

Bug: 77575606
Test: m -j
Change-Id: Ic93c67cab96585638921dc922f175e545a68ead2
2018-05-01 22:25:41 +09:00
Anton Hansson
8959e149b7 Add some friendly error messages for java_sdk_library.
The stubs will always fail to build without at least these
three arguments. Give a clear error message when this happens
instead of failing further into the build.

Bug: 77575606
Test: make <x>.stubs for sdk_library "x" without these args
Change-Id: If3142ecc73d6428f7e3120788f8de64d56a777ad
2018-05-01 07:49:03 +01:00
android-build-prod (mdb)
b6ffb625eb Merge changes I9f68c887,Ic18f2dc5
* changes:
  Fix data race when ALLOW_MISSING_DEPENDENCIES=true
  Document glob patterns
2018-05-01 01:56:06 +00:00
android-build-prod (mdb)
1873f39223 Merge "Use and export proguard flags from static dependencies" 2018-05-01 01:07:24 +00:00
Colin Cross
d2343a331e Fix data race when ALLOW_MISSING_DEPENDENCIES=true
Missing dependencies were modifying a slice owned by a dependency,
which could cause a data race.  Return a copy instead.

Test: build with race detector enabled
Bug: 70706626
Change-Id: I9f68c887bee94348f3e11284c0833d2e04d62599
2018-04-30 16:19:31 -07:00
Colin Cross
645332d501 Document glob patterns
Bug: 71906438
Test: none
Change-Id: Ic18f2dc5d91b30ff2b5beb8047d98591ba70ee00
2018-04-30 16:19:31 -07:00
Colin Cross
89c31581a5 Use and export proguard flags from static dependencies
Export proguard flags from Android library modules, and use them
from static dependencies in Android apps when running proguard.
Also export them to Make.

Unlike Make, which concatentates all the exported flags from
dependencies, Soong dedups exported flags files.

Bug: 73724997
Test: m checkbuild
Change-Id: I8f86fecb09cbc591832ce67e8ecef551a6600349
2018-04-30 16:03:43 -07:00
Pirama Arumuga Nainar
d7feb380c1 Update clang to r328903
Bug: http://b/77532044

* b/77967848 - Disable -Wc++98-compat-extra-semi

Test: Test various targets in AOSP and internal branches.  For Googlers,
go/clang-r328903-testing

Change-Id: If08dafb9ad993fb686dfd6eeb5e2d61a9c99bd0b
2018-04-30 15:18: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
df13054c2a java_sdk_library supports test as another API scope
For each java_sdk_library module, three (possibly different) stubs libs
are created.

*.stubs: public APIs only
*.system.stubs: public APIs + @SystemApi
*.test.stubs: public APIs + @TestApi

Depending on the sdk_version (or LOCAL_SDK_VERSION) of the calling
module, stubs lib of the corresponding api scope is linked.

Bug: 77575606
Test: m -j
Change-Id: I1437c64460914dbfc349dbc31d6f3ef090f541e3
2018-04-28 02:16:54 +09: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
David Brazdil
aac4b84ce5 Merge "Add new Doclava flag support to soong" 2018-04-26 12:39:41 +00:00
android-build-prod (mdb)
6bcee9abff Merge "Fix incomplete LTO bug workaround." 2018-04-26 00:51:07 +00:00
android-build-prod (mdb)
eedc9484ab Merge "Don't use AppsDefaultVersionName for framework-res.apk" 2018-04-25 23:51:49 +00:00
Dan Albert
ea4b7b9ced Fix incomplete LTO bug workaround.
https://android-review.googlesource.com/c/platform/build/soong/+/641827
forgot this use of ClangTriple(), so static libraries aren't being
installed to the correct place.

Test: OUT_DIR=ndk-out DIST_DIR=ndk-dist \
    build/soong/scripts/build-ndk-prebuilts.sh && \
    ls ndk-out/soong/ndk/sysroot/usr/lib
Bug: None

Change-Id: I750ab198deff92aac06935d38d529b53030f9636
2018-04-25 16:05:30 -07:00
Colin Cross
402d5e0919 Don't use AppsDefaultVersionName for framework-res.apk
Some builds set AppsDefaultVersionName() to include the build
number ("P-123456").  aapt2 copies the version name of
framework-res into app manifests as compileSdkVersionCodename,
which confuses things if it contains the build number.  Use the
DefaultAppTargetSdk ("P") instead.

Bug: 78324052
Test: m TARGET_BUILD_WITH_APPS_VERSION_NAME=true Dialer
      aapt dump badging $OUT/system/priv-app/Dialer/Dialer.apk | grep compile
      shows compileSdkVersionCodename=P
Change-Id: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
2018-04-25 15:09:20 -07:00
David Brazdil
aac0c3ca2e Add new Doclava flag support to soong
CL I8fe27e8c03334f9c90204db1e69447de65a06a38 adds new "-removedDexApi"
flag to Doclava. This patch adds support for that flag into Soong.
"droiddoc" targets can generate the new API file with property
"removed_dex_api_filename".

Bug: 78182899
Test: make
Change-Id: I04b8f615aa4655167b824d40c3fafa2648beec01
2018-04-25 10:12:40 +00: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
Chih-hung Hsieh
95ba30aa56 Merge "Disable LLD for Darwin host executables." 2018-04-25 06:30:54 +00:00
Chih-Hung Hsieh
e5ac609355 Disable LLD for Darwin host executables.
* See upstream status of lld for Mach-O at https://lld.llvm.org/AtomLLD.html

Bug: 73768157
Test: make checkbuild
Change-Id: I2e892193b6d75afd4358df8b2f674aa94888fb32
2018-04-24 18:07:16 -07:00
Nan Zhang
f9a34b667f Merge "Fix the undefined CommandDeps for standard Javadoc" 2018-04-24 23:00:37 +00:00
Colin Cross
9850f48dda Merge "Add pom2bp" 2018-04-24 22:28:28 +00:00
Treehugger Robot
c52e90eda3 Merge changes I083907ef,Ie8e0f97a
* changes:
  Add pom2mk -exclude
  Add pom2mk -regen
2018-04-24 21:44:13 +00:00
Colin Cross
70dd38f09e Add pom2bp
Convert pom2mk to pom2bp that writes out Android.bp files instead
of Android.mk files.  pom2mk stays for now until the last users
of it are cleaned up.

Bug: 78300023
Test: cd prebuilts/sdk/current/support && pom2bp -regen Android.mk
Change-Id: I584d63c4228bad32f9e1914b06bde807078d6a55
2018-04-24 13:37:38 -07:00
Nan Zhang
30963749fd Fix the undefined CommandDeps for standard Javadoc
When compiling against without customized doclet, Javadoc doesn't need
to depend on Doclava and Jsilver jars. Originally, we leave these two
jars empty in Args so that CommandDeps won't have these two
dependencies. But Ninja doesn't like that with errors:

ninja: error: build.ninja: empty path
because $Jsilver and $Doclava is undefined when compiling Javadoc.

Test: m -j platform_library-docs
Bug: b/70351683
Change-Id: I02fee181490f91e87a1feac74f3a69b5b4acb528
2018-04-24 13:23:04 -07:00
Treehugger Robot
2782ca4102 Merge "Add support for generating Compdb file" 2018-04-24 17:07:42 +00:00
Alex Light
ec868fc42a Add support for generating Compdb file
Some tools (i.e. you-complete-me) make use of a 'compdb' file
(compile_commands.json) that records (among other things) the
arguments needed to compile a file. These tools can use this with
libclang to provide semantic completions and perform other IDE
actions. This CL adds support for soong to generate a (simple)
compile_commands.json file.

Test: make SOONG_GEN_COMPDB=1 SOONG_LINK_COMPDB_TO=$ANDROID_BUILD_TOP nothing
      examine $ANDROID_BUILD_TOP/compile_commands.json

Change-Id: I751bb344b90dfcdad1dfd71c2a85bacd345f0464
2018-04-24 08:15:02 -07:00
Jiyong Park
82484c0771 Additional fixes for java_sdk_library
This change fixes several problems found while re-defining some libs
using java_sdk_library module type.

1) A phony module whose name is the same as the java_sdk_library name is
defined. It is used to support installing the runtime library via
PRODUCT_PACKAGES (even when there is no dependency from other modules).

2) A bug that package names whose depth is >= 2 is ignored in
droiddoc.srcs_lib_whitelist_pkgs is fixed. A package name foo.bar.baz is
now converted to a path foo/bar/baz following the Java convention.

3) A make variable JAVA_SDK_LIBRARIES that is the list of java_sdk_library
module names is exported to make. This can be used to distinguish SDK
libraries from ordinary libs.

4) When running doclava, some framework sources in the 'android' package
and the same packages as the SDK library are automatically added to the
sources list. This is required for the case when API class is extending
from the framework class. In that case, doclava needs to know whether
the base class is hidde nor not. Since that visibility info is encoded
as @hide string in the comment, we need source files for the classes,
not the compiled ones. Also there are rare cases where part of SDK
library is implemented in the framework (e.g. org.apache.http.legacy).
In that case, we need framework source to make API stubs, though the
sources are not required to build the runtime library.

5) The stubs libs are disabled for PDK builds as well.

Bug: 77575606
Test: m -j

Change-Id: I360cf15fe5339e46644fb16d0dabe2548aa315f9
2018-04-24 09:47:50 +09:00
Treehugger Robot
0d12ebce88 Merge "Revert "Support coverage instrumentation for Linux host"" 2018-04-24 00:12:05 +00:00
Colin Cross
6b382bcd04 Add pom2mk -exclude
Add an option to pom2mk to exclude modules by name.

Bug: 78300023
Test: cd prebuilts/sdk/current/support && pom2mk -regen Android.mk -exclude androidx.car_car
Change-Id: I083907ef364384aace524ced81820567f5075d76
2018-04-23 16:16:52 -07:00
Colin Cross
9f5633d60c Add pom2mk -regen
pom2mk -regen Android.mk will read the previous arguments out of
Android.mk, rerun pom2mk with those arguments, and write the result
to Android.mk.

Bug: 78300023
Test: cd prebuilts/sdk/current/support && pom2mk -regen Android.mk
Change-Id: Ie8e0f97ae5b87c8078cf8e753489326d80da1896
2018-04-23 16:16:41 -07:00
Pirama Arumuga Nainar
0b882f0394 Revert "Support coverage instrumentation for Linux host"
This reverts commit 358056c058.

Reason for revert: Breaks build_test target in some branches.

Change-Id: I604561033038d4ff15b74caf7b81ff5c8dd9632f
2018-04-23 22:44:39 +00:00
Treehugger Robot
346d43b62e Merge "pom2mk to include extra-deps as top-level deps too" 2018-04-23 22:06:52 +00:00
Jeff Gaston
358f25e97d pom2mk to include extra-deps as top-level deps too
Specifically, the use case is android-support-car requires some stubs that don't have a Maven pom.
So those stubs can't easily be listed as a dependency in the pom.
However, we do want the dependency to exist when importing to Make and detected by extract_deps.py

Bug: 76692459
Test: m -j blueprint_tools \
      && update_prebuilts.py -s <build_id> \
      && git diff HEAD^ -- fix_dependencies.mk \
      && m -j checkbuild

Change-Id: If546ecf7416580a01bde7b906976ada4b1145253
2018-04-23 15:59:05 -04:00
Pirama Arumuga Nainar
358056c058 Support coverage instrumentation for Linux host
Bug: http://b/77792074

- Add the libclang_rt.profile runtime libraries directly to the compile
command (for both host and target) instead of relying on the Clang
driver.
- Move the coverage mutator to PreDepsMutators so the mutation has
already happened when runtime libraries are added during dependence
computation.
- Factor out cc/config/toolchain to identify libclang_rt.profile modules
for the x86 and x86_64 host.

Test: make NATIVE_COVERAGE=true produces coverage-enabled host binaries.
Change-Id: I1ebc8cffdf11622bfc18199a57674672888b3a5f
2018-04-23 10:34:37 -07:00
Treehugger Robot
4884a172de Merge "Add double_loadable property and checks for it" 2018-04-21 02:14:51 +00:00
Treehugger Robot
7e1130cded Merge "build/make: set LOCAL_NATIVE_BENCHMARK for Google Benchmark Test" 2018-04-20 23:08:36 +00:00
Pirama Arumuga Nainar
2b8959ad5a Make 'use_clang_lld' property specifiable per architecture
Bug: http://b/73768157

Test: Mark 'use_clang_lld: true' for one arch of a module and verify by
inspection that only that arch variant uses lld.

Change-Id: I4b0d7a2bc43ee0b8462ab09a5f5c50807129a7fb
2018-04-20 19:11:50 +00:00
Colin Cross
5fd7dfd124 Merge "Remove product-specific flags from android_library modules" 2018-04-20 01:22:05 +00:00
Colin Cross
e78dcd313c Remove product-specific flags from android_library modules
Static android libraries should not get the product-specific
flags.

Bug: 73724997
Test: m checkbuild
Change-Id: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
2018-04-19 15:28:21 -07:00
Treehugger Robot
dcbc89a3ab Merge "Adding java_sdk_library" 2018-04-19 18:33:31 +00:00