Commit graph

718 commits

Author SHA1 Message Date
Colin Cross
29788aad61 Fix .kotlin_builtins glob
The files in kotlin jars seem to be called .kotlin_builtins, not
.kotlin_builtin.

Test: m checkbuild
Change-Id: I541aea758bbef6bb23632836cceb8339b82ffdff
2018-07-16 15:24:43 -07:00
Nan Zhang
9b54e8be60 Merge "Add more options in droiddoc.go"
am: dd41d7d631

Change-Id: Ie14cfee1b62743eec9356937208da2ec6801b191
2018-07-13 17:06:04 -07:00
Treehugger Robot
dd41d7d631 Merge "Add more options in droiddoc.go" 2018-07-13 22:41:43 +00:00
Colin Cross
b2efa2f6a7 Merge "Add exclude_files and exclude_dirs properties to java_import"
am: d71f86a79c

Change-Id: If2c5d32f747ab3319bd50c3301e12a26858aeaba
2018-07-12 22:53:43 -07:00
Treehugger Robot
d71f86a79c Merge "Add exclude_files and exclude_dirs properties to java_import" 2018-07-13 05:40:07 +00:00
Colin Cross
37f6d79c7e Add exclude_files and exclude_dirs properties to java_import
Prebuilt jars sometime contain files that we don't want.  In Make
we would delete everything in META-INF when importing jars, but
that caused problems when there were necessary files in there,
so we added LOCAL_DONT_DELETE_JAR_META_INF.

Soong does the opposite, keeping everything by default.  Add
properties to allow explicitly stripping unwanted files instead.

Bug: 111389216
Test: m checkbuild
Change-Id: I6d07f519ebc7d0e1bf0af93416bb569e3c2b1500
2018-07-12 16:59:59 -07:00
Sundong Ahn
e609876f41 Merge "Change link type rule"
am: 9fab1220b9

Change-Id: If81c3ae25bb75d4ad7954daf0cf54ce398d1cf2f
2018-07-11 18:14:08 -07:00
Sundong Ahn
57368eb515 Change link type rule
If linkType of a module is javaPlatform, the module will link to
<lib>.impl instead of <lib>.stubs.system.

Bug: 77577799
Test: make -j
Change-Id: I2a9a0ec7c76c0fc304935f16c4c371aea39bffd6
2018-07-11 23:56:17 +00:00
Nan Zhang
e2ba5d4c51 Add more options in droiddoc.go
These new options are required for online/offline-docs. These options
are only for Doclava, not Metalava.

Bug: b/70351683
Test: m -j offline-sdk-docs
Change-Id: Ie229821409d5640adfa6d7d05450e5f4c215b9b4
2018-07-11 15:35:24 -07:00
Colin Cross
31656958d6 Use manifest merger in Soong
Move the manifest merger config to Soong, and use it to merge
manifests of static dependencies of android_library and android_app
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
Merged-In: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
Merged-In: I5d055ce63b8371db500f8868fb73ab3604b8c24a
2018-07-11 19:46:38 +00:00
Colin Cross
a90861ae3f Merge "Don't install java libraries by default"
am: d6a8e0fe00

Change-Id: If194f5a3986a6787e6a37f1fae0653155915f99b
2018-07-11 11:41:47 -07:00
Colin Cross
cfae5a6e2c Use manifest merger in Soong
Move the manifest merger config to Soong, and use it to merge
manifests of static dependencies of android_library and android_app
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
2018-07-11 05:52:26 +00:00
Colin Cross
9ae1b927d4 Don't install java libraries by default
Very few java libraries need to be installed, most are statically
included in other modules.  Device modules that are not installed
also don't need to be dexed, saving checkbuild time.  Change the
default for java_library to not be installed, and allow libraries
that should be installed to specify installed: true.  This makes
java_libary and java_library_static identical.  It also simplifies
some corner cases when converting from Make to Soong if a module
is built for the host (which doesn't differentiate between static
and non-static/installable) and statically for the device, which
couldn't be represented in a single java_library in soong.

Bug: 110885583
Test: m checkbuild, compare presubmit target files
Change-Id: Idc0841c39a17cebd7bac3559c9408596d167a393
2018-07-11 05:35:59 +00:00
Colin Cross
9405da836c Add min_sdk_version to android_library_import modules
am: 479884c93d

Change-Id: Ie0406567bbf45fd42932c1bc57feffa1f103a400
2018-07-10 16:01:24 -07:00
Colin Cross
479884c93d Add min_sdk_version to android_library_import modules
pom2bp now inserts a min_sdk_version into android_library_import
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: I1396eabd8bfa02755c829ddac03022ffb7a5673e
2018-07-10 13:46:58 -07:00
Colin Cross
7c0f8e6ec7 Don't install android_library modules
am: 73ea6a3cf1

Change-Id: I23da7d99a5811345819f4dfc03e851487013a251
2018-07-10 08:20:02 -07:00
Colin Cross
73ea6a3cf1 Don't install android_library modules
Skip dexing and installing android_library modules, the platform
can't load them directly anyways.

Test: m checkbuild
Change-Id: I4940569f0deb0eefbe52ac1bee6a32a8b2a2c5be
2018-07-10 14:54:24 +00:00
Tobias Thierer
7215e2c1cd Merge "Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9."
am: 4599ec5b0b

Change-Id: I89c1f9fc33eddd8f41896b19cfef3bc646d8b60b
2018-07-10 04:09:55 -07:00
Tobias Thierer
4599ec5b0b Merge "Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9." 2018-07-10 11:02:59 +00:00
Mathew Inwood
06a96bbc9d Add support for -apiMapping parameter in DocLava.
am: 76c3de1cea

Change-Id: I4050d5a0ae39e8206e81238d20d04e871ca69885
2018-07-10 00:43:20 -07:00
Mathew Inwood
76c3de1cea Add support for -apiMapping parameter in DocLava.
This is used to output a mapping of class member signature to source
position, which in turn is used for automated addition of annotations in
frameworks code.

Metalava support does not exist (yet), and may not be needed, since the
addition of these annotations in a one-time thing. This change can be
reverted once this is complete.

See go/hidden-api-annotations for more context.

Test: m
Bug: 110868826
Change-Id: I90e409f6ea02b16eb9e03d92382f9bb46a8fdab5
2018-07-10 05:48:49 +00:00
Colin Cross
b6d2b5d931 Merge changes Ieaf37ba6,Ic69f1f93
am: ad234e4894

