Commit graph

650 commits

Author SHA1 Message Date
Nan Zhang
a40da04a99 Refactor java/droiddoc.go in Soong.
The GenerateAndroidBuildActions() is too big to be maintained and added-in new
features.

Since the GenerateAndroidBuildActions() is a giant code block having build flags
setting and workflow logic mixed in it. So seperate these two main
stuff to only keep workflow logic in the function, and create other
indipendent flags setting functions to increase the modularity.

Test: m -j api-stubs-docs && m -j metalava-api-stubs-docs, and check
build.ninja file
Bug: b/70351683

Change-Id: I4230d353756aeb4b24640f641b8f8bab6b21204d
2018-08-01 13:18:29 -07:00
Sundong Ahn
dd567f9c14 Add new properties
Droiddoc_options is added, since all sdk libraries don't builds with the
same argument. We provide basic droiddoc argument and options can be
added like "stubsourceonly" by this property.

When building stubs, soong don't make dex files, but some module uses
dex files from stubs. So Complie_dex is added for compiling dex
regardless of installable.

Srcs_lib_whitelist_pkgs property is added for using other whitelist
pkgs instead of "android.annotation".

Bug: 77577799
Test: m -j
Change-Id: Ic2fb7bc9c49a825550dbebe3e9132ad9a735322f
2018-08-01 02:18:32 +00:00
Nan Zhang
2158d6ff95 Merge "bundle files related to sdk dev tool with generated docs."
am: a5949691b5

Change-Id: I0795b5a3da0e516f42b7020df789665224e61686
2018-07-30 13:41:24 -07:00
Nan Zhang
90fe6746a7 bundle files related to sdk dev tool with generated docs.
bundle files related to sdk dev tool(activity_actions.txt, and etc.) to the
final -docs.zip file since sdk.atree needs to copy these files from
$(OUT_DOCS)/offline-sdk dir.

Test: m -j out/target/common/docs/offline-sdk-timestamp
Bug: b/70351683
Change-Id: I3bfb3c56570dd6728dec272d38c6046e0d44c40f
Merged-In: I3bfb3c56570dd6728dec272d38c6046e0d44c40f
2018-07-26 16:13:23 -07:00
Colin Cross
a0f23a4329 Merge "Set targetSdkVersion in manifest_fixer"
am: 4ac2db24eb

Change-Id: Ic9827f6c357919347ad0300fe91040171e9526b4
2018-07-26 15:11:29 -07:00
Steven Moreland
570251f9b1 Build Java aidl w/ '-b'.
am: 667f688f36

Change-Id: I90cbcc29ca395e799e5f64d9135a002f025b5efa
2018-07-26 15:11:05 -07:00
Colin Cross
4ac2db24eb Merge "Set targetSdkVersion in manifest_fixer" 2018-07-26 22:02:36 +00:00
Steven Moreland
667f688f36 Build Java aidl w/ '-b'.
As it turns out, AIDL originally passed and returned success
when it was asked to compile an unstructured parcelable even
though no output files were created.

The build system currently can't handle this because it is
expecting outputs here, so I am adding this argument here
which will cause the compiler to exit and error earlier as
expected.

Notice also that the make implementation of the AIDL build
system also passes in this argument.

Test: m framework (which invokes this many times)
Bug: N/A
Change-Id: Ia9b5280dc3593756784035a523399545c9947d80
2018-07-26 12:55:08 -07:00
Colin Cross
1b6a3cfea4 Set targetSdkVersion in manifest_fixer
If targetSdkVersion is not set in the manifest, set it to the
value it was implicitly using before changing minSdkVersion.
Requires passing --library to manifest_fixer.py to distinguish
between apps, where the implicit value was set by aapt2 to
current, or libraries where the implicit value was 1.
Fixes cases where the manifest does not specify targetSdkVersion
and was inheriting the minSdkVersion value until manifest merger
started merging a lower targetSdkVersion value from a library.

Bug: 111347801
Test: manifest_fixer_test.py
Change-Id: I8fcf0c5f452707565ba1808f6fe552ffed055c47
2018-07-26 11:09:24 -07:00
Sundong Ahn
7d8295cc12 API txt files are dist artifacts
am: 20e998b32c

Change-Id: I0d77bb3e0331c609f168e1eb1c58eb8a7fb3b468
2018-07-25 21:45:27 -07:00
Sundong Ahn
20e998b32c API txt files are dist artifacts
API txt files 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>/api/<name>.txt
where <apiscope> can be public, system and test.

Bug: 77577799
Test: m -j
Change-Id: I38cd8ee000445ce843ac01ead38001e509228738
2018-07-26 01:40:08 +00:00
Pete Gillin
690dfda955 Turn droiddoc's metalava_merge_annotations_dir into a list.
am: b13a015cee

Change-Id: I5551aeb25ff33719551d04fcd326e0bf47169ad6
2018-07-25 10:08:14 -07:00
Pete Gillin
b13a015cee Turn droiddoc's metalava_merge_annotations_dir into a list.
This change replaces droiddoc's metalava_merge_annotations_dir
parameter (which takes a single value) with
metalava_merge_annotations_dirs (which takes a list). This will makes
it possible to merge libcore annotations in from a separate directory
under ojluni, instead of adding them in a preprocessing step.

It is implemented by passing the --merge-annotations argument to
metalava multiple times, which is already supported by metalava's
command line parsing.

