API for binary_dependencies, and import changes to call the new API.
[chromium-blink-merge.git] / components / resource_provider / BUILD.gn
blob0eea37b2a1ec4af21ae3be50965b144eb55969b9
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
3 # found in the LICENSE file.
5 import("//mojo/public/mojo_application.gni")
6 import("//testing/test.gni")
8 if (is_android) {
9   import("//build/config/android/rules.gni")
11   java_library_path = "$target_out_dir/java_library.dex.jar"
13   mojo_android_application("resource_provider") {
14     input_so = "$root_out_dir/lib.stripped/libresource_provider_lib$android_product_extension"
15     input_dex_jar = java_library_path
16     deps = [
17       ":java_library",
18       ":resource_provider_lib",
19       "//third_party/icu:icudata",
20     ]
22     resources = [ "$root_out_dir/icudtl.dat" ]
23   }
25   shared_library("resource_provider_lib") {
26     sources = [
27       "android/android_hooks.cc",
28       "main.cc",
29     ]
31     deps = [
32       ":jni_headers",
33       ":lib",
34       "//base",
35       "//components/resource_provider/public/interfaces",
36       "//mojo/environment:chromium",
37       "//third_party/mojo/src/mojo/public/c/system:for_shared_library",
38       "//url",
39     ]
40   }
42   generate_jni("jni_headers") {
43     sources = [
44       "android/java/org/chromium/resource_provider/Main.java",
45     ]
46     jni_package = "components/resource_provider"
47   }
49   android_library("java_classes") {
50     java_files = [ "android/java/org/chromium/resource_provider/Main.java" ]
52     deps = [
53       "//base:base_java",
54     ]
55   }
57   android_standalone_library("java_library") {
58     dex_path = java_library_path
60     deps = [
61       ":java_classes",
62     ]
63   }
64 } else {
65   mojo_native_application("resource_provider") {
66     sources = [
67       "main.cc",
68     ]
70     deps = [
71       ":lib",
72       "//base",
73       "//components/resource_provider/public/interfaces",
74       "//mojo/environment:chromium",
75       "//third_party/icu:icudata",
76       "//url",
77     ]
79     resources = [ "$root_out_dir/icudtl.dat" ]
80   }
83 source_set("lib") {
84   sources = [
85     "file_utils.cc",
86     "file_utils.h",
87     "resource_provider_app.cc",
88     "resource_provider_app.h",
89     "resource_provider_impl.cc",
90     "resource_provider_impl.h",
91   ]
93   deps = [
94     "//base",
95     "//components/resource_provider/public/interfaces",
96     "//mojo/application/public/cpp",
97     "//mojo/common:common_base",
98     "//mojo/platform_handle",
99     "//url",
100   ]
103 test("resource_provider_unittests") {
104   sources = [
105     "file_utils_unittest.cc",
106   ]
108   deps = [
109     ":lib",
110     "//base",
111     "//base/test:test_config",
112     "//components/resource_provider/public/interfaces",
113     "//mojo/environment:chromium",
114     "//testing/gtest",
115     "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
116     "//url",
117   ]
120 mojo_native_application("apptests") {
121   output_name = "resource_provider_apptests"
122   testonly = true
124   sources = [
125     "resource_provider_apptest.cc",
126   ]
128   resources = [
129     "//components/test/data/resource_provider/sample",
130     "//components/test/data/resource_provider/dir",
131   ]
133   deps = [
134     "//base",
135     "//base/test:test_config",
136     "//components/resource_provider/public/cpp",
137     "//components/resource_provider/public/interfaces",
138     "//mojo/application/public/cpp:test_support",
139     "//mojo/platform_handle",
140   ]
142   data_deps = [ ":resource_provider" ]