Change-Id: I53ede4011f281b0ab84f7e9a1fd36ee1f1a6a488
2018-07-09 17:18:44 -07:00
Colin Cross
83bb3167f6 Add support for min_sdk_version
Add min_sdk_version properties and use it for aapt2
--min-sdk-version and --target-sdk-version flags.  Add an sdkContext
interface that any function that needs an sdk version can take in
order to get the values for the current module.

Bug: 110848854
Test: m checkbuild
Change-Id: Ic69f1f935d8b865ec77689350407df08bfac5925
2018-07-09 12:42:01 -07:00
Tobias Thierer
b1c697d03e Generate system modules for any value of EXPERIMENTAL_USE_OPENJDK9.
The flag EXPERIMENTAL_USE_OPENJDK9 controls the *default* value
of java_version / LOCAL_JAVA_LANGUAGE_VERSION, but that default
value can be overridden by individual build targets.

One requirement for individual build targets to opt-in to
java_version 1.9 is for system modules to be generated even if
the default language version is still < 1.9. We plan to allow
this soon for libcore targets; therefore, this CL changes the
system module targets to always be defined, regardless of the
value of EXPERIMENTAL_USE_OPENJDK9.

Test: In a workspace that has http://r.android.com/646840
      "make" no longer runs into the build failure from bug 76219552.
Bug: 76219552

Change-Id: I5193347452c7967f7695929619509aea0fd46844
2018-07-09 19:47:33 +01:00
David Brazdil
bd8b75e636 Add option to compile dex for a Java library
am: 17ef5635fa

Change-Id: Idc5df275cffabb7a4180a79ace529f03e9f0389a
2018-07-09 09:34:29 -07:00
David Brazdil
17ef5635fa Add option to compile dex for a Java library
Currently Soong will only compile a Java library into dex if the
library has device support and is installable. For our use case of
inspecting the dex at build time this is not sufficient. Add a new
"compile_dex" device property which forces the creation of a dex
rule. In this case, the class jar remains the output file of the
module.

Bug: 79409988
Test: on related CL
Change-Id: Ia908a47148a03a0bdb0da4315cce6efc86c51865
2018-07-09 16:04:41 +00:00
Mathew Inwood
f739144c43 Use correct variant for annotation processors.
am: 878c662602

Change-Id: I330b1d8e8d4de4411565ddcfaf06020e3deece86
2018-07-03 11:16:46 -07:00
Mathew Inwood
878c662602 Use correct variant for annotation processors.
Annotation processors should always have a common host variant, rather
than a device variant as the build was looking for before.

Bug: 110868826
Test: m
Change-Id: I2b7d0e7ed1af3f2f9ddb87d2bf36920737a507e9
2018-07-03 17:06:48 +01:00
Sundong Ahn
4afa0dd6fb Merge "Add api_dirs property and use module name as prefix"
am: b1f0f1aecd

Change-Id: Ibf5b2ea7f0e1742228a986ee69f33e570e1c43e2
2018-07-02 22:11:49 -07:00
Treehugger Robot
b1f0f1aecd Merge "Add api_dirs property and use module name as prefix" 2018-07-03 04:29:25 +00:00
Sundong Ahn
91676e6e42 Merge "Add stub_only_libs property"
am: 5d0d8ac858

Change-Id: I5eafedd93afcffe4fe533280524840391ee2d532
2018-06-29 00:03:32 -07:00
Treehugger Robot
5d0d8ac858 Merge "Add stub_only_libs property" 2018-06-29 06:52:56 +00:00
Sundong Ahn
44f0355021 Add condtion to avoid build error
am: 24a099c3b8

Change-Id: I738b11eacf03aecf5fc0e9e2e9c2b8abca10ad5a
2018-06-28 21:20:43 -07:00
Sundong Ahn
24a099c3b8 Add condtion to avoid build error
If docs file which is result of javadoc is null, there is a build error
when building stubs file. To avoid build error, we don't build if srcJar
files is exist but they don't have java file list.

Bug:77577799
Test: make -j
Test: Marking @hide to all APIs in javax.obex library
      -> make -j -> check build result.
      result is success

Change-Id: I85439417a36425e89a8fa2ecbc66d1b2022bc63a
2018-06-29 10:51:48 +09:00
Nan Zhang
81a944ddde Merge "Do not pass -system arg to Metalava."
am: c92232034e

Change-Id: I1dfbbfbf66bf051df99f07d36d62031b5227197d
2018-06-26 15:35:19 -07:00
Nan Zhang
c94f9d886c Do not pass -system arg to Metalava.
Continue to use -bootclasspath when -source 1.9 is enabled for Metalava
since it doesn't support -system yet.

Test: N/A
Bug: b/110824610
Change-Id: Ie1c047963bd66f1a100255efdcd6ca378cf2e1c4
2018-06-26 12:02:49 -07:00
Nan Zhang
0ecbf26bc1 Override javaVersion for Doclava when EXPERIMENTAL_USE_OPENJDK9=true
am: 7ca467854e

Change-Id: Icb37e941e5858d0f8dfb3734225886fcc6046e85
2018-06-25 15:44:51 -07:00
Nan Zhang
7ca467854e Override javaVersion for Doclava when EXPERIMENTAL_USE_OPENJDK9=true
Test: N/A
Bug: 110786923
Change-Id: I6d1f808e97aad2fe3206f52c8fc93c87b61fdb64
2018-06-25 13:00:25 -07:00
Sundong Ahn
f043cf6b32 Add stub_only_libs property
Java libraries are not included when a stub is built with
java_sdk_library. However, we may need a java library when building
stubs. For it, stub_only_libs property is added.

Bug: 77577799
Test: make -j
Change-Id: I2223288e3a85ec7f0ccccdc1da31f8d46cbcbcc0
2018-06-25 17:30:57 +09:00
Sundong Ahn
27eecb99d2 Add api_dirs property and use module name as prefix
The soong connect the prebuilt library according to LOCAL_SDK_VERSION.
But some sdk libraries has diffrent version policy with
LOCAL_SDK_VERSION. For this, we need to support direct link to the
prebuilt library instead of creating a new LOCAL_XXX_SDK_VERSION. So,
The base module name is used as the prefix for the prebuilt module name.

Remove the empty file check to support the absence of a prebuilt
library and add api_dirs property

Bug:77577799
Test: make -j
Change-Id: I1086977d26e4ddfd62e290637126d44e1b248bac
2018-06-25 10:30:30 +09:00
Colin Cross
7a5fe2bb7e Merge "Always use OpenJDK9 for building"
am: 5c733856bd

