Adds support for Java 8 using Desugar. Android Studio 3.0 is required
for Desugar. enforceUniquePackageName is no longer needed by the new
gradle version. This feature is behind "--canary" flag for now.
Bug: webrtc:8084, chromium:730711
Change-Id: Iba24880fef303aa627307356f2e26b78e153a960
Reviewed-on: https://chromium-review.googlesource.com/609066
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Sami Kalliomäki <sakal@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#493418}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8f75411b306ddbb870d85c39dc03024b7bd5ec74
Merge all resource dependency manifests using the manifest merger from the
Android SDK, providing the functionality described in
https://developer.android.com/studio/build/manifest-merge.html.
Removing the nontrivial manifest guard in the android_aar_prebuilt() template
will be done in a follow-up change, as well as removing pre-merged manifest
tags, such as "com.google.android.gms.version" meta-data.
Bug: 643967
Change-Id: Ifdf9f3f76f5c80f1a2326dcd47045d032556936f
Reviewed-on: https://chromium-review.googlesource.com/558296
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Cr-Original-Commit-Position: refs/heads/master@{#485303}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f3efbd5b8ec69ef49dbdbf8945f546815039efe3
Reverted in: Ibbb98c136baaf016a9b26b3e614ca96e8a408c41
Reason for reland: Selective JNI registration is fixed by:
If97814bc5d79cfaa0211e46f785dbab329429d22
There is no change on this CL since reverted.
TBR=sky@chromium.org,yfriedman@chromium.org,phajdan.jr@chromium.org,mef@chromium.org,torne@chromium.org,sergeyu@chromium.org,agrieve@chromium.org,halliwell@chromium.org,joedow@chromium.org,estevenson@chromium.org,jbudorick@chromium.org,yipengw@chromium.org
Bug: 683256
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester
Change-Id: Ibdb983b4ba07cf7e2b23a4c1706213175acfa7bf
Reviewed-on: https://chromium-review.googlesource.com/553157
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Yipeng Wang <yipengw@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#483150}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5510546e55d45b802b20c9b67a7f2de010602e47
This reverts commit be11db405efa4b6ce9117877a34abf3bfea911ff.
Reason for revert: breaks VR bot: https://build.chromium.org/p/chromium.fyi/builders/Android%20VR%20Tests/builds/8763
Original change's description:
> Android JNI: Generate calls to RegisterNatives()
>
> Generate registration functions with unique names(package+class). Create a new template to
> generate a header file which calls all registration functions together.
>
> This CL also switches the test targets from using explicit JNI registration (via RegisterNatives()),
> to using implicit JNI registration (just export the symbols and let dalvik look them up lazily).
>
> This switch simplifies things a great deal, as the only reason for using explicit registration is
> to work around a deficiency in the crazy linker, which most test targets don't use.
>
> Design doc: https://docs.google.com/document/d/1pYnceZMuxhpU9u3OAzWLYInV_nqtHKsBFROp927FDXM/edit?usp=sharing
>
> Bug: 683256
> Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester
> Change-Id: I31cbfe393c9088233f65f1249285d48ac5571f45
> Reviewed-on: https://chromium-review.googlesource.com/527683
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Misha Efimov <mef@chromium.org>
> Reviewed-by: Luke Halliwell <halliwell@chromium.org>
> Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
> Reviewed-by: Joe Downing <joedow@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: John Budorick <jbudorick@chromium.org>
> Reviewed-by: Richard Coles <torne@chromium.org>
> Commit-Queue: Yipeng Wang <yipengw@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#482615}
TBR=sky@chromium.org,yfriedman@chromium.org,phajdan.jr@chromium.org,mef@chromium.org,torne@chromium.org,sergeyu@chromium.org,agrieve@chromium.org,halliwell@chromium.org,joedow@chromium.org,estevenson@chromium.org,jbudorick@chromium.org,yipengw@chromium.org
Change-Id: Ibbb98c136baaf016a9b26b3e614ca96e8a408c41
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 683256
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester
Reviewed-on: https://chromium-review.googlesource.com/550576
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: Eric Stevenson <estevenson@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#482656}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 09f1b8ec88d4a63d64948213b4dc0b6179f18bbe
Generate registration functions with unique names(package+class). Create a new template to
generate a header file which calls all registration functions together.
This CL also switches the test targets from using explicit JNI registration (via RegisterNatives()),
to using implicit JNI registration (just export the symbols and let dalvik look them up lazily).
This switch simplifies things a great deal, as the only reason for using explicit registration is
to work around a deficiency in the crazy linker, which most test targets don't use.
Design doc: https://docs.google.com/document/d/1pYnceZMuxhpU9u3OAzWLYInV_nqtHKsBFROp927FDXM/edit?usp=sharing
Bug: 683256
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester
Change-Id: I31cbfe393c9088233f65f1249285d48ac5571f45
Reviewed-on: https://chromium-review.googlesource.com/527683
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Misha Efimov <mef@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Joe Downing <joedow@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Yipeng Wang <yipengw@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#482615}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: be11db405efa4b6ce9117877a34abf3bfea911ff
Was missing, hence meaning that its source files were unknown to
Android Studio.
Change-Id: I902cc5b6b1437a03a5fed5198d074e7965494879
Reviewed-on: https://chromium-review.googlesource.com/548598
Reviewed-by: Peter Wen <wnwen@chromium.org>
Commit-Queue: Anthony Berent <aberent@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#482287}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 983cd1cfe6903095f4a0855b18d65ee4ee5db7ac
Resources were not collected for the pseudo all module before. Adding it
back, but skipping the generated resources folders.
BUG=722302
Review-Url: https://codereview.chromium.org/2888923002
Cr-Original-Commit-Position: refs/heads/master@{#472485}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dc177240b50784d9fe81d654e129275028e6d97f
Bugs causing split-project and use-gradle-resources to not work
correctly. Also fix the jinja template.
BUG=620034
Review-Url: https://codereview.chromium.org/2858233002
Cr-Original-Commit-Position: refs/heads/master@{#469372}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f011a78f3f93e0f52b89b29a4b40b2e2f879733c
It is no longer necessary to list all the apk targets as separate
modules now that we have the _all pseudo module. Having the separate
modules resulted in bugs where Android Studio could not distinguish
between prod code and test code since some modules viewed dirs as prod
and some as test. The --split-projects flag can be used to see the
dependency graph, and when only a single module will be generated, the
_all pseudo module will not replace it.
For android studio's _all pseudo module, move all known test dirs to
androidTest instead of main so that they are properly displayed when
filtered.
BUG=620034
Review-Url: https://codereview.chromium.org/2837863002
Cr-Original-Commit-Position: refs/heads/master@{#467704}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e851ad470036997a9a43b0ee2710442f1b5c2096
Adding all sources to a "_all" pseudo module fixes Studio's code analysis
functions (imports, refactoring).
In order to have things build properly in gradle, the "_all" module has
all sources excluded (gradle applies the filters, studio does not).
Also fix "--all" targets to include tests. Make it easier to make sweeping
java refactors in Android Studio.
BUG=620034
Review-Url: https://codereview.chromium.org/2812133003
Cr-Original-Commit-Position: refs/heads/master@{#465700}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 03427bcc41560b36b5c595eda92e35f563a6303e
Reason for revert:
Breaks code editing in Android Studio, see http://crbug/700438 for more info.
Original issue's description:
> Android: Support Android Studio 2.3
>
> Also fixes excludes filters not working. For files whose directory is
> not fully included in the target, add those individually instead.
>
> BUG=700438
>
> Review-Url: https://codereview.chromium.org/2746103004
> Cr-Commit-Position: refs/heads/master@{#457093}
> Committed: f9fca7ca02TBR=wnwen@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=700438
Review-Url: https://codereview.chromium.org/2758683003
Cr-Original-Commit-Position: refs/heads/master@{#457866}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 136f215ed31f9e748b388b5e79bf0e4888f62acc
Also fixes excludes filters not working. For files whose directory is
not fully included in the target, add those individually instead.
BUG=700438
Review-Url: https://codereview.chromium.org/2746103004
Cr-Original-Commit-Position: refs/heads/master@{#457093}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f9fca7ca0225a5c4ef021046526bf75e2cade80d
Some apk targets directly depend on their resources (e.g.
//android_webview/test:android_webview_apk). These are not picked up by
javac and need to be added to gradle in order to allow editing of all
resources.
BUG=682846
Review-Url: https://codereview.chromium.org/2724093003
Cr-Original-Commit-Position: refs/heads/master@{#456416}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f37993e1a795b3d8d72bb858a8ccb0a74b82400b
The script was originally //third_party/skia/gn/gn_to_cmake.py
Planning to use it to enable editing native files in android studio.
Currently script does not allow full build, intended for editing only.
BUG=694699
Review-Url: https://codereview.chromium.org/2733353003
Cr-Original-Commit-Position: refs/heads/master@{#455521}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a45e8b336d2b214cfd5db0b3e3b5b85b688ce8db
Reason for revert:
Breaks when CWD != output_dir
Original issue's description:
> Make generate_gradle.py work with preview SDKs.
>
> This just tweaks the values of buildToolsVersion and compileSdkVersion,
> which were not being set in a way compatible with preview SDKs.
>
> BUG=620034
>
> Review-Url: https://codereview.chromium.org/2724513003
> Cr-Commit-Position: refs/heads/master@{#453737}
> Committed: 1a04e1cf3dTBR=estevenson@chromium.org,nyquist@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=620034
Review-Url: https://codereview.chromium.org/2722973002
Cr-Original-Commit-Position: refs/heads/master@{#453788}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: aa0d524b8614ab29c29b960ea87c7df647b99a03
This just tweaks the values of buildToolsVersion and compileSdkVersion,
which were not being set in a way compatible with preview SDKs.
BUG=620034
Review-Url: https://codereview.chromium.org/2724513003
Cr-Original-Commit-Position: refs/heads/master@{#453737}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1a04e1cf3d4912300d625a57318bc6f2ba53ba79
Existing users can continue to split modules by gn targets by passing
--split-project to generate_gradle.py, although that flag will not
receive the same maintenance going forward, consider it deprecated.
This coalesces java and resource dependencies into the same build.gradle
file for each apk and junit target specified (test apks still get folded
into the apk_under_test target).
Speeds up sync/builds by 10x to 1-3 seconds. Paves the way for using
more of android studio's build steps, since they'll now take 1-3 seconds
rather than 10+ seconds each time.
BUG=620034
Review-Url: https://codereview.chromium.org/2708133002
Cr-Original-Commit-Position: refs/heads/master@{#453257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 543908d37bb29cad0925a6553cb6a7261b222133
This fixes most compile issues with android_webview. There is still an
issue with a missing R.java though (updated comment in code about this).
BUG=620034
Review-Url: https://codereview.chromium.org/2699963002
Cr-Original-Commit-Position: refs/heads/master@{#451217}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a1c2f35132f2a07e14c64b633485195a705f848e
Gradle uses package id from manifest when generating R.class. So, we
need to generate a custom manifest if we let gradle process resources.
BUG=682846, webrtc:6328
Review-Url: https://codereview.chromium.org/2691353005
Cr-Original-Commit-Position: refs/heads/master@{#451029}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cab87bffc69256f873c19f5a977d35e290a180ee
This is needed because multiple targets use the default Android manifest
with package name "dummy.package". This problem occurs when letting
gradle process resources.
BUG=682846,webrtc:6328
Review-Url: https://codereview.chromium.org/2699663004
Cr-Original-Commit-Position: refs/heads/master@{#450976}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b4ef9a4857c32338bc7b23e30708871b7541dec0
Use filters to exclude unwanted files from source directories instead of
creating symlink dirs for android studio gradle scripts.
Paves the way for multiple modules including the same source dirs.
BUG=690073
Review-Url: https://codereview.chromium.org/2682183002
Cr-Original-Commit-Position: refs/heads/master@{#449301}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9032b352ce46f107da00bf7b00ece989d86dcfb5
Reason for revert:
Script now fails if resources aren't already built
Original issue's description:
> Android: Add owned resources to android studio
>
> Include owned resources and unzip owned resource zips in android studio
> generated gradle projects. This allows a res directory to show up for
> each project.
>
> BUG=682846
>
> Review-Url: https://codereview.chromium.org/2667023002
> Cr-Commit-Position: refs/heads/master@{#447764}
> Committed: 9af0deb4bdTBR=estevenson@chromium.org,wnwen@chromium.org
NOTRY=true
BUG=682846,688219
Review-Url: https://codereview.chromium.org/2678463003
Cr-Original-Commit-Position: refs/heads/master@{#448195}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 11f780768683d40c8a159698c321707a299dbf1c
Include owned resources and unzip owned resource zips in android studio
generated gradle projects. This allows a res directory to show up for
each project.
BUG=682846
Review-Url: https://codereview.chromium.org/2667023002
Cr-Original-Commit-Position: refs/heads/master@{#447764}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9af0deb4bd0d2eb6ec47063ce2a024641e0da52d
Add instrumentation tests as androidTest for gradle projects. May
require more tweaking to get all the dependencies/files generated.
BUG=680217
Review-Url: https://codereview.chromium.org/2633533002
Cr-Original-Commit-Position: refs/heads/master@{#444800}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5ee39c9a1b872d95800d7527dbc2ffe7b16cab93
Rather than add all the features required by robolectric, this adds a
new "gradle_treat_as_prebuilt" flag that is set on a few targets.
BUG=620034
Review-Url: https://codereview.chromium.org/2508553002
Cr-Original-Commit-Position: refs/heads/master@{#432608}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2cefaf65d6362aadc536c1224e9981036cfb716f