blob: d70bbd278fe9ca8248eaf99b8cc97adbe357b9d7 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
static_library("core") {
sources = [
"article_distillation_update.cc",
"article_distillation_update.h",
"article_entry.cc",
"article_entry.h",
"distillable_page_detector.cc",
"distillable_page_detector.h",
"distilled_content_store.cc",
"distilled_content_store.h",
"distilled_page_prefs.cc",
"distilled_page_prefs.h",
"distilled_page_prefs_android.cc",
"distilled_page_prefs_android.h",
"distiller.cc",
"distiller.h",
"distiller_page.cc",
"distiller_page.h",
"distiller_ui_handle.h",
"distiller_url_fetcher.cc",
"distiller_url_fetcher.h",
"dom_distiller_constants.cc",
"dom_distiller_constants.h",
"dom_distiller_features.cc",
"dom_distiller_features.h",
"dom_distiller_request_view_base.cc",
"dom_distiller_request_view_base.h",
"dom_distiller_service.cc",
"dom_distiller_service.h",
"dom_distiller_switches.cc",
"dom_distiller_switches.h",
"experiments.cc",
"experiments.h",
"feedback_reporter.cc",
"feedback_reporter.h",
"page_features.cc",
"page_features.h",
"pref_names.cc",
"pref_names.h",
"task_tracker.cc",
"task_tracker.h",
"url_constants.cc",
"url_constants.h",
"url_utils.cc",
"url_utils.h",
"url_utils_android.cc",
"viewer.cc",
"viewer.h",
]
public_deps = [
"//components/dom_distiller/core/proto",
"//net",
"//third_party/dom_distiller_js:proto",
]
deps = [
"//base",
"//components/leveldb_proto",
"//components/pref_registry",
"//components/prefs",
"//components/resources",
"//components/strings",
"//components/variations",
"//services/network/public/cpp:cpp",
"//skia",
"//third_party/re2",
"//ui/base",
"//url",
]
if (is_android) {
sources += [
"dom_distiller_service_android.cc",
"dom_distiller_service_android.h",
]
deps += [ ":jni_headers" ]
}
}
static_library("test_support") {
testonly = true
sources = [
"fake_distiller.cc",
"fake_distiller.h",
"fake_distiller_page.cc",
"fake_distiller_page.h",
"test_request_view_handle.h",
]
deps = [
":core",
"//base",
"//components/leveldb_proto:test_support",
"//testing/gmock",
"//testing/gtest",
"//url",
]
}
bundle_data("unit_tests_bundle_data") {
visibility = [ ":unit_tests" ]
testonly = true
sources = [
"//components/test/data/dom_distiller/core_features.json",
"//components/test/data/dom_distiller/derived_features.json",
]
outputs = [ "{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}" ]
}
source_set("unit_tests") {
testonly = true
sources = [
"article_entry_unittest.cc",
"distillable_page_detector_unittest.cc",
"distilled_content_store_unittest.cc",
"distilled_page_prefs_unittests.cc",
"distiller_unittest.cc",
"distiller_url_fetcher_unittest.cc",
"dom_distiller_request_view_base_unittest.cc",
"dom_distiller_service_unittest.cc",
"page_features_unittest.cc",
"task_tracker_unittest.cc",
"url_utils_unittest.cc",
"viewer_unittest.cc",
]
deps = [
":core",
":test_support",
":unit_tests_bundle_data",
"//base",
"//components/leveldb_proto:test_support",
"//components/resources",
"//components/strings",
"//components/sync_preferences:test_support",
"//net:test_support",
"//services/network:test_support",
"//services/network/public/cpp:cpp",
"//testing/gmock",
"//testing/gtest",
"//ui/base",
"//url",
]
}
if (is_android) {
import("//build/config/android/rules.gni")
generate_jni("jni_headers") {
sources = [
"android/java/src/org/chromium/components/dom_distiller/core/DistilledPagePrefs.java",
"android/java/src/org/chromium/components/dom_distiller/core/DomDistillerService.java",
"android/java/src/org/chromium/components/dom_distiller/core/DomDistillerUrlUtils.java",
]
}
java_cpp_enum("distiller_type_java") {
sources = [ "experiments.h" ]
}
}