Change-Id: Ica65b1cc467db3bd5223aa1dd017e31728f93ca2
2018-06-21 14:56:43 -07:00
Colin Cross
5711acde4d Merge "Run ErrorProne in OpenJDK9"
am: 8eb0ad15bf

Change-Id: Ia4ceec4cc2fcb4bdd8565230d74bdb0cf972b89a
2018-06-21 13:57:26 -07:00
Colin Cross
997262f506 Always use OpenJDK9 for building
Remove support for compiling with javac from OpenJDK8.
We still target 1.8 by default, and OpenJDK8 prebuilts are still
required for the bootclasspath and running robolectric.

Bug: 38418220
Test: m java
Change-Id: I5686deb0ae4f9927192a039d08adc0117b2605dd
2018-06-21 12:25:50 -07:00
Colin Cross
3d72c9574d Use -processorpath for annotation processors
am: 6a77c9871c

Change-Id: I3162658384da1444253976d7ebb63ae2850b7200
2018-06-20 23:06:34 -07:00
Colin Cross
996fdf034b Merge "Revert "Use -processorpath for annotation processors""
am: ab97ae08cd

Change-Id: I7b2c072b37b7250c88274167e003774ac641ccca
2018-06-20 21:24:05 -07:00
Colin Cross
0de4b25f88 Merge "Use -processorpath for annotation processors"
am: 1418fe2e4c

Change-Id: I7274b202d505c2459cad0559e7e5f8686deabc8e
2018-06-20 21:19:44 -07:00
Colin Cross
6654810f37 Run ErrorProne in OpenJDK9
Use the OpenJDK9 javac to run ErrorProne by adding it to
-processorpath and using -Xplugin:ErrorProne.

Bug: 69485063
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I0496006b71b70766ef16d57753cbcf037897799c
2018-06-20 21:03:16 -07:00
Colin Cross
6a77c9871c Use -processorpath for annotation processors
ErrorProne needs to be added to -processorpath, but once anything is
passed via -processorpath javac stops looking in the classpath for
annotation processors.  Move annotation processors to -processorpath
in preparation.

This reapplies Ife06b3c7432ab971f5605dcc18a558bcbd99a675 with fixes
to processorpath in errorprone rules.

Test: m java
Change-Id: I188136771386a2183fb31f4b70b50c95ac419ff8
2018-06-20 21:03:07 -07:00
Colin Cross
2f10997e6b Revert "Use -processorpath for annotation processors"
This reverts commit 6dd0bb3b77.

Reason for revert: broke RUN_ERROR_PRONE=true build

Change-Id: I23d066281e392c6e7df29c5cd4558c7cf731c1a5
2018-06-21 03:56:45 +00:00
Colin Cross
ee4898cc40 Update soong for blueprint change to allow multiple deps
am: a1ce2a0071

Change-Id: I060f9a5b971ace92c815eb3aad67c33f3aed4d2b
2018-06-20 17:56:23 -07:00
Colin Cross
6dd0bb3b77 Use -processorpath for annotation processors
ErrorProne needs to be added to -processorpath, but once anything is
passed via -processorpath javac stops looking in the classpath for
annotation processors.  Move annotation processors to -processorpath
in preparation.

Test: m java
Change-Id: Ife06b3c7432ab971f5605dcc18a558bcbd99a675
2018-06-20 16:16:49 -07:00
Colin Cross
a1ce2a0071 Update soong for blueprint change to allow multiple deps
Blueprint allows multiple dependencies on the same module after
https://github.com/google/blueprint/pull/210.

Fix defaults, WalkDeps can now find the same defaults module multiple
times.

Fix droiddoc, if the srcs_lib points to a lib module that is
specified multiple times, for example through explicit properties
and implicit default libraries, the srcs would be listed on the
command line multiple times.  Move srcs_lib to use its own dependency
tag.

Test: m checkbuild
Change-Id: Ia30ce83be1382820d76bca5046ad18cbffe8af1a
2018-06-20 22:56:36 +00:00
Jiyong Park
4e00c2c14d Export SDK library names
am: 1be9691910

Change-Id: I43a3678b3134ef245187828e14a9ac87bc25ad02
2018-06-20 01:15:01 -07:00
Jiyong Park
1be9691910 Export SDK library names
java_library, java_import, and android_library export SDK library names
that they are using directly or indirectly via its dependencies. When
building an apk, the manifest fixer uses the SDK lib names to
automatically add <uses-library> tags.

The SDK lib names are exported to the make world via
LOCAL_EXPORT_SDK_LIBRARIES flag.

Bug: 77575606
Test: m -j
Change-Id: I4fe606eb7ed23843c58eebe6a324405fe1da34e5
2018-06-20 12:13:33 +09:00
Nan Zhang
83cd562ca8 Fix the build breakage for droiddoc
am: af322cc7c2

Change-Id: I05eecb95d19f1d33f9df9997cc8ba59e44f02367
2018-06-19 16:07:28 -07:00
Nan Zhang
af322cc7c2 Fix the build breakage for droiddoc
Removed the additional "-source $javaVersion" arg in javadoc rule
otherwise javadoc will report error:
javadoc: error - The -source option may be specified no more than once.

Test: m -j ahat-docs
Bug: b/70351683
Change-Id: I7f92236884154075fb4b20cd9a363419b1ecd3f5
2018-06-19 15:23:31 -07:00
Nan Zhang
0bf05e5b7a Merge "Support Java Lang level 9 for droiddoc in Soong."
am: 1328e9fee9

Change-Id: I5bc25962bca41eb82ee2e64a4abfdb6dbd0ba904
2018-06-19 14:42:05 -07:00
Nan Zhang
357466b18a Support Java Lang level 9 for droiddoc in Soong.
Test: m -j docs / m -j metalava-api-stubs-docs
Bug: b/70351683
Change-Id: I7220d04f508f6bb5ffd281cf31bc8c0069c219e5
2018-06-19 10:55:29 -07:00
Nan Zhang
3a280813a8 Merge "Changed droiddoc.go to compile Metalava based android.jar"
am: f89db951e5

Change-Id: I688a1376d061bcabff76410a46e6d47d2bdd20bf
2018-06-18 12:09:21 -07:00
Treehugger Robot
f89db951e5 Merge "Changed droiddoc.go to compile Metalava based android.jar" 2018-06-18 16:55:28 +00:00
Colin Cross
3b20009ae0 Merge "Add a script to inject values into manifests"
am: f269dbee54