Test: `make metalava-api-stubs-docs` with a local change to add a second directory in //frameworks/base/Android.bp
Bug: 111639530
Change-Id: I53d31f1dd45c13405b4511c2b44cbeb7f0e439d1
2018-07-25 11:37:44 +01:00
Dan Willemsen
b1b05b9978 Mark soong-generated phony rules as PHONY
am: a03c43a4a7

Change-Id: I3dec0c4664a03197572f2845f875cefc63d2f1dc
2018-07-25 00:39:54 -07:00
Dan Willemsen
a03c43a4a7 Mark soong-generated phony rules as PHONY
Test: add --writable=out/ to kati, see fewer warnings with this change
Change-Id: I4beb47f41888e3743b298c90edfeb38fcc0b3d32
2018-07-25 04:27:10 +00:00
Nan Zhang
a9ebb36a15 Merge changes from topic "metalava-sdk-jar"
am: cce87cbaa0

Change-Id: I5edc638cc8c859336c9de5e7e4b8dd9f0ff3004d
2018-07-24 17:06:20 -07:00
Nan Zhang
6c14e73786 Use Metalava based android.jar for SDK
am: 03b733c936

Change-Id: Id20a26219c3549a0de1ec6112e89788e2e6e357d
2018-07-24 17:06:09 -07:00
Nan Zhang
03b733c936 Use Metalava based android.jar for SDK
Define LOCAL_DROIDDOC_ANNOTATIONS_ZIP to export zip file.

Test: m out/target/common/obj/PACKAGING/metalava-api-stubs-docs_annotations.zip
Bug: b/78245848
Change-Id: I66ca2a50adc095cc8a8a1a10620427a91480a9bc
2018-07-24 11:16:56 -07:00
Nan Zhang
ec93cd9f2a Add private-stub-annotations.jar as core-java lib
Since currently android.jar compile against to it.

Test: m -j metalava_android_stubs_current
Bug: b/78245848
Change-Id: Id5812f69125085821182295e577849b5f2c4bead
2018-07-24 11:16:56 -07:00
Dan Willemsen
af42826aee Fix go vet issues
am: 59339a29e1

Change-Id: I6c5de64ee36c1dde4e043b36f84d2cf140afac41
2018-07-22 23:23:59 -07:00
Dan Willemsen
59339a29e1 Fix go vet issues
Test: go vet ./...
Change-Id: Ifb936ccc5e2b5a2c3fcbbbcb54f680e2973ea1b3
2018-07-22 21:18:45 -07:00
Sundong Ahn
bbc48703a7 Merge "Change classpath for droiddoc"
am: 279fc89abd

Change-Id: Ieb6840db5377d29db54647564ded3ba20c1b8893
2018-07-18 02:18:17 -07:00
Sundong Ahn
241cd3747c Change classpath for droiddoc
When the module type is SdkLibraryDependency, the classpath has been
gotten from headerJar
Becuase droiddoc uses src files when it builds, we should change to use
ImplementationJars instead of headerJar.

Bug: 77577799
Test: make -j

Change-Id: I1a072be69d7edff5636ea80af700be7796c3b0fc
2018-07-17 23:52:49 +00:00
Olivier Gaillard
aaacff9d9a Add a Generate_get_transaction_name flag.
am: 0a4cfbc21a

Change-Id: I99ce1491cb01948c7b6cd09fdfbd53fafb8a42fb
2018-07-17 04:01:22 -07:00
Olivier Gaillard
0a4cfbc21a Add a Generate_get_transaction_name flag.
Add a flag to be able to generate the Binder#getTransactionName method

Test: manual
Bug: 111200705

Change-Id: I3e8106261df5c63cdc005d07c9d8efcc6732db70
2018-07-17 09:00:45 +00:00
Dan Willemsen
80e43f1095 Add missing properties to android_test
am: f5531d2ed6

Change-Id: I3c6619a6c98e2431abbba0bfc5ef8e39eb97416d
2018-07-16 19:18:07 -07:00
Dan Willemsen
f5531d2ed6 Add missing properties to android_test
These are in the AndroidTest struct, and being exported by the AndroidMk
functions, but aren't in the list given to blueprint.

Test: add test_suites to an android_test, check Android-*.mk
Change-Id: I1e46638755cbb579f28ed14638baad43fde5cb96
2018-07-16 17:23:35 -07:00
Colin Cross
0907f39afd Merge changes I5b8522aa,I541aea75
am: cdec7e7ee1

Change-Id: Ib68f185498f593f0812f481b2c82753cd5956fa5
2018-07-16 17:20:20 -07:00
Colin Cross
20075eb84b Merge changes from topic "merge_zips_strip"
am: 6d6faa1a1f

Change-Id: I5f8d1c2aaff59a2af9156d71532fbe9da7181a4b
2018-07-16 17:19:09 -07:00
Colin Cross
cdec7e7ee1 Merge changes I5b8522aa,I541aea75
* changes:
  Fix lint errors caught by go test
  Fix .kotlin_builtins glob
2018-07-17 00:14:33 +00:00
Treehugger Robot
6d6faa1a1f Merge changes from topic "merge_zips_strip"
* changes:
  Make merge_zips -stripFile use blueprint style globs
  Add tests for merge_zips
2018-07-17 00:09:58 +00:00
Colin Cross
4c03f68763 Make merge_zips -stripFile use blueprint style globs
merge_zips -stripFile was only considering the name of the file and
ignoring the path.  Make it more useful by supporting blueprint style
globs.  The previous behavior can be recreated by prefixing with **/.

Bug: 111389216
Test: m checkbuild
Change-Id: I25760fe3f1f77704dd9da9d107d9a38a415d681f
2018-07-16 15:24:43 -07:00
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