Commit Graph

6203 Commits

Author SHA1 Message Date
Jiyong Park
b5a2a3f5b5 Merge "Property api_srcs added for api-only source files"
am: d126f7b52f

Change-Id: Ibc94346520cace35d25ff5c73a95f8cb91ffaf88
2018-05-01 20:09:14 -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)
031973687f Merge "CompilerDeviceProperties are added to the sdk impl library"
am: b1a96e5ebf

Change-Id: I500e28714da0c5cde9c1fa3c35c03834dd1fad93
2018-05-01 19:31:04 -07:00
android-build-prod (mdb)
b1a96e5ebf Merge "CompilerDeviceProperties are added to the sdk impl library" 2018-05-02 02:22:11 +00:00
Dan Willemsen
b81dc09c7c Remove more problematic env vars
am: ebfe33ad80

Change-Id: I3cf98a08733c3c902049cac8b48dccc1564fb812
2018-05-01 11:58:26 -07: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
95432df502 Add hidden_api_packages to java_sdk_library
am: 5a2c9d7a46

Change-Id: I2d59f1498eb7c8d04cb2de88bfc2708be1f7ffe8
2018-05-01 09:10:38 -07: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
fc3f21e609 Add some friendly error messages for java_sdk_library.
am: 8959e149b7

Change-Id: Ic149e3ba2f6ef398de9b3adf40d85f88f4f260a7
2018-04-30 23:59:55 -07: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)
07b758e2cf Merge changes I9f68c887,Ic18f2dc5
am: b6ffb625eb

Change-Id: I1a325caecf48547b15ad754b5d90e0ca2c1775bb
2018-04-30 19:04:24 -07: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)
0591553c02 Merge "Use and export proguard flags from static dependencies"
am: 1873f39223

Change-Id: I7a6666fab1224658986e6282f93757f3f9b1dc5b
2018-04-30 18:19:05 -07:00
Jiyong Park
d5ed585832 java_sdk_library supports test as another API scope
am: df13054c2a

Change-Id: I95cff0b8c54db5eba1bf12674e8b4bdf0e685774
2018-04-30 18:17:33 -07: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
Jiyong Park
6455f181e9 Add prebuilt_etc_xml
am: 5a8d1bee89

Change-Id: I8b54e220fc8c926ff809fae180249dbffd8969b5
2018-04-27 10:25:18 -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
8aac41602f Merge "Add new Doclava flag support to soong"
am: aac4b84ce5

Change-Id: I574b146231c443bd74f5ca8b745da6f331aecb78
2018-04-26 06:37:49 -07:00
David Brazdil
aac4b84ce5 Merge "Add new Doclava flag support to soong" 2018-04-26 12:39:41 +00:00
android-build-prod (mdb)
990e3f3caf Merge "Fix incomplete LTO bug workaround."
am: 6bcee9abff

Change-Id: Ia059d3c4a69a720ee069d98ec1676c3cb07c882f
2018-04-25 18:01:33 -07:00
android-build-prod (mdb)
6bcee9abff Merge "Fix incomplete LTO bug workaround." 2018-04-26 00:51:07 +00:00
android-build-prod (mdb)
4fe12e40c3 Merge "Don't use AppsDefaultVersionName for framework-res.apk"
am: eedc9484ab

Change-Id: I27fa175b4e1f447d01c05ab1262193dbc0952deb
2018-04-25 16:58:36 -07:00
Logan Chien
2a2833185a Introduce runtime_libs to cc_binary and cc_library
am: 43d34c38d8

Change-Id: I131e6de0aa5a91914413fec88f9a038da9311f4a
2018-04-25 16:56:58 -07: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
74db54674a Merge "Disable LLD for Darwin host executables."
am: 95ba30aa56

Change-Id: I1082ff2ef6e7db2a1292c55d8bdbea0fc651430f
2018-04-24 23:38:21 -07: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
c3057b9828 Merge "Fix the undefined CommandDeps for standard Javadoc"
am: f9a34b667f

Change-Id: I2ea1f758ccec5e98510decdb97bb08b0f072139f
2018-04-24 16:12:33 -07:00
Nan Zhang
f9a34b667f Merge "Fix the undefined CommandDeps for standard Javadoc" 2018-04-24 23:00:37 +00:00
Colin Cross
293f4f2a2c Merge "Add pom2bp"
am: 9850f48dda

Change-Id: I7ab11ffb18ba748155484ab9d9c8ca806df5e017
2018-04-24 15:35:50 -07:00
Colin Cross
9850f48dda Merge "Add pom2bp" 2018-04-24 22:28:28 +00:00
Colin Cross
e45e50f27f Merge changes I083907ef,Ie8e0f97a
am: c52e90eda3

Change-Id: I43392da235868b73d8a0826c8708cfd325d0b540
2018-04-24 14:50:08 -07: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
Alex Light
46a9de3860 Merge "Add support for generating Compdb file"
am: 2782ca4102

Change-Id: Ie66850774ddc351aab5faad58924be0cbf94ab62
2018-04-24 10:14:15 -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
a736bd6d42 Additional fixes for java_sdk_library
am: 82484c0771

Change-Id: Ic327990f5955b8efaa2236931ecf1cc2a945b026
2018-04-23 19:38:36 -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