Commit 8aedc225 authored by Charlie Harrison's avatar Charlie Harrison Committed by Commit Bot

[subresource_filter] move tools to toplevel

This will make it less cumbersome to add more tools or add subdirectories.
TBR=jochen@chromium.org

Bug: None
Change-Id: Id6c1a41087ea4a3b9f25b9ea41905149b3580ac9
Reviewed-on: https://chromium-review.googlesource.com/1011683Reviewed-by: default avatarCharlie Harrison <csharrison@chromium.org>
Reviewed-by: default avatarJosh Karlin <jkarlin@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550600}
parent 260a5d3d
...@@ -140,6 +140,7 @@ test("components_unittests") { ...@@ -140,6 +140,7 @@ test("components_unittests") {
"//components/ssl_errors:unit_tests", "//components/ssl_errors:unit_tests",
"//components/subresource_filter/core/browser:unit_tests", "//components/subresource_filter/core/browser:unit_tests",
"//components/subresource_filter/core/common:unit_tests", "//components/subresource_filter/core/common:unit_tests",
"//components/subresource_filter/tools:unit_tests",
"//components/suggestions:unit_tests", "//components/suggestions:unit_tests",
"//components/supervised_user_error_page:unit_tests", "//components/supervised_user_error_page:unit_tests",
"//components/sync:unit_tests", "//components/sync:unit_tests",
...@@ -555,7 +556,7 @@ if (!is_ios) { ...@@ -555,7 +556,7 @@ if (!is_ios) {
"//components/omnibox/browser", "//components/omnibox/browser",
"//components/omnibox/browser:test_support", "//components/omnibox/browser:test_support",
"//components/subresource_filter/core/common", "//components/subresource_filter/core/common",
"//components/subresource_filter/core/common:tools_lib", "//components/subresource_filter/tools:tools_lib",
"//components/test:test_support", "//components/test:test_support",
"//components/visitedlink/browser", "//components/visitedlink/browser",
"//testing/perf", "//testing/perf",
......
...@@ -60,21 +60,6 @@ static_library("test_support") { ...@@ -60,21 +60,6 @@ static_library("test_support") {
] ]
} }
static_library("tools_lib") {
sources = [
"tools/filter_tool.cc",
"tools/filter_tool.h",
"tools/indexing_tool.cc",
"tools/indexing_tool.h",
]
deps = [
":common",
"//base",
"//components/url_pattern_index:util",
"//url",
]
}
source_set("unit_tests") { source_set("unit_tests") {
testonly = true testonly = true
sources = [ sources = [
...@@ -82,13 +67,10 @@ source_set("unit_tests") { ...@@ -82,13 +67,10 @@ source_set("unit_tests") {
"first_party_origin_unittest.cc", "first_party_origin_unittest.cc",
"indexed_ruleset_unittest.cc", "indexed_ruleset_unittest.cc",
"scoped_timers_unittest.cc", "scoped_timers_unittest.cc",
"tools/filter_tool_unittest.cc",
"tools/indexing_tool_unittest.cc",
] ]
deps = [ deps = [
":common", ":common",
":test_support", ":test_support",
":tools_lib",
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//components/url_pattern_index:test_support", "//components/url_pattern_index:test_support",
...@@ -97,27 +79,3 @@ source_set("unit_tests") { ...@@ -97,27 +79,3 @@ source_set("unit_tests") {
"//url", "//url",
] ]
} }
if (is_linux || is_mac || is_win) {
executable("subresource_filter_tool") {
sources = [
"tools/filter_tool_main.cc",
]
deps = [
":tools_lib",
"//base",
"//build/config:exe_and_shlib_deps",
]
}
executable("subresource_indexing_tool") {
sources = [
"tools/indexing_tool_main.cc",
]
deps = [
":tools_lib",
"//base",
"//build/config:exe_and_shlib_deps",
]
}
}
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include "base/time/time.h" #include "base/time/time.h"
#include "base/timer/elapsed_timer.h" #include "base/timer/elapsed_timer.h"
#include "components/subresource_filter/core/common/memory_mapped_ruleset.h" #include "components/subresource_filter/core/common/memory_mapped_ruleset.h"
#include "components/subresource_filter/core/common/tools/filter_tool.h" #include "components/subresource_filter/tools/filter_tool.h"
#include "components/subresource_filter/core/common/tools/indexing_tool.h" #include "components/subresource_filter/tools/indexing_tool.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_test.h" #include "testing/perf/perf_test.h"
......
# Copyright 2018 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("tools_lib") {
sources = [
"filter_tool.cc",
"filter_tool.h",
"indexing_tool.cc",
"indexing_tool.h",
]
deps = [
"../core/common",
"//base",
"//components/url_pattern_index:util",
"//url",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"filter_tool_unittest.cc",
"indexing_tool_unittest.cc",
]
deps = [
":tools_lib",
"../core/common",
"../core/common:test_support",
"//base",
"//base/test:test_support",
"//components/url_pattern_index:test_support",
"//testing/gtest",
"//third_party/protobuf:protobuf_lite",
"//url",
]
}
if (is_linux || is_mac || is_win) {
executable("subresource_filter_tool") {
sources = [
"filter_tool_main.cc",
]
deps = [
":tools_lib",
"//base",
"//build/config:exe_and_shlib_deps",
]
}
executable("subresource_indexing_tool") {
sources = [
"indexing_tool_main.cc",
]
deps = [
":tools_lib",
"//base",
"//build/config:exe_and_shlib_deps",
]
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/subresource_filter/core/common/tools/filter_tool.h" #include "components/subresource_filter/tools/filter_tool.h"
#include <istream> #include <istream>
#include <ostream> #include <ostream>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_TOOLS_FILTER_TOOL_H_ #ifndef COMPONENTS_SUBRESOURCE_FILTER_TOOLS_FILTER_TOOL_H_
#define COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_TOOLS_FILTER_TOOL_H_ #define COMPONENTS_SUBRESOURCE_FILTER_TOOLS_FILTER_TOOL_H_
#include <istream> #include <istream>
#include <ostream> #include <ostream>
...@@ -79,4 +79,4 @@ class FilterTool { ...@@ -79,4 +79,4 @@ class FilterTool {
} // namespace subresource_filter } // namespace subresource_filter
#endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_TOOLS_FILTER_TOOL_H_ #endif // COMPONENTS_SUBRESOURCE_FILTER_TOOLS_FILTER_TOOL_H_
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/subresource_filter/core/common/tools/filter_tool.h" #include "components/subresource_filter/tools/filter_tool.h"
namespace { namespace {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/subresource_filter/core/common/tools/filter_tool.h" #include "components/subresource_filter/tools/filter_tool.h"
#include <algorithm> #include <algorithm>
#include <memory> #include <memory>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/subresource_filter/core/common/tools/indexing_tool.h" #include "components/subresource_filter/tools/indexing_tool.h"
#include <utility> #include <utility>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_TOOLS_INDEXING_TOOL_H_ #ifndef COMPONENTS_SUBRESOURCE_FILTER_TOOLS_INDEXING_TOOL_H_
#define COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_TOOLS_INDEXING_TOOL_H_ #define COMPONENTS_SUBRESOURCE_FILTER_TOOLS_INDEXING_TOOL_H_
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
...@@ -18,4 +18,4 @@ bool IndexAndWriteRuleset(const base::FilePath& unindexed_path, ...@@ -18,4 +18,4 @@ bool IndexAndWriteRuleset(const base::FilePath& unindexed_path,
} // namespace subresource_filter } // namespace subresource_filter
#endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_COMMON_TOOLS_INDEXING_TOOL_H_ #endif // COMPONENTS_SUBRESOURCE_FILTER_TOOLS_INDEXING_TOOL_H_
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/logging.h" #include "base/logging.h"
#include "components/subresource_filter/core/common/tools/indexing_tool.h" #include "components/subresource_filter/tools/indexing_tool.h"
const char kHelpMsg[] = R"( const char kHelpMsg[] = R"(
subresource_indexing_tool <unindexed_ruleset_file> <output_file> subresource_indexing_tool <unindexed_ruleset_file> <output_file>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/subresource_filter/core/common/tools/indexing_tool.h" #include "components/subresource_filter/tools/indexing_tool.h"
#include <memory> #include <memory>
#include <string> #include <string>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment