Commit graph

718 commits

Author SHA1 Message Date
Nan Zhang
71bbe63526 Add jdiff support for Soong
Test: api-stubs-docs-diff
Bug: b/78245848
Change-Id: I069f6f8b1f9aa74ae1425cd5b792643d05b26820
2018-09-18 14:07:30 -07:00
Brandon Lee
5d45c6f6f8 Collect modules' info to create IDE project file.
- Register a singleton and implement GenerateBuildActions func in java/jdeps.go.
- Declare a interface and a struct to collect info in android/module.go.
- Implement IDEInfo for Library & Import module in java/jdeps.go.
- Implement IDEInfo for Genrule module in genrule/genrule.go.
- Implement IDEInfo for fileGroup module in android/filegroup.go.
- Test codes for jdeps.go in java/jdeps_test.go.

Bug: 111044346

Test: export SOONG_COLLECT_JAVA_DEPS=1;mmm packages/apps/Settings
      out/soong/module_bp_java_deps.json will be generated

Change-Id: If61da77b4d7614c2c5da438b6af4c725ceccc5c3
2018-09-18 17:44:10 +00:00
Colin Cross
cfbea98a57 Merge "Allow instrumenting android_test modules." 2018-09-18 17:22:22 +00:00
Søren Gjesse
49c1cb35f3 Merge "Don't include data resources when running R8" 2018-09-18 06:22:21 +00:00
Colin Cross
5067db9d02 Allow instrumenting android_test modules.
android_test modules should have Instrument = true like android_app
modules so that they get instrumented when EMMA_INSTRUMENT=true.

