Commit graph

589 commits

Author SHA1 Message Date
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
Colin Cross
25f6677370 Merge "Use proptools.BoolDefault" am: ed1268268d
am: 72510f2a27

Change-Id: I9c7901cdf5a24a48edac64ba3a4b8e047d4ba81a
2018-04-10 21:55:44 -07:00
Colin Cross
ed1268268d Merge "Use proptools.BoolDefault" 2018-04-11 04:38:31 +00:00
Dan Willemsen
0de9c08e03 Expose ProductVariables from TestConfig am: 674dc7f7f0
am: e4436b5ab2

Change-Id: Iafcdea1220e6bd7c4ced667e585e439792acf572
2018-04-10 18:58:15 -07:00
Dan Willemsen
ce4f5b0ae7 Use Config/DeviceConfig functions to access ProductVariables am: 3fb1faeeb9
am: 906a608451

Change-Id: I67b75f04bd377fe2eb4865d9ad6397167c65bbef
2018-04-10 18:58:10 -07:00
Dan Willemsen
674dc7f7f0 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
2018-04-11 01:45:22 +00:00
Dan Willemsen
3fb1faeeb9 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
2018-04-11 01:45:14 +00:00
Colin Cross
38b40dffd6 Use proptools.BoolDefault
Replace x == nil || *x with proptools.BoolDefault(x, true)

Test: m checkbuild
Change-Id: Icc5378cab3ea72d86544b40761c2f00b278cc0a1
2018-04-10 16:26:10 -07:00
Colin Cross
0f9be9a4f5 Merge "Add java_test and java_test_host" am: 47f98af97f
am: 6c2f92bab6

Change-Id: Id284ec9287b264c37ffbf5346900a22693dd57d5
2018-04-10 16:08:59 -07:00
Colin Cross
a7c8f5a4e0 Allow wildcards in java_resource_dirs am: 0ead1d75ce
am: 79dbe712d7

Change-Id: I8f5c89b6339ed9a1253b30f6e1883cb3208ab2a0
2018-04-10 16:03:55 -07:00
Treehugger Robot
47f98af97f Merge "Add java_test and java_test_host" 2018-04-10 22:53:30 +00:00
Colin Cross
0ead1d75ce Allow wildcards in java_resource_dirs
Expand java_resource_dirs using ctx.Glob before globbing inside it
in case it has wildcards in it.  Fixes:
internal error: panic in GenerateBuildActions for module "icu4j" variant "linux_glibc_common"
path "external/icu/icu4j/main/classes/charset/src/META-INF" does not start with "external/icu/icu4j/main/classes/*/src"

Test: java_test.go
Change-Id: Icd28b7a3dd14752642fb0ec8d41bbd6e30f81a68
2018-04-10 20:12:47 +00:00
Colin Cross
05638fc76f Add java_test and java_test_host
java_test is equivalent to a java_library with a default junit
dependency and marked as a test in Make for installation and
automatic AndroidTest.xml generation.

Bug: 70770641
Test: m checkbuild
Change-Id: I9ca97521e952d121db46abff6f24f274dd7a3ad7
2018-04-10 20:12:38 +00:00
Colin Cross
17eddb6cc8 Use built SDK stubs am: f19b9bb981
am: cf3a11aa94

Change-Id: Ic6db9dd0a5d641cb9572aeda7526b9b31459c027
2018-04-10 12:23:06 -07:00
Colin Cross
f19b9bb981 Use built SDK stubs
Now that the SDK stubs are built in Soong, undo the hack that
uses the prebuilt stubs.

Fix the linktype checks to treat the various stubs libraries as
the correct type, since they can't be annotated with sdk_version.

Bug: 70351683
Bug: 77285514
Test: m checkbuild
Change-Id: I5e870c34dd0ebc8ae3f888ec627da590c846a76f
2018-04-10 17:06:21 +00:00
Colin Cross
3bd9e3d753 Remove deviceProperties from BinaryHostFactory am: 559795114d
am: bb6528c368

Change-Id: Ic0e0746c7c005ab8456cfe196b7a731b7eb1ecba
2018-04-10 10:01:47 -07:00
Colin Cross
559795114d Remove deviceProperties from BinaryHostFactory
java_binary_host should not include the device-only properties.

Test: m checkbuild
Change-Id: Ief6b0a0e98310f7a4f3684c4632f618d73f10bdd
2018-04-10 14:43:59 +00:00
Jiyong Park
d13fe6aaff Link type check for Android.bp defined Java modules am: 2d4929464b
am: fe68fe47cf

Change-Id: Ie3ceb7140f91e7edc5053d132204de88a3f61b46
2018-03-29 22:06:02 +00:00
Jiyong Park
2d4929464b Link type check for Android.bp defined Java modules
Link-type is also checked among Java modules defined in Soong. Until
now, the check has been done in between Soong/Make and Make/Make.

With this, a Java module can't depend on another Java module built with
larger API surface. For example, a java library built with Android SDK
(sdk_version: "current") can't link to a library built without SDK.

Bug: 73829976
Test: m -j

