Port Android relocation packer to chromium build
[chromium-blink-merge.git] / mojo / services / html_viewer / BUILD.gn
blobb776d38a8c6f5e7065e52b1f367737533f632f7e
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import("//testing/test.gni")
6 import("//third_party/mojo/src/mojo/public/mojo.gni")
7 import("//third_party/mojo/src/mojo/public/mojo_application.gni")
9 action("generate_blink_resource_map") {
10   script = "//mojo/services/html_viewer/generate_blink_resource_map.py"
11   args = [
12     "--pak-file",
13     rebase_path("$root_out_dir/gen/blink/public/resources/blink_resources.pak"),
14     "--header",
15     rebase_path("$target_gen_dir/blink_resource_map.h"),
16     "--cpp",
17     rebase_path("$target_gen_dir/blink_resource_map.cc"),
18   ]
19   outputs = [
20     "$target_gen_dir/blink_resource_map.cc",
21     "$target_gen_dir/blink_resource_map.h",
22   ]
23   public_deps = [
24     "//third_party/WebKit/public:resources",
25   ]
28 source_set("lib") {
29   sources = [
30     "$target_gen_dir/blink_resource_map.cc",
31     "$target_gen_dir/blink_resource_map.h",
32     "ax_provider_impl.cc",
33     "ax_provider_impl.h",
34     "blink_basic_type_converters.cc",
35     "blink_basic_type_converters.h",
36     "blink_input_events_type_converters.cc",
37     "blink_input_events_type_converters.h",
38     "blink_platform_impl.cc",
39     "blink_platform_impl.h",
40     "blink_resource_constants.h",
41     "blink_url_request_type_converters.cc",
42     "blink_url_request_type_converters.h",
43     "discardable_memory_allocator.cc",
44     "discardable_memory_allocator.h",
45     "html_document.cc",
46     "html_document.h",
47     "mojo_blink_platform_impl.cc",
48     "mojo_blink_platform_impl.h",
49     "webclipboard_impl.cc",
50     "webclipboard_impl.h",
51     "webcookiejar_impl.cc",
52     "webcookiejar_impl.h",
53     "weblayertreeview_impl.cc",
54     "weblayertreeview_impl.h",
55     "webmediaplayer_factory.cc",
56     "webmediaplayer_factory.h",
57     "webmimeregistry_impl.cc",
58     "webmimeregistry_impl.h",
59     "webscheduler_impl.cc",
60     "webscheduler_impl.h",
61     "websockethandle_impl.cc",
62     "websockethandle_impl.h",
63     "webstoragenamespace_impl.cc",
64     "webstoragenamespace_impl.h",
65     "webthemeengine_impl.cc",
66     "webthemeengine_impl.h",
67     "webthread_impl.cc",
68     "webthread_impl.h",
69     "weburlloader_impl.cc",
70     "weburlloader_impl.h",
71   ]
73   include_dirs = [ "third_party/WebKit" ]
75   deps = [
76     "//base",
77     "//base/third_party/dynamic_annotations",
78     "//cc",
79     "//cc/blink",
80     "//cc/surfaces",
81     "//gin",
82     "//media",
83     "//media/blink",
84     "//media/mojo",
85     "//mojo/application",
86     "//mojo/cc",
87     "//mojo/common",
88     "//mojo/converters/surfaces",
89     "//mojo/services/network/public/cpp",
90     "//mojo/services/network/public/interfaces",
91     "//net",
92     "//skia",
93     "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
94     "//third_party/mojo/src/mojo/public/cpp/utility",
95     "//third_party/mojo/src/mojo/public/interfaces/application",
96     "//third_party/mojo_services/src/accessibility/public/interfaces",
97     "//third_party/mojo_services/src/clipboard/public/interfaces",
98     "//third_party/mojo_services/src/content_handler/public/interfaces",
99     "//third_party/mojo_services/src/gpu/public/interfaces",
100     "//third_party/mojo_services/src/input_events/public/interfaces",
101     "//third_party/mojo_services/src/navigation/public/interfaces",
102     "//third_party/mojo_services/src/surfaces/public/interfaces",
103     "//ui/gfx/geometry",
104     "//ui/native_theme",
105     "//ui/resources:ui_test_pak",
106     "//url",
107   ]
109   public_deps = [
110     "//third_party/WebKit/public:blink",
111     "//third_party/mojo/src/mojo/public/cpp/bindings",
112     "//third_party/mojo_services/src/view_manager/public/cpp",
113     ":generate_blink_resource_map",
114   ]
117 if (is_android) {
118   import("//build/config/android/rules.gni")
120   java_library_path = "$target_out_dir/java_library.dex.jar"
122   mojo_android_application("html_viewer") {
123     input_so = "$root_out_dir/lib.stripped/libhtml_viewer_lib.so"
124     input_dex_jar = java_library_path
125   }
127   shared_library("html_viewer_lib") {
128     sources = [
129       "android/android_hooks.cc",
130       "html_viewer.cc",
131     ]
133     deps = [
134       ":html_viewer_jni_headers",
135       ":lib",
136       "//base",
137       "//ui/gfx:gfx_jni_headers",
138     ]
139   }
141   generate_jni("html_viewer_jni_headers") {
142     sources = [
143       "android/java/org/chromium/html_viewer/Main.java",
144     ]
145     jni_package = "mojo/services/html_viewer"
146   }
148   android_library("html_viewer_java_classes") {
149     java_files = [ "android/java/org/chromium/html_viewer/Main.java" ]
151     deps = [
152       "//base:base_java",
153     ]
154   }
156   android_standalone_library("java_library") {
157     dex_path = java_library_path
159     deps = [
160       ":html_viewer_java_classes",
162       # TODO(sky): this is WAY more than we need. We really only need
163       # DeviceDisplayInfo. Refactor to make this clearer.
164       "//ui/android:ui_java",
165     ]
166   }
167 } else {
168   mojo_native_application("html_viewer") {
169     sources = [
170       "html_viewer.cc",
171     ]
172     deps = [
173       ":lib",
174     ]
175   }
178 test("tests") {
179   output_name = "html_viewer_unittests"
180   sources = [
181     "ax_provider_impl_unittest.cc",
182     "discardable_memory_allocator_unittest.cc",
183   ]
184   deps = [
185     ":lib",
186     "//base/test:run_all_unittests",
187   ]