Change-Id: I4bd044917c098d15c8b394c3e7413004c003261b
2018-06-15 22:42:49 -07:00
Colin Cross
f269dbee54 Merge "Add a script to inject values into manifests" 2018-06-15 22:53:52 +00:00
Nan Zhang
16c0a31b18 Changed droiddoc.go to compile Metalava based android.jar
Test: m -j metalava_android_stubs_current
Bug: b/78245848
Change-Id: Ibce139a93a40e412d8def1b26660446b0a7a24ff
2018-06-15 15:42:59 -07:00
Jiyong Park
948121659e Merge "Add errorprone.javacflags to java_sdk_library"
am: f71a98df8a

Change-Id: Ia63dd807b72c9c732ffb8c1280a4051fb7ab35ec
2018-06-14 22:01:02 -07:00
Treehugger Robot
f71a98df8a Merge "Add errorprone.javacflags to java_sdk_library" 2018-06-15 03:38:51 +00:00
Jiyong Park
b5b709f72c Add errorprone.javacflags to java_sdk_library
Bug: 110208852
Test: cherry-pick https://android-review.googlesource.com/c/platform/external/apache-http/+/620154
Test: m javac-check RUN_ERROR_PRONE=true

Change-Id: If97871e6e1fd597efed2b796620538ca4c57eed4
2018-06-15 10:40:26 +09:00
Sundong Ahn
5d90b68dae Merge "Support prebuilt libraries in prebuilt_apis.go"
am: 4dd99f65de

Change-Id: I6393f4df6b3800c6eebd850645ccc60dbf54557a
2018-06-14 18:28:19 -07:00
Colin Cross
8bb10e8f8a Add a script to inject values into manifests
Add a script that can inject a <uses-sdk minSdkVersion=""> into
AndroidManifest.xml files.  This will help with merging
LOCAL_STATIC_ANDROID_LIBRARIES, because ManifestMerger treats
a missing minSdkVersion as minSdkVersion=1 and throws errors
if libraries use a larger minSdkVersion.  It will also help
with cases where an app has a manifest that specifies an old
minSdkVersion, but the build system is compiling the app in
a way that is not compatibile with old devices, for example
using a newer dex format.

Bug: 110167203
Test: m java
Test: build/soong/scripts/manifest_fixer_test.py
Change-Id: I528d71a225feb86464c530e11b223babb0ea9edf
2018-06-14 14:54:27 -07:00
Sundong Ahn
a01c2a510e Support prebuilt libraries in prebuilt_apis.go
When the sdk_version or LOCAL_SDK_VERSION is not current or
TARGET_BUILD_APPS is not null, module will use the prebuilt
libraries. For this, prebuilt libraries are supported in
prebuilt_api.go

Bug:77577799
Test: make -j
Test: make -j TARGET_BUILD_APPS='camera2_stubs_test'
      and check intermediates files

Change-Id: I9540c1d1a7a030bcc599b77df8d101529b12b3bf
2018-06-13 22:51:45 +09:00
Xin Li
debc55209d Merge pi-dev-plus-aosp-without-vendor into stage-aosp-master
Bug: 79597307
Change-Id: I90a6fab929bdb84f035c2b816af661d29dc368d4
2018-06-08 11:06:45 -07:00
David Brazdil
6a25de47dc Merge "Support new Doclava flag" 2018-06-08 14:22:26 +00:00
Colin Cross
7a72575d6d Merge "Revert "Revert "Remove desugar support""" am: 38462a6881
am: 216c4c8a7a

Change-Id: I4f148400379525f68e9f116ddcdb4b4ee36910a1
2018-06-07 15:49:11 -07:00
Andreas Gampe
331efc81ca Merge "Soong: Update for explicit warning change" am: 8a9f5da905
am: 24de8d76cd

Change-Id: I33918e5766d798a56c77b236a3e18041e231d0b7
2018-06-07 15:36:57 -07:00
Treehugger Robot
38462a6881 Merge "Revert "Revert "Remove desugar support""" 2018-06-07 20:31:22 +00:00
Treehugger Robot
8a9f5da905 Merge "Soong: Update for explicit warning change" 2018-06-07 19:55:54 +00:00
David Brazdil
fbe4cc32ed Support new Doclava flag
CL I5f92a54d718749f8ddef9472f3b6387a3debd385 adds a new "-dexApi" flag
to Doclava, which generates the public API as a list of Dex signatures.
Add support for this flag to Soong and expose it in the droiddoc rule.

Bug: 80461842
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Change-Id: Iadf09f17bb783209a6555ce5289c381bf025a01c
2018-06-07 09:44:31 +00:00
Sundong Ahn
947cbed480 Add Static libs to droiddoc libs am: e6f0b056af
am: 1a3ae21fe2

Change-Id: I967ea1116d97bb22f420fd576460cb8e94d7d4c2
2018-06-06 23:57:04 -07:00
Sundong Ahn
e6f0b056af Add Static libs to droiddoc libs
Add Static libs to droiddoc libs because The droiddoc doesn't
distinguish between shared libs and static libs and static libs are
needed when creating droiddoc modules.

Bug:77577799
Test: make -j
Change-Id: Iace79800d2338518e5f881f01d0002908544234f
2018-06-07 11:35:26 +09:00
Andreas Gampe
05f08543d3 Soong: Update for explicit warning change
Add ErrorProneChecksWarning.

Bug: 72971960
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I92169ed4aa8e7dc52b84ddb005cd07e2bf6dcbe2
2018-06-06 16:38:45 -07:00
Colin Cross
0b16af4039 Merge "Revert "Remove desugar support"" am: 7302905413
am: ecf35d00ea

Change-Id: Ib829111904db2eeb3ec19b2d59c0c7bfe331b505
2018-06-06 16:26:14 -07:00
Colin Cross
d4bf7d9f89 Merge "Remove desugar support" am: 0d39cb1179
am: 406aa5fa90

Change-Id: I9555559eacb92cf0e7e89bf787b15967f748e327
2018-06-06 15:24:46 -07:00
Colin Cross
3a11cd03b8 Remove references to SourceDepTag in module types am: 2d24c1b654
am: 069ebe6692

Change-Id: I0b7f249b3224ca8099f10eac53ee782f552ce951
2018-06-06 15:23:07 -07:00
Colin Cross
bafb897de7 Revert "Revert "Remove desugar support""
This reverts commit 7576916efc.

