OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/android/rules.gni") | 6 import("//build/config/android/rules.gni") |
7 import("generate_resource_rewriter.gni") | 7 import("generate_resource_rewriter.gni") |
8 import("glue.gni") | 8 import("glue.gni") |
9 | 9 |
10 webview_framework_ijar = | 10 # There are two copies of this file: one upstream and one downstream, |
11 "$root_out_dir/lib.java/webview/frameworks.interface.jar" | 11 # all targets defined in this file will finally generate two targets. |
| 12 # is_upstream could be used to differentiate those two targets, see |
| 13 # 'glue' target for details. |
| 14 is_upstream = rebase_path(".", "//android_webview/glue") == "." |
12 | 15 |
13 generate_interface_jar("framework_ijar") { | 16 webview_framework_ijar = "frameworks.interface.jar" |
14 input_jar = webview_framework_jar | 17 webview_public_framework_ijar = "frameworks.public.interface.jar" |
15 output_jar = webview_framework_ijar | 18 |
| 19 # Mark webview_framework_ijar is used, otherwise it isn't used if there |
| 20 # is no internal code. |
| 21 assert(webview_framework_ijar != "") |
| 22 |
| 23 if (defined(webview_internal_framework_jar)) { |
| 24 generate_interface_jar("framework_ijar") { |
| 25 input_jar = webview_internal_framework_jar |
| 26 output_jar = "$target_out_dir/$webview_framework_ijar" |
| 27 } |
| 28 } |
| 29 |
| 30 generate_interface_jar("public_framework_ijar") { |
| 31 input_jar = webview_public_framework_jar |
| 32 output_jar = "$target_out_dir/$webview_public_framework_ijar" |
16 } | 33 } |
17 | 34 |
18 generate_resource_rewriter("glue_resource_rewriter") { | 35 generate_resource_rewriter("glue_resource_rewriter") { |
19 # Change deps? please modify glue_library_deps variable. | 36 # Change deps? please modify glue_library_deps variable. |
20 deps = glue_library_deps | 37 deps = glue_library_deps |
21 package_name = "com.android.webview.chromium" | 38 package_name = "com.android.webview.chromium" |
22 } | 39 } |
23 | 40 |
24 if (!defined(use_webview_internal_framework) || | 41 android_library("glue") { |
25 !use_webview_internal_framework) { | 42 # Change deps? please modify glue_library_deps variable. |
26 android_library("glue") { | 43 deps = glue_library_deps |
27 # Change deps? please modify glue_library_deps variable. | 44 srcjar_deps = [ ":glue_resource_rewriter" ] |
28 deps = glue_library_deps | |
29 srcjar_deps = [ ":glue_resource_rewriter" ] | |
30 | 45 |
31 alternative_android_sdk_ijar = webview_framework_ijar | 46 # Always build upstream or downstream target with public or internal |
32 alternative_android_sdk_ijar_dep = "//android_webview/glue:framework_ijar" | 47 # framework jar respectively. |
33 | 48 if (is_upstream) { |
34 java_files = [ | 49 alternative_android_sdk_ijar_dep = ":public_framework_ijar" |
35 "java/src/com/android/webview/chromium/ContentSettingsAdapter.java", | 50 _ijar = webview_public_framework_ijar |
36 "java/src/com/android/webview/chromium/CookieManagerAdapter.java", | 51 } else { |
37 "java/src/com/android/webview/chromium/DrawGLFunctor.java", | 52 assert(defined(webview_internal_framework_jar)) |
38 "java/src/com/android/webview/chromium/GeolocationPermissionsAdapter.java"
, | 53 alternative_android_sdk_ijar_dep = ":framework_ijar" |
39 "java/src/com/android/webview/chromium/GraphicsUtils.java", | 54 _ijar = webview_framework_ijar |
40 "java/src/com/android/webview/chromium/LicenseActivity.java", | |
41 "java/src/com/android/webview/chromium/LicenseContentProvider.java", | |
42 "java/src/com/android/webview/chromium/ResourcesContextWrapperFactory.java
", | |
43 "java/src/com/android/webview/chromium/WebBackForwardListChromium.java", | |
44 "java/src/com/android/webview/chromium/WebHistoryItemChromium.java", | |
45 "java/src/com/android/webview/chromium/WebIconDatabaseAdapter.java", | |
46 "java/src/com/android/webview/chromium/WebMessagePortAdapter.java", | |
47 "java/src/com/android/webview/chromium/WebStorageAdapter.java", | |
48 "java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
", | |
49 "java/src/com/android/webview/chromium/WebViewChromium.java", | |
50 "java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java", | |
51 "java/src/com/android/webview/chromium/WebViewDatabaseAdapter.java", | |
52 "java/src/com/android/webview/chromium/WebViewDelegateFactory.java", | |
53 ] | |
54 } | 55 } |
| 56 _ijar_dir = get_label_info(alternative_android_sdk_ijar_dep, "target_out_dir") |
| 57 alternative_android_sdk_ijar = "$_ijar_dir/$_ijar" |
| 58 java_files = [ |
| 59 "java/src/com/android/webview/chromium/ContentSettingsAdapter.java", |
| 60 "java/src/com/android/webview/chromium/CookieManagerAdapter.java", |
| 61 "java/src/com/android/webview/chromium/DrawGLFunctor.java", |
| 62 "java/src/com/android/webview/chromium/GeolocationPermissionsAdapter.java", |
| 63 "java/src/com/android/webview/chromium/GraphicsUtils.java", |
| 64 "java/src/com/android/webview/chromium/LicenseActivity.java", |
| 65 "java/src/com/android/webview/chromium/LicenseContentProvider.java", |
| 66 "java/src/com/android/webview/chromium/ResourcesContextWrapperFactory.java", |
| 67 "java/src/com/android/webview/chromium/WebBackForwardListChromium.java", |
| 68 "java/src/com/android/webview/chromium/WebHistoryItemChromium.java", |
| 69 "java/src/com/android/webview/chromium/WebIconDatabaseAdapter.java", |
| 70 "java/src/com/android/webview/chromium/WebMessagePortAdapter.java", |
| 71 "java/src/com/android/webview/chromium/WebStorageAdapter.java", |
| 72 "java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java", |
| 73 "java/src/com/android/webview/chromium/WebViewChromium.java", |
| 74 "java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java", |
| 75 "java/src/com/android/webview/chromium/WebViewDatabaseAdapter.java", |
| 76 "java/src/com/android/webview/chromium/WebViewDelegateFactory.java", |
| 77 ] |
55 } | 78 } |
OLD | NEW |