Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / components / dom_distiller / core / BUILD.gn
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.
4
5 # GYP version: components/dom_distiller.gypi:dom_distiller_core
6 static_library("core") {
7   sources = [
8     "../android/component_jni_registrar.cc",
9     "../android/component_jni_registrar.h",
10     "article_distillation_update.cc",
11     "article_distillation_update.h",
12     "article_entry.cc",
13     "article_entry.h",
14     "distilled_content_store.cc",
15     "distilled_content_store.h",
16     "distiller.cc",
17     "distiller.h",
18     "distiller_page.cc",
19     "distiller_page.h",
20     "distilled_page_prefs.cc",
21     "distilled_page_prefs.h",
22     "distilled_page_prefs_android.cc",
23     "distilled_page_prefs_android.h",
24     "distiller_url_fetcher.cc",
25     "distiller_url_fetcher.h",
26     "dom_distiller_constants.cc",
27     "dom_distiller_constants.h",
28     "dom_distiller_model.cc",
29     "dom_distiller_model.h",
30     "dom_distiller_observer.h",
31     "dom_distiller_service.cc",
32     "dom_distiller_service.h",
33     "dom_distiller_store.cc",
34     "dom_distiller_store.h",
35     "feedback_reporter.cc",
36     "feedback_reporter.h",
37     "task_tracker.cc",
38     "task_tracker.h",
39     "url_constants.cc",
40     "url_constants.h",
41     "url_utils_android.cc",
42     "url_utils_android.h",
43     "url_utils.cc",
44     "url_utils.h",
45     "viewer.cc",
46     "viewer.h",
47   ]
48
49   public_deps = [
50     "//components/dom_distiller/core/proto",
51     "//third_party/dom_distiller_js:proto",
52   ]
53   deps = [
54     "//base",
55     "//components/leveldb_proto",
56     "//components/resources",
57     "//components/strings",
58     "//net",
59     "//skia",
60     "//sync",
61     "//ui/base",
62     "//url",
63   ]
64
65   if (is_android) {
66     deps += [ ":jni_headers" ]
67   }
68 }
69
70 # GYP version: components/dom_distiller.gypi:dom_distiller_test_support
71 static_library("test_support") {
72   testonly = true
73   sources = [
74     "dom_distiller_test_util.cc",
75     "dom_distiller_test_util.h",
76     "fake_distiller.cc",
77     "fake_distiller.h",
78     "fake_distiller_page.cc",
79     "fake_distiller_page.h",
80   ]
81
82   deps = [
83     ":core",
84     "//components/leveldb_proto:test_support",
85     "//sync",
86     "//testing/gmock",
87     "//testing/gtest",
88   ]
89 }
90
91 source_set("unit_tests") {
92   testonly = true
93   sources = [
94     "article_entry_unittest.cc",
95     "distilled_content_store_unittest.cc",
96     "distilled_page_prefs_unittests.cc",
97     "distiller_unittest.cc",
98     "distiller_url_fetcher_unittest.cc",
99     "dom_distiller_model_unittest.cc",
100     "dom_distiller_service_unittest.cc",
101     "dom_distiller_store_unittest.cc",
102     "task_tracker_unittest.cc",
103     "url_utils_unittest.cc",
104     "viewer_unittest.cc",
105   ]
106
107   deps = [
108     ":core",
109     ":test_support",
110     "//testing/gmock",
111     "//testing/gtest",
112   ]
113 }
114
115 if (is_android) {
116   import("//build/config/android/rules.gni")
117
118   generate_jni("jni_headers") {
119     sources = [
120       "../android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java",
121       "../android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java",
122       "../android/java/src/org/chromium/components/dom_distiller/core/DomDistillerUrlUtils.java",
123     ]
124     jni_package = "dom_distiller_core"
125   }
126 }