Reason for revert: includes art veridex fix this time

Change-Id: Ia8da00b5ec8ed3dc3ce2a2521f0a7b2b2b131960
2018-06-06 21:46:32 +00:00
Colin Cross
7302905413 Merge "Revert "Remove desugar support"" 2018-06-06 21:44:52 +00:00
Colin Cross
7576916efc Revert "Remove desugar support"
This reverts commit 000280bb0e.

Reason for revert: broke art veridex build

Change-Id: I9f7d7cdbe8e34671614687ac0b34c0338ef240e7
2018-06-06 21:42:39 +00:00
Treehugger Robot
0d39cb1179 Merge "Remove desugar support" 2018-06-06 20:26:19 +00:00
Colin Cross
2d24c1b654 Remove references to SourceDepTag in module types
SourceDepTag is going to become a set of tags of the same type
instead of a single tag, remove references to it outside the
android module.

Bug: 80144045
Test: soong tests
Change-Id: I00b2ea5040e4fc95dfbfdd79e21579853c478fcb
2018-06-06 17:05:20 +00:00
Colin Cross
000280bb0e Remove desugar support
Desugaring is always handled by d8 now.

Test: m checkbuild
Change-Id: I29e8f68e51b194a4090866acc63f19f0605e318d
2018-06-06 10:05:06 -07:00
Colin Cross
498cb41438 Merge "Add kotlin stdlib to javac classpath" am: dd0b4e06f5
am: 3d88f297d2

Change-Id: I19d7dff450e69c25895c136382c53fb4849eab48
2018-06-06 01:25:29 -07:00
Nan Zhang
7a9601ca8a Merge "Integrate Metalava to Soong Build" am: f181bc9733
am: ca96388e60

Change-Id: I97d233a78706c2a0964f125c4978a262642b9048
2018-06-06 01:16:41 -07:00
Colin Cross
dd0b4e06f5 Merge "Add kotlin stdlib to javac classpath" 2018-06-06 04:42:26 +00:00
Colin Cross
49da2757cd Add kotlin stdlib to javac classpath
Java modules that have .kt sources may also use kotlin stdlib types
in their .java sources.

Bug: 78245848
Test: m checkbuild
Change-Id: I064cb76b8a641ad92d648febaa400bc01549a9c5
2018-06-06 00:32:24 +00:00
Nan Zhang
79614d1c14 Integrate Metalava to Soong Build
Test: Manually checked-in prebuilt metalava.jar to my local src tree and
      compare the doclava based api file and metalava based api file.
Bug: b/78245848

Change-Id: Ib434f1e15403a78a0ccf89d9aacb70a6f8b05b2b
2018-06-05 14:44:43 -07:00
Nan Zhang
3692aa89bd Merge "Fix droiddoc date error on Darwin" am: d9e8b8c40c
am: 2e31d953f0

Change-Id: I18c8f5b430c72676faa2a69626b3a06cbb5d5e17
2018-06-04 17:39:43 -07:00
Nan Zhang
46130975ab Fix droiddoc date error on Darwin
Bug: b/109579193
Test: m -j all-docs
Change-Id: I708f200c8dbd5a135767d0ffb10786f223471850
2018-06-04 15:19:40 -07:00
Colin Cross
fca70ee9af Add core-lambda-stubs to classpath am: 86a60ae6fa
am: d4ef9dd148

Change-Id: I30d8fe073e9956725d91b239138016adc52d4f0a
2018-05-30 16:00:01 -07:00
Colin Cross
86a60ae6fa Add core-lambda-stubs to classpath
Add core-lambda-stubs to the bootclasspath for modules with no
sdk_version or with sdk_version: "current", and to the classpath
for modules that specify a specific sdk_version number.  Use the
prebuilt sdk-core-lambda-stubs when using a prebuilt SDK.

Fixes compiling modules with lambdas against the SDK.

This reapplies I5e700f2dd86f1a6b84b7a55dd9bfe21a448d3fb6 with fixes
and tests for unbundled builds.

Bug: 80428539
Test: java_test.go
Change-Id: Ib7aaeebb93137270d7336a7293a08ed7064a3184
2018-05-30 16:47:00 +00:00
Colin Cross
7588ddcfca Merge "Revert "Add core-lambda-stubs to classpath"" am: 6c2e97364e
am: 0668619db7

Change-Id: I95d37c8cc23d5079e4348d176c2206c38773de57
2018-05-30 00:35:23 -07:00
Treehugger Robot
6c2e97364e Merge "Revert "Add core-lambda-stubs to classpath"" 2018-05-30 07:23:09 +00:00
Colin Cross
7cdc22edb9 Revert "Add core-lambda-stubs to classpath"
This reverts commit d9d7be0617.

Reason for revert: Broke unbundled builds.

Bug: 80428539
Change-Id: I2279dbd2b11a2f63e70ad89d0b3bc42bca2b676b
2018-05-30 05:45:09 +00:00
Sundong Ahn
1b24d8ed16 Merge "Add aidl properties" am: c550ed5833
am: d7d90f89c2

Change-Id: I67e8ac37694389b5701b62f3d306cb8c3280adab
2018-05-29 20:40:01 -07:00
Colin Cross
9781882d24 Add core-lambda-stubs to classpath am: d9d7be0617
am: 417824868d

Change-Id: Ia01d156c82c29042b160e844b34e70a4450de071
2018-05-29 20:30:26 -07:00
Treehugger Robot
c550ed5833 Merge "Add aidl properties" 2018-05-30 01:52:57 +00:00
Colin Cross
d9d7be0617 Add core-lambda-stubs to classpath
Add core-lambda-stubs to the bootclasspath for modules with no
sdk_version or with sdk_version: "current", and to the classpath
for modules that specify a specific sdk_version number.

Fixes compiling modules with lambdas against the SDK.

Bug: 80428539
Test: java_test.go
Change-Id: I5e700f2dd86f1a6b84b7a55dd9bfe21a448d3fb6
2018-05-29 23:47:50 +00:00
Sundong Ahn
1b92c824f3 Add aidl properties
The aidl files are allowed when creating the droiddoc module in
java_sdk_library. But The properties of AIDL, local_include_dir
and include_dir, are not passed to the droiddoc module.
These properties are add because they are needed to generate the
java files.

Bug: 77575606
Test: build && java_test.go
Change-Id: I1006c9ce7a5c7e424416d39fb921c27a3fa86afa
2018-05-29 04:25:02 +00:00
Jiyong Park
6c1f5e4196 Merge "droiddoc accepts aidl files as inputs" am: 516e580f94
am: c67315876d