Change-Id: I64277be6e65e8535aad951b4f08f8d10b67abe66
Merged-In: I64277be6e65e8535aad951b4f08f8d10b67abe66
(cherry picked from commit f3586661e8)
2018-03-28 16:20:15 -07:00
Martijn Coenen
4ed6f97d8f Merge "Add trace flag for cpp/Java AIDL generation." into pi-dev 2018-03-28 06:53:35 +00:00
Tobias Thierer
aa592d69e7 Merge "javadoc/droidoc: Don't add .jar files to sourcepath." am: ddd0a41379
am: db2434a262

Change-Id: I81b02b4fb65dc94137bd443381c977afda8c79ad
2018-03-27 10:13:59 +00:00
Tobias Thierer
ddd0a41379 Merge "javadoc/droidoc: Don't add .jar files to sourcepath." 2018-03-27 09:54:13 +00:00
Martijn Coenen
22071ca4b4 Add trace flag for cpp/Java AIDL generation.
The AIDL code generator can now include trace code in every generated
AIDL call. We don't want to enable this by default for all interfaces
for two reasons:
1) Potential performance overhead
2) For Java targets, the code depends on @hide APIs in android.os.Trace,
   and I haven't found a clean way to determine whether a target is
   allowed to use @hide stuff in the SDK. LOCAL_PRIVATE_PLATFORM_APIS
   is almost it, but it's not set for the core framework (which is
   exactly one of the things we'd like to trace).

Bug: 74416314
Test: verify correct code is generated when flag is set
Change-Id: Ic6ab8aee3e708207813da3e803911a844ff3e52b
Merged-In: Ic6ab8aee3e708207813da3e803911a844ff3e52b
2018-03-27 07:22:55 +00:00
Tobias Thierer
c9e360ac8a javadoc/droidoc: Don't add .jar files to sourcepath.
javadoc expects directories on the sourcepath, not jar files.
The original commit 88b607994a148f4af5bffee163e39ce8296750c6
in 2009 was already passing the jar files, and every revision
since then seems to have kept this habit through cargo cult.

This CL removes the superfluous jar file arguments from the
sourcepath argument to javadoc.

Test: Treehugger
Bug: 76436487

Change-Id: I3a8503ae089cd6657a698c0552dc194156311849
2018-03-27 00:33:05 +01:00
Martijn Coenen
10224739d4 Add trace flag for cpp/Java AIDL generation. am: eab15645fe
am: 85a70e8369

Change-Id: Ie2bea1ee84ce4a773cefea3548d27796e5cf2115
2018-03-26 22:58:09 +00:00
Martijn Coenen
eab15645fe Add trace flag for cpp/Java AIDL generation.
The AIDL code generator can now include trace code in every generated
AIDL call. We don't want to enable this by default for all interfaces
for two reasons:
1) Potential performance overhead
2) For Java targets, the code depends on @hide APIs in android.os.Trace,
   and I haven't found a clean way to determine whether a target is
   allowed to use @hide stuff in the SDK. LOCAL_PRIVATE_PLATFORM_APIS
   is almost it, but it's not set for the core framework (which is
   exactly one of the things we'd like to trace).

Bug: 74416314
Test: verify correct code is generated when flag is set
Change-Id: Ic6ab8aee3e708207813da3e803911a844ff3e52b
Merged-In: Ic6ab8aee3e708207813da3e803911a844ff3e52b
2018-03-26 09:59:02 +02:00
Jiyong Park
4d71601d40 Handle prebuiltDepTag for java modules am: 924d35b926
am: 14e1557f03

Change-Id: I8a441c40f35fd16d8dd225bf59f4a82f41e866e2
2018-03-24 07:48:44 +00:00
Jiyong Park
924d35b926 Handle prebuiltDepTag for java modules
When there is a prebuilt java lib defined and there is a java library
with the same name, the reverse dependency from the java lib to the
prebuilt lib is added. However, the java library didn't recognize the
dependency type and causes error. Fixing the problem by not panicking on
such dependency.

Test: m -j
Test: m -j dist DIST_DIR=out/dist ANDROID_BUILDSPEC=vendor/google/build/app_build_spec.mk
Merged-In: I79673b2bb382100e42c5336e8041daa8c86fa857
Change-Id: I79673b2bb382100e42c5336e8041daa8c86fa857
(cherry picked from commit 46dbf9c63e)
2018-03-24 15:12:37 +09:00
Dan Willemsen
b785b61621 Allow proto properties in cc/java_defaults
(cherry picked from commit 6424d17a2d)

Bug: 73175642
Test: Add proto.canonical_path_from_root: true in a cc_defaults
Test: Add proto.canonical_path_from_root: true in a java_defaults
Merged-In: I9ddfc8af0025705a34b6e487225f1f98915054c3
Change-Id: I9ddfc8af0025705a34b6e487225f1f98915054c3
2018-03-22 20:51:04 -07:00
Logan Chien
7921d2d265 Merge changes I406c5bef,Ibde685d7,I1c09412d,I9bec563c,I34f06abd into pi-dev
* changes:
  Allow VNDK extensions under vendor or device
  Add unit tests for android/neverallow.go
  Extract failIfErrored() to android/testing.go
  RemoveFromList() should remove all matches
  Add unit tests for android/util.go
2018-03-22 07:36:51 +00:00