Commit graph

555 commits

Author SHA1 Message Date
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