Change-Id: I6121ffaab515c8dafe94522c3034145dfbb12a13
2018-05-25 16:32:34 -07:00
Treehugger Robot
516e580f94 Merge "droiddoc accepts aidl files as inputs" 2018-05-25 23:19:24 +00:00
Colin Cross
cf680bc55e Merge changes I47b9def5,I16661701,I194aeeb8 am: 9d0940c7a7
am: 3eef5574ae

Change-Id: Ie0bfbce4e479d8012fd71a319ea2605747bbd74d
2018-05-24 18:42:38 -07:00
Colin Cross
515e486a05 Merge "Support platform_apis property" am: 47ec6df851
am: 31aac9ec9f

Change-Id: I1b65d4d6977840eb3074336bdc1cb89a6c1d3489
2018-05-24 15:49:59 -07:00
Colin Cross
10f7c4a268 Export manifest to Make
I5d439353d46ba6659ec8d16967693d2b9e62ab5a will need the manifests
from android libraries to merge into modules that reference them
with LOCAL_STATIC_ANDROID_LIBRARIES.

Bug: 3434784
Test: m checkbuild
Change-Id: I47b9def5b9c2ecc423550eb8a988cce96038a81e
2018-05-24 15:24:12 -07:00
Colin Cross
ae5caf554c Add support for android_test modules
android_test module are APKs that can be run as tests, either
as standalone unit tests or as instrumentation tests for another
APK.

Test: m checkbuild
Change-Id: I16661701637e4048fd99442029c3e195ebf373a4
2018-05-24 14:53:58 -07:00
Jiyong Park
1e440683e5 droiddoc accepts aidl files as inputs
droiddoc now accepts aidl files as inputs. This in turn allows us to
feed aidl files to java_sdk_library modules. This is required as some
java_sdk_library internally uses AIDL files and thus we need to specify
*.aidl files in the srcs property. Since the srcs property is internally
given to the droiddoc module as well as the runtime library, droiddoc
should be able to handle aidl files.

Bug: 77575606
Test: java_test.go
Change-Id: If7a8559a2a1d8ac1056b061d24e3a5ee5253453f
2018-05-23 18:42:04 +09:00
Colin Cross
6af2e4980f Support platform_apis property
Add a platform_apis property.  The logic to verify it isn't
hooked up yet, but this will allow translating modules to
Soong without losing the annotation.

Test: m checkbuild
Change-Id: I75ff2d7b94247873f5bb1547a9b347a8e73c3191
2018-05-22 14:14:27 -07:00
Dan Willemsen
9cb62ef31a Merge "Run dep_fixer for java too" am: 6af008fc0f
am: 5aefc232ba

Change-Id: Id21a8fa7e93287a605d1b4322ebb32f4653c8233
2018-05-17 12:15:22 -07:00
Treehugger Robot
6af008fc0f Merge "Run dep_fixer for java too" 2018-05-17 18:59:47 +00:00
Dan Willemsen
a10504e3ac Run dep_fixer for java too
Test: treehugger
Change-Id: I22fd9861f5a93842dc92365af1378235c171bb05
2018-05-17 10:11:17 -07:00
Colin Cross
c150d3c878 Merge "Declare proguard_dictionary as implicit output of r8" am: 8265a8b81f
am: 7d778cb4fd

Change-Id: I0a491b12bed64116e65465cb7a72f95c42471019
2018-05-16 22:37:07 -07:00
Colin Cross
c0c664cd56 Declare proguard_dictionary as implicit output of r8
Soong was generating proguard_dictionary, but not marking it as an
output, so ninja would fail with:
ninja: error: 'out/soong/.intermediates/bootable/recovery/tools/recovery_l10n/RecoveryLocalizer/android_common/proguard_dictionary', needed by 'out/target/common/obj/APPS/RecoveryLocalizer_intermediates/proguard_dictionary', missing and no known rule to make it

Fixes: 78770148
Test: mmma bootable/recovery/tools/recovery_l10n
Change-Id: I956f92519ea81d4fb1322114214099d46d734906
2018-05-17 03:46:09 +00:00
Jiyong Park
5c6dd1ca3e Merge "java_sdk_library does the apicheck by default" am: a8d897cc49
am: 2ae570eb6c

Change-Id: Ia9c12685d5d30173b79de14f5a853783f979c101
2018-05-15 00:06:07 -07:00
Jiyong Park
58c518b594 java_sdk_library does the apicheck by default
droiddoc now supports apicheck. java_sdk_library uses it to
automatically perform apichecks against the not-yet-release API and
the latest-released API.

A module type prebuilt_apis is added. It finds api txt files and creates
filegroup modules so that it can be referenced from java_sdk_library
across the module boundary.

Bug: 77575606
Test: m -j
Test: m -j checkapi
Test: m -j update-api
Change-Id: I0ba859972eac060296e1df2e71c4e047392d4877
2018-05-15 10:57:01 +09:00
Jiyong Park
b7c7580ea8 Fix some minor bugs for droiddoc am: eeb8a6474c
am: 87e61f5667

Change-Id: I40204527e86539be025b3393c0c8c24d86f269e3
2018-05-13 19:32:53 -07:00
Jiyong Park
eeb8a6474c Fix some minor bugs for droiddoc
1) typo: check-api -> checkapi
2) newlines in the error messages are correctly emitted

Bug: 77575606
Bug: 78034256
Test: m -j checkapi

Change-Id: Ibeef4d9f4f7f2ca48c29c23b1784efa6aa53a364
2018-05-12 22:22:34 +09: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
android-build-prod (mdb)
2d8ea6cd06 Merge "Apicheck Support in Soong" am: 3a621d3a86
am: 2658508416

Change-Id: I9f93d174a97cbeb23bfaa451c3e6f830e69fb74a
2018-05-08 23:09:49 -07:00
Nan Zhang
61819cef14 Apicheck Support in Soong
didn't remove the props: api_filename, removed_api_filename yet since
these two currently are used by java_sdk_library.

Bug: b/78034256
Test: m clean && m checkapi

Change-Id: Iebd014ef227487717b5b3819c80d630c34559983
2018-05-08 16:24:07 -07:00
android-build-prod (mdb)
78ca3047ea Merge changes I52f88bfd,I4263b7d5 am: 720f04b964
am: d2bb2b5c6c