Bug: 115929955
Test: m EMMA_INSTRUMENT=true
Change-Id: I2c0e8ab95d2cdc47fc28af9c7264ab544d0e7a28
2018-09-17 16:46:35 -07:00
Sundong Ahn
4fd04bb506 Change the dist file path for sdk library
The dist file path is changed from apistubs/{api_scope}/*.jar to
apistubs/{owner}/{api_scope}/*.jar. it makes easy to get stub files
when updating prebuilts/sdk by making it possible to distinguish
between Android libraries and Google libraries.
And Onwer() function is added to ModuleBase for getting onwer info.

Test: make -j40 PRODUCT-sdk_phone_armv7-sdk dist sdk_repo
Change-Id: I50069aff6664901e6c9129d69643a414ee5e41d0
2018-09-17 09:43:30 +00:00
Søren Gjesse
24f1702872 Don't include data resources when running R8
The change https://r8-review.googlesource.com/c/r8/+/26482 made R8
process data resources by default. This is not expected for the
Android Platform build

Test: m -j PRODUCT-aosp_x86-userdebug core-oj
Change-Id: Idb17e39dae524dacf4b258c9f27be86e3179667f
2018-09-14 15:20:42 +02:00
Colin Cross
ec06db2709 Merge changes from topic "hostdex"
* changes:
  Allow exclude_java_resources to affect java_resource_dirs
  Allow '$' in some paths
2018-09-13 22:49:21 +00:00
Colin Cross
cedd4768f5 Allow exclude_java_resources to affect java_resource_dirs
Allow excluding files from directory globbed by java_resource_dirs.

Test: java_test.go
Change-Id: I9922842248be1a386ab111a5187608438638ffb1
2018-09-13 18:28:03 +00:00
Colin Cross
fe4bc36f87 Allow '$' in some paths
The icu resource directories contain filenames that have '$'
characters.

Allow paths returned by the Glob functions to contain '$', on the
assumption that real paths on disk are unlikely to contain strings
that are valid ninja variables.  Fix the Build rules to escape any
paths that are passed as Path arguments.  Fix the resource rules to
manually escape the paths that are passed as strings.

Test: m checkbuild
Change-Id: Ie631bc6d96259e592adb280491a365c0df7ed0e2
2018-09-13 18:27:50 +00:00
Nan Zhang
9c69a126d5 Add Api level annotations support for Metalava.
Test: m -j docs with Api level annotations enabled.
Bug: b/78245848

Change-Id: Ife93899cdcf5b54ee0c75003c295aa4b917d3dba
2018-09-12 16:32:01 -07:00
Nan Zhang
c747535cc2 Merge "Split doclava run from metalava target." 2018-09-12 18:15:11 +00:00
Neil Fuller
3c979c3348 Add a new sdk_version "core_platform_current"
Add a new sdk_version "core_platform_current"
value to java_library.

This adds the ability to compile system code against the
core platform API stubs. These stubs will contain the public SDK
API _and_ a selection of extra methods just intended
for use by system code (e.g. framework .jar) and
which must be preserved if "core" is modularized to
retain source and binary compatibility. Methods
outside of the core platform API must not be relied upon.

Future changes will adding methods to the core platform API and
switch targets over to use the stubs.

As soon as feasible, (hopefully) the default for when
unspecified will be changed to be the same as specifying
core_platform_current and build rules will have to explicitly
specify when they want to compile against the core library
implementation directly.

Bug: 113148576
Test: mmm libcore/mmodules/core_platform_api_client_demo
Change-Id: I72a03f28a4c38b4232e513a088c2d4e962c98868
2018-09-12 07:29:26 +00:00
Nan Zhang
1598a9e099 Split doclava run from metalava target.
Originally when metalava sees arg: "--generate-documentation", it will
create a seperate process to invoke javadoc/dokka.

Now this is handled by our build system. Basically metalava target will
only generate a .srcjar file. Any other droiddoc target which generates
docs can depend on this metalava target.

By doing this, if multiple doc targets depending on the same metalava
sources. The metalava won't need to be re-run by multiple times which
could cause quite some timing overhead.

Test: m clean && m -j core-docs and
compare the results using md5sum between the old and new content.
also m clean && m -j core-current-stubs-gen-docs and
compare the results using md5sum  between the old and new content.
Bug: b/78245848

Change-Id: If7deef0da738645efe7d3a8376ff2bb3dec92c01
2018-09-11 15:41:50 -07:00
Treehugger Robot
bc21394679 Merge "Enable Java 9 language support through java_version: "1.9" alone." 2018-09-11 21:40:55 +00:00
Tobias Thierer
06dd04f20e Enable Java 9 language support through java_version: "1.9" alone.
Some logic in java.go was conditional on TargetOpenJDK9(), which in
turn relies on a global build flag (EXPERIMENTAL_USE_OPENJDK9=true).
This CL changes the logic in collectBuilderFlags() to check for
javaVersion greater or equal "1.9" instead, which is true when either
EXPERIMENTAL_USE_OPENJDK9=true (global) or javaVersion "1.9" (a
per-build target attribute).

Because the value of flags.javaVersion isn't available there,
TargetOpenJDK9()-dependent logic in Module.deps() was changed to
be unconditional; as far as I understand, this means that system
modules deps will be built regardless of whether they're needed
later in the build. This will probably slow down the build
unnecessarily until the first user of these system modules appears
(expected soon), but probably not by much.

There is some TargetOpenJDK9() related logic remaining in droiddoc.go,
but this doesn't seem to break the build of Java 9 language sources
and is probably no longer needed now that metalava is used for
generating the stubs (thanks to Nan!), and those do not contain any
Java 9 language features.

Bug: 112443425
Test: Checked that Java 9 language support works on AOSP after
      this CL without a need for EXPERIMENTAL_USE_OPENJDK9=true,
      ie. after also patching CL http://r.android.com/646840 ,
      "make docs droid cts" completes, the device boots and
      Java9LanguageFeaturesTest passes.

Change-Id: I393b97a7b3bb4c1c3d06580c639e94ff6cf916ff
2018-09-11 19:54:28 +01:00
Colin Cross
7b59e7b2d0 Make manifest_fixer.py keep targetSdkVersion high with min_sdk_version
targetSdkVersion should stay as "current" when min_sdk_version
is set but sdk_version is not.

Bug: 112438448
Test: atest CtsTelecomTestCases
Change-Id: I11dc27eccd31200d1ce27c7e332106bb825651b4
2018-09-10 14:41:56 -07:00
Colin Cross
0f40a7527a Move kotlinc-build.xml out of classes directory
kotlinc-build.xml was ending up in the final jar because it was
being created in the directory where the classes were written.
Rename the variable containing the classes directory from outDir
to classesDir to discourage putting other files in there, and
move kotlinc-build.xml up a directory.

Bug: 114524493
Test: m checkbuild
Change-Id: Id2e2af0a6543499bd25b8fbd642bc59b14bd241f
2018-09-08 21:07:30 +00:00
Mathew Inwood
ebe29ce4c6 Adapt special case framework support.
I'm adding a annotation processor to the framework target that does not
run as part of the main build, but only for a parallel build target
framework-annotation-proc, which is identical to framework except that it
also runs an annotation processor. Update build rules to be aware of this
target so that it builds successfully.

Test: m framework-annotation-proc
Bug: 113853502

Change-Id: I8b20758dc8bd0e8cb2542414d7a45a2cd7d2e158
2018-09-04 14:57:44 +01:00
Colin Cross
42d48b7b8b Enforce dependencies have right architecture
ctx.AddDependency will succeed if the named dependency only has a
single variant, even if that variant is the wrong architecture.
Use ctx.AddVariationDependency(nil, ...) instead, which requires
that all variations of the calling module match the dependency.

Bug: 112707915
Test: no change to out/soong/build.ninja
Test: using a device dependency in a host java module is an error
Change-Id: I70b661a57d4412eb63b8c9841febfb756e9e025d
2018-08-30 16:31:02 +00:00
Nan Zhang
b69575b1f6 Merge "Add jetifier support in Soong." 2018-08-30 15:28:46 +00:00
Colin Cross
86bc9d4622 gofmt -w .
Test: m checkbuild
Change-Id: Ia4aec5ddadf1f1b00f7c567522ca89fd839504f0
2018-08-29 15:37:15 -07:00
Treehugger Robot
97d5ed70a0 Merge "Fix manifest merging flags" 2018-08-29 21:04:35 +00:00
Nan Zhang
4c819fb590 Add jetifier support in Soong.
This is a blocker for droiddoc targets migration under vendor/.

Test: N/A
Bug: b/72552006
Change-Id: If85a0917c1ac0d88b9d5b488216a638b4dabd39f
2018-08-29 11:37:32 -07:00
Colin Cross
9b38aef182 Revert "Add support for renamed kotlin stdlib."
This reverts commit 66c0c4067f.

Bug: 112674805
Test: m checkbuild
Change-Id: I687888136b570f080b57af352af0130355acd216
2018-08-29 05:41:25 +00:00
Nan Zhang
aa43b94107 [java9] Add "--dex-api" option to Metalava.
This allow Metalava to generate public-dex file when user specify
dex_api_filename.

This blocks how we try java9 for droiddoc since "hiddenapi-lists-docs"
targets depends on libcore sources.

Test: m -j hiddenapi-lists-docs
Bug: b/78245848

Change-Id: Ic847c1123b14afb599dbf2a588885fd36e56b2cc
Merged-In: Ic847c1123b14afb599dbf2a588885fd36e56b2cc
2018-08-28 15:52:49 -07:00
Jason Monk
6f937a99e3 Fix manifest merging flags
library manifests were just being dropped on the ground.

Bug: 112467584
Test: build
Change-Id: I61c2efca37aa3fdb9c944260f4a276d1d3c26f6c
Merged-In: I61c2efca37aa3fdb9c944260f4a276d1d3c26f6c
(cherry picked from commit b7c147efec)
2018-08-28 14:10:03 -07:00
Neil Fuller
573864c015 Merge "Track changes to add core-simple to the boot cp" 2018-08-28 17:36:54 +00:00
Neil Fuller
6095259f5b Track changes to add core-simple to the boot cp
See the change in build/make for details.

Bug: 113148576
Test: make checkbuild / Treehugger
Change-Id: I6f7901642c6b907b1e8e9dd31ced3bf1ea6dfd4d
2018-08-28 13:16:19 +01:00
Treehugger Robot
4bd15d36e7 Merge "Put kotlin classes in header jar" 2018-08-27 21:16:21 +00:00
Colin Cross
55f63eadbd Put kotlin classes in header jar
If a module has kotlin sources the compiled kotlin clsases must be put
in the header jar for anything that depends on the module to use.

Bug: 113153312
Test: m checkbuild
Change-Id: Ibc44e9a97655937315b03b05e51e09c2954d7008
2018-08-27 13:19:49 -07:00
Søren Gjesse
0d91f1727e Merge "Ensure that the R8 minification map (ProGuard dictionary) file exists" 2018-08-27 16:06:07 +00:00
Søren Gjesse
0e84935ac4 Ensure that the R8 minification map (ProGuard dictionary) file exists
R8 no longer outputs an empty map file when minification
(obfuscation) is turned off.

Test: m -j PRODUCT-aosp_x86-eng
Change-Id: I317e703597368dc8c16751bcc8d0e43f985614fa
2018-08-27 12:56:16 +02:00
Nan Zhang
2760dfc03c Revert "Revert "Make Metalava checkapi a seperate run.""
This reverts commit ec716b4151.

Reason for revert:
This is second attempt for Make Metalava checkapi a seperate run.

The first attept didn't work since Metalava also need sources,
classpath, and etc, not like how old Doclava apicheck works.

Test: cherry-pick go/ag/4832335 in internal master, and do 'm clean && m
-j checkapi', it failed with erros which is expected.
Bug: b/113126618, b/113131828

Change-Id: I664b7838d15615905a2e798b1df832218031dfe7
2018-08-24 11:37:33 -07:00
Nan Zhang
ec716b4151 Revert "Make Metalava checkapi a seperate run."
This reverts commit ed0a39dba7.

Reason for revert:
it seems checkapi can be passed successfully even if we didn't do update-api for new changes. roll-back for now and do more investigation.  

Change-Id: Idd54ea8919671d54aa6401233156d6c0bcf5325f
2018-08-24 15:59:17 +00:00
Nan Zhang
ed0a39dba7 Make Metalava checkapi a seperate run.
We should not squeeze all the args to one Metalava run, especially for
checkapi.

Bug: b/113126618
Test: m -j checkapi, and check out dir api-stubs-docs.
Change-Id: I8d0c75745c7861b6de9070ef69f8e9284473a5d7
2018-08-23 17:30:38 -07:00
Nan Zhang
a05ff57f29 Support API compatibility check in Soong
Test: m -j api-stubs-docs
Bug: b/78245848
Change-Id: Id88a3e3716f9f07f0dc0071aa56a328c4712fcc9
2018-08-22 18:28:58 -07:00
Nan Zhang
66dc236781 Add support for dumping proguard api file.
Test: ref go/ag/4783442
Bug: b/70351683
Change-Id: I0aedd41686535c9a662b935003b80634e56663e0
Merged-In: I0aedd41686535c9a662b935003b80634e56663e0
(cherry-picked from commit: 26c055258b)
2018-08-22 13:59:48 -07:00
Treehugger Robot
9af53b4795 Merge "Fix overlaying android resources from static libraries" 2018-08-22 00:52:46 +00:00
Colin Cross
4aaa84af86 Fix overlaying android resources from static libraries
Match the make logic for combining app resources with static library
resources.

Bug: 112822358
Test: app_test.go
Test: aapt2 dump resources $OUT/system/priv-app/SystemUIGoogle/SystemUIGoogle.apk | grep -A1 ' string/config_systemUIVendorServiceComponent'
Change-Id: I565404e7ffb726dab952c72ab23600d6f2ee4ad4
2018-08-21 15:53:46 -07:00
Nan Zhang
443fa525df Hardcode "-source 1.8" for Doclava.
Due to various bugs hidden deeply within Doclava, running with
 "-source 1.9" is always failed for it.

So switch to "-source 1.8" for now. This includes the case of running the
combination of Metalava + Doclava. Once we have new documentation tool
in system, we can full deprecate Doclava.

Test: USE_R8=true EXPERIMENTAL_USE_OPENJDK9=true m -j core-docs
Bug: b/70351683
Change-Id: I9553f88d0dd9bc263a249c49075c0b931b5d4927
2018-08-21 11:19:53 -07:00
Treehugger Robot
06e36c737f Merge "Fix using defaults in android_app and android_test modules" 2018-08-20 22:21:32 +00:00
Colin Cross
b98c0f4c7d Fix using defaults in android_app and android_test modules
android_app and android_test modules weren't getting
InitDefaultableModule called on them.  Call InitJavaModule
which does both InitAndroidArchModule and InitDefaultableModule.

Test: m checkbuild
Change-Id: I26f3c04ea8bdfcacb59dcdbc63d6db5604c2598a
2018-08-20 13:45:45 -07:00
Nan Zhang
d05a436e8b Append previous_api to "--migrate-nullness" option
"--previous-api" option was not recommended after Metalava was
changed on how to consume the api file args.

Test: m -j api-stubs-docs
Bug: b/78245848
Change-Id: I1054173e11b4d47942dda0b95193277758aa8193
2018-08-20 13:28:41 -07:00
Nan Zhang
55e0bf4231 Add update-api support for Metalava
Test: m -j api-stubs-docs-update-current-api
Bug: b/112668343
Change-Id: Ia91ae6969b01c21d88de7ceef4b25a73d0efd4a1
2018-08-17 12:38:15 -07:00
Nan Zhang
863f05b797 Removed Metalava related checks
Test: m -j checkbuild
Bug: b/70351683 b/78245848
Change-Id: Ie26e95081d8d90b626cfb43d017cb2ae500b7b25
Merged-In: Ie26e95081d8d90b626cfb43d017cb2ae500b7b25
2018-08-17 09:17:49 -07:00
Colin Cross
331a1213b0 Don't pass resources to r8
R8 complains when it gets dex files in the input jar, but some tests
use dex files or dex jars as resources.  Keep resources separate
from classes until after r8 has been run.

Test: java_test.go
Test: m checkbuild
Change-Id: I1d9164d60d6b054ebb138648da07d80ee769177f
2018-08-16 17:03:56 -07:00
Colin Cross
8144008360 Support patch_module in java modules
A few tests that have classes in the java.base module need to pass
--patch-module=java.base=<classpath> to javac.

Test: m checkbuild
Change-Id: I246bad92dcde976969b064aace5e2856e2bac971
2018-08-16 16:14:09 -07:00
Colin Cross
3063b78ea5 Make :module provide the output file for java modules
Make :module on a java_library provide the output file, which is
normally the implementation jar.  For java_library modules with
installable: true or compile_dex: true this will be the dexjar
instead.  For android_app modules this will be the apk.

Bug: 80144045
Test: no change to out/soong/build.ninja
Change-Id: I739674aee60a38bfccb859369e4414b46f293d82
2018-08-16 16:13:58 -07:00
Colin Cross
b628ea5327 Don't link java tests against junit by default
There is more variety of java tests than I expected, don't
default to including junit, that's just going to lead to
unexpected junit classes for module authors that don't know
to set junit: false.  All existing uses of java_test are
already not using junit or setting static_libs: ["junit"],
and all test in Make are already specifying junit.

Bug: 70770641
Test: m checkbuild
Change-Id: I4393b70d87dd2b6e3bb719fdb758915053bee0c7
2018-08-15 11:08:59 -07:00
Colin Cross
d96ca35779 Support data properties in java_test and android_test
Files in the data property will be passed to
LOCAL_COMPATIBILITY_SUPPORT_FILES in Make.

Test: m checkbuild
Change-Id: Ifc074317f957aba8f55daa30abc5b9737d1eceac
2018-08-14 15:44:39 -07:00
Colin Cross
303e21f695 Move autogenerated test config into Soong
Move autogenerating the test config for Soong modules into Soong
for java_test and android_test modules.

Bug: 70770641
Test: m checkbuild
Test: atest CtsUiRenderingTestCases
Change-Id: I02593add0407ef694b91c14cf27411a4f3cc4745
2018-08-14 15:44:08 -07:00
Colin Cross
bd1cef5618 Add proguard_flags_files to r8 command line
We were not passing the proguard_flags_files files as -include
arguments to R8.

Bug: 112462307
Test: m checkbuild
Change-Id: I8f3b10fc338aa4b15c0fb220ee2891efbb0b020f
2018-08-13 17:29:58 +00:00
Treehugger Robot
815ef453df Merge "Support Dokka in Soong." 2018-08-11 00:10:16 +00:00
Nan Zhang
4973ecff89 Enable prebuilt jar installation in framework
Test: m -j dokka
Bug: 72394196
Change-Id: Ide09dc2fe64ea5db0d771e16d4b9293638b5d65c
2018-08-10 13:42:12 -07:00
Nan Zhang
86d2d55ade Support Dokka in Soong.
Metalava is supposed to treat all the args after
"--generate-documentation" as either Javadoc or Dokka commands, and it starts
 seperate process to invoke javadoc or java -jar dokka...

Dokka doesn't support --bootclasspath in its args, so treat all the
bootclasspath as classpath.

Also continue to refactor code to seperate Dokka runs from Javadoc or
Metalava.

Test: m -j metalava-dokka-core-docs
Bug: b/72394196
Change-Id: I0f0f3dd80cb2dbb53f19da8fa11ae0b1d92ac5d7
2018-08-10 13:37:24 -07:00
Treehugger Robot
1a1f7f24ab Merge "Remove additional 'docs' Dir when genearate Soong droiddoc" 2018-08-10 20:03:25 +00:00
Jason Monk
d4122be915 Support overrides for android_app
Test: use it
Change-Id: I61b933b757081f08a417e66a8c02d62916bd3f8b
2018-08-10 09:52:36 -04:00
Nan Zhang
de860a4c1c Remove additional 'docs' Dir when genearate Soong droiddoc
Test: m -j core-docs
Bug: b/70351683
Change-Id: Icb0b096e24ee8e498532ca32c9e9e74c2803191d
2018-08-09 15:53:33 -07:00
Colin Cross
5fa9d6f445 Use soong_droiddoc_prebuilt.mk
Soong droiddoc modules were using soong_java_prebuilt.mk, but they
don't need any of the java logic from it, and it includes
base_rules.mk which was not included by droiddoc.mk.  Use
soong_droiddoc_prebuilt.mk that just installs the droiddoc
outputs without including base_rules.mk.

Fixes building docs modules in mm, mma, and m checkbuild.

Bug: 112388925
Test: m docs
Change-Id: I8ccbcd34adf268a830ee1a203270b955ea696701
2018-08-08 21:48:39 -07:00
Julien Desprez
e146e39fa6 Support 'test_config' into soong modules
Test: make general-tests
Bug: 110982517
Change-Id: Ib2eab2653fdfce6f699b85c9fbc64558b6d40363
2018-08-07 15:51:21 -07:00
Xin Li
6bfe4eb42c Merge Android Pie into master
Bug: 112104996
Change-Id: I160274b2c2bbe8219ed9a3b5d39c3935bfcb13f0
2018-08-06 17:23:26 -07:00
Nan Zhang
77a69ecb70 Use config.DefaultLibraries for droiddoc
Test: m -j ds-static-docs
Bug: b/70351683
Change-Id: I867fb12004e0b6e1bc22f455585386109f0df2d1
2018-08-06 16:58:34 -07:00
Nan Zhang
816aa9da76 Merge "Fix the issue that changing merge_annotations_dir doesn't trigger build" 2018-08-06 23:43:17 +00:00
Sundong Ahn
7481ee6e6d Merge "Add new properties"
am: dec899b21b

Change-Id: Icb7805535bf79a52ad0ae2603ed25367e8ba56ea
2018-08-06 16:17:07 -07:00
Treehugger Robot
dec899b21b Merge "Add new properties" 2018-08-06 22:53:57 +00:00
Nan Zhang
1327895d52 Merge "Refactor java/droiddoc.go in Soong."
am: d2e1b6a8e8

Change-Id: I23328d00521778264ffe9a1ff5f9a8295a3a74e6
2018-08-06 13:11:37 -07:00
Nan Zhang
f4936b02b2 Fix the issue that changing merge_annotations_dir doesn't trigger build
We don't have API exported to glob any dir outside of current module.
Any files deps outside of current module should be either a
filegroup/filegroup or a customized module.

We already have similar customized module to track droiddoc-template, so
rename it to be more generic so that it can be used by
merge_annotations_dir also.

Bug: b/111916275, b/70351683
Test: touch manual/android/support/design/widget/annotations.xml, and m
-j metalava-api-stubs-docs, and check the built output srcjar.

Change-Id: I75420ddba69785e46bea75b6dd3f189be7cfe5ad
2018-08-01 15:08:39 -07:00
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