Change-Id: Ia5ff67a34bc96467778e13766b7779ea1f2aa0cd
2018-05-07 18:21:39 -07:00
android-build-prod (mdb)
720f04b964 Merge changes I52f88bfd,I4263b7d5
* changes:
  Fix usage of bytes.NewBuffer in bpfix
  Add a dependency fixer for proto deps
2018-05-08 01:05:10 +00:00
Dan Willemsen
4339853a20 Add a dependency fixer for proto deps
protoc dependency files, at least for C++ outputs, uses the form of:

  a/b.c \
  a/b.h: <dep1> <dep2>...

Ninja will fail the command when it parses a dep file and there's more
than one output file (even though it doesn't care what the output file
name is). So this tool will parse the original file, and output a
version with only a single output file.

Bug: 67329638
Test: NINJA_ARGS="-t deps ...pb.c" m
Test: NINJA_ARGS="-t deps ...srcjar" m
Test: NINJA_ARGS="-t deps ...srcszip" m
Test: Run dep_fixer across all of taimen's dep files, no failures.
Test: Run dep_fixer against the processed files, no changes.
Test: Run androidmk across all of our Android.mk files, inspect the diffs
Change-Id: I4263b7d5faea37285afa6b24dedf5964aa7d19dc
2018-05-07 16:21:59 -07:00
Colin Cross
028f42f002 Merge "Export lists of support libraries modules to Make" 2018-05-07 17:53:09 +00:00
Jiyong Park
bfc126ddf6 Prevent index out of range am: b674a5226a
am: 35a9bfd238

Change-Id: I39a75fa2e00de11301e59a57bb0ead5233c93b42
2018-05-05 17:41:33 -07:00
Jiyong Park
b674a5226a Prevent index out of range
I3487634f1ec5bb3b5b60d636b64461d391add35a is causing build breakages in
unbundled builds.

The stubs libs are disabled for unbundled builds, and thus we shouldn't
declare them as dist artifacts.

Bug: 605033
Test: make -j dist ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Change-Id: I3cd92e2cc6aeb48baf47d37780d8df2aa4756438
2018-05-06 07:56:17 +09:00
android-build-prod (mdb)
c665daef26 Merge "Stubs libs are dist artifacts" am: 11f12db823
am: e4a2c81ead

Change-Id: Ifb129a8a028ea30a44391f6660fd7835d35f6f2f
2018-05-05 07:22:07 -07:00
android-build-prod (mdb)
11f12db823 Merge "Stubs libs are dist artifacts" 2018-05-05 14:08:48 +00:00
Colin Cross
b2559a0224 Export lists of support libraries modules to Make
Make will use the list to sort support libraries into
LOCAL_STATIC_ANDROID_LIBRARIES and LOCAL_STATIC_JAVA_LIBRARIES
as appropriate.

Bug: 78300023
Test: m checkbuild
Change-Id: I58582b124f2b6a9b124683ddf8f5d77314f2e941
Merged-In: I58582b124f2b6a9b124683ddf8f5d77314f2e941
(cherry picked from commit ff8ab0745f)
2018-05-03 16:48:13 -07:00
Colin Cross
7f9b6fbeec Export lists of support libraries modules to Make
Make will use the list to sort support libraries into
LOCAL_STATIC_ANDROID_LIBRARIES and LOCAL_STATIC_JAVA_LIBRARIES
as appropriate.

Bug: 78300023
Test: m checkbuild
Change-Id: I58582b124f2b6a9b124683ddf8f5d77314f2e941
Merged-In: I58582b124f2b6a9b124683ddf8f5d77314f2e941
(cherry picked from commit ff8ab0745f)
2018-05-03 23:09:32 +00:00
Colin Cross
dd7063ba08 Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES
If a static android library lib1 has static_libs: ["lib2"] then the
R.class files for packages in lib2 will be merged into the jar for
lib1.  If an app has lib1 in its static_libs it will get the R.class
files from lib2 through lib1, instead of regenerating the R.java
files with numbering that matches the resource table of the app.

Pass transtive static android library dependencies on the aapt2
command line so that aapt2 will always regenerate the R.java
constants for those packages.

Also extract the packages that have R.java files after each aapt2
invocation.  This is not necessary for Soong, but is passed to
make to let it force regenerating the packages using
--extra-packages.

Bug: 78300023
Test: m checkbuild
Change-Id: I0f3444af44d2a9f370d1f156c908972f8cc3a1ee
Merged-In: I0f3444af44d2a9f370d1f156c908972f8cc3a1ee
(cherry picked from commit 66f78820e1)
2018-05-03 14:38:12 -07:00
Colin Cross
5507bc7fc8 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
Merged-In: I8f86fecb09cbc591832ce67e8ecef551a6600349
(cherry picked from commit 89c31581a5)
2018-05-03 14:38:12 -07:00
Colin Cross
6a43fdbc3b 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
Merged-In: I89e8c0a3fb788b18ee6603e9d21c9b9a5275f42f
(cherry picked from commit e78dcd313c)
2018-05-03 14:38:12 -07:00
Colin Cross
42b96648ca Add support for android_library modules
Add support for compiling android_library modules into AARs,
and refactor app support on top of it.

Bug: 73724997
Test: app_test.go
Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
Merged-In: I1dfac5fffe577c6680bc4709147b2061eb7d819c
(cherry picked from commit a97c5d3f08)
2018-05-03 14:38:12 -07:00
Colin Cross
38c3ffabc0 Export lists of support libraries modules to Make
Make will use the list to sort support libraries into
LOCAL_STATIC_ANDROID_LIBRARIES and LOCAL_STATIC_JAVA_LIBRARIES
as appropriate.

Bug: 78300023
Test: m checkbuild
Change-Id: I58582b124f2b6a9b124683ddf8f5d77314f2e941
Merged-In: I58582b124f2b6a9b124683ddf8f5d77314f2e941
(cherry picked from commit ff8ab0745f)
2018-05-03 21:21:03 +00:00
Colin Cross
33dce942f2 Merge "Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES" am: 93b4818201
am: c368d6196c

Change-Id: Iea1fb5b38ec54ed28b6f8b3c31aba3b43ec05b98
2018-05-02 15:03:20 -07:00
Colin Cross
66f78820e1 Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES
If a static android library lib1 has static_libs: ["lib2"] then the
R.class files for packages in lib2 will be merged into the jar for
lib1.  If an app has lib1 in its static_libs it will get the R.class
files from lib2 through lib1, instead of regenerating the R.java
files with numbering that matches the resource table of the app.

Pass transtive static android library dependencies on the aapt2
command line so that aapt2 will always regenerate the R.java
constants for those packages.

Also extract the packages that have R.java files after each aapt2
invocation.  This is not necessary for Soong, but is passed to
make to let it force regenerating the packages using
--extra-packages.

Bug: 78300023
Test: m checkbuild
Change-Id: I0f3444af44d2a9f370d1f156c908972f8cc3a1ee
2018-05-02 13:11:01 -07:00
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
Jiyong Park
90931dede0 Merge "Property api_srcs added for api-only source files" am: d126f7b52f
am: b5a2a3f5b5

Change-Id: I02fccd0e42ef5d1b58d65ae358513198dfc6c161
2018-05-01 20:13:51 -07:00
android-build-prod (mdb)
927340ecd3 Merge "CompilerDeviceProperties are added to the sdk impl library" am: b1a96e5ebf
am: 031973687f

Change-Id: I6e54c2f80c4cd3a2dffb6c87744e552e618a0393
2018-05-01 19:35:06 -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
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
551381c9c3 Add hidden_api_packages to java_sdk_library am: 5a2c9d7a46
am: 95432df502

Change-Id: Ib6a6d4af5d015de3df8c7ae962564a74204690bb
2018-05-01 09:15:11 -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
212f52008e Add some friendly error messages for java_sdk_library. am: 8959e149b7
am: fc3f21e609

Change-Id: I43e16f42be1e13eff69035cd3862dacce7f95b43
2018-05-01 00:04:23 -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)
e448ef1d12 Merge "Use and export proguard flags from static dependencies" am: 1873f39223
am: 0591553c02

Change-Id: Ic037e560ffe449037e10dc2d8d8abf257a694729
2018-04-30 18:22:55 -07:00
Jiyong Park
6467022e17 java_sdk_library supports test as another API scope am: df13054c2a
am: d5ed585832

Change-Id: I333d0c668674b157ccf2e10e82b0b1d4ce41cb4f
2018-04-30 18:21:43 -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
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
5edf8e8580 Add prebuilt_etc_xml am: 5a8d1bee89
am: 6455f181e9

Change-Id: I00e8d1adf36a2b0a0dbd2979ecf0d7f574ae66e0
2018-04-27 10:29:03 -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
00d4c1a3c7 Merge "Add new Doclava flag support to soong" am: aac4b84ce5
am: 8aac41602f

Change-Id: I16e350e373480879757555f1e86d6186d4cc9702
2018-04-26 07:42:08 -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)
e8f20d5ae1 Merge "Don't use AppsDefaultVersionName for framework-res.apk" am: eedc9484ab
am: 4fe12e40c3

Change-Id: I112af41246f965b4d5306fdbeafaf524fc80565e
2018-04-25 17:20:43 -07:00
android-build-prod (mdb)
eedc9484ab Merge "Don't use AppsDefaultVersionName for framework-res.apk" 2018-04-25 23:51:49 +00:00
Colin Cross
e6c053388b 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
Merged-In: If67f40aae1066d4ff3bf97da1b2de2e1e250ad9c
(cherry-picked from commit 402d5e0919)
2018-04-25 15:23:57 -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
Nan Zhang
8d5c7ddbff Merge "Fix the undefined CommandDeps for standard Javadoc" am: f9a34b667f
am: c3057b9828

Change-Id: I949fb5a65b25ded297943cffa0c0543346ffa998
2018-04-24 16:20:35 -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
Jiyong Park
e1174669ee Additional fixes for java_sdk_library am: 82484c0771
am: a736bd6d42

Change-Id: Ib86cce03a5c7703615d03e6655eb119bbddc316e
2018-04-23 19:42:12 -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
Colin Cross
aca00676f1 Merge "Remove product-specific flags from android_library modules" am: 5fd7dfd124
am: ac3b81f4b8

Change-Id: I7ce01ae3f4f3673657d9a17eac1a9b00dfb73be9
2018-04-19 18:38:46 -07: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
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
Anton Hansson
cbe6a7f772 Merge "Migrate soong to use new sdk prebuilts." am: 6284323772
am: f6677ff743

Change-Id: I85ea8ded0b03f52adac92ab58e0685162468c6b3
2018-04-18 08:46:56 -07:00
Anton Hansson
f66efeb4ef Migrate soong to use new sdk prebuilts.
Make is moved over in aosp/661963.

Bug: 77525052
Test: make
Change-Id: I04ea58964df3d4149ef09ab7ca9238336d338a06
2018-04-18 14:53:59 +01: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
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
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
Nan Zhang
f430c3dce8 Merge "Add bool to control if we need generate stubs src files." am: 423245dcc3
am: 3f8cbe202b

Change-Id: I2e3fbe0b3a53948b780e356dc03c49e8130b1633
2018-04-16 17:40:53 -07:00
Colin Cross
a8c09e7840 Merge changes I9fb94f22,I1dfac5ff am: 038f71d7d7
am: 288fd5d41e

Change-Id: I462d57eb90d57c67bd5f5987806e8e36653f2fcd
2018-04-16 17:39:31 -07:00
Treehugger Robot
423245dcc3 Merge "Add bool to control if we need generate stubs src files." 2018-04-17 00:08:22 +00:00
Colin Cross
a97c5d3f08 Add support for android_library modules
Add support for compiling android_library modules into AARs,
and refactor app support on top of it.

Bug: 73724997
Test: app_test.go
Change-Id: I1dfac5fffe577c6680bc4709147b2061eb7d819c
2018-04-16 15:24:47 -07:00
Makoto Onuki
afd657ab4d Soong: add "java_genrule_host" am: 8f9ab6a26b
am: 1bb9940f3e

Change-Id: I896dad87010f44b1504687d7f2bf402772a6aec0
2018-04-16 13:56:03 -07:00
Makoto Onuki
8f9ab6a26b Soong: add "java_genrule_host"
Bug: 78030154
Test: Tested with an internal test module.
Change-Id: Ifaefb7cba2eb491b62fa3b398fee931ab667575f
2018-04-13 16:37:22 -07:00
Nan Zhang
853f420ed7 Add bool to control if we need generate stubs src files.
Some modules only need the documentation instead of the stubs.

And fix a small issue for arg name passed to standard javadoc.

Test: m -j dx-docs and check the build.ninja
Bug: b/70351683
Change-Id: Ic47c53db12db6f2632349e48c4a626a4f432f447
2018-04-12 18:05:40 -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