From 53c7381929c0146e5dd2d963240564df0e33174c Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 10 Sep 2023 08:45:24 +0300 Subject: [PATCH] lib: move index/ into main lib/ simplify things a bit --- lib/index/meson.build | 60 ----------------------------------- lib/meson.build | 48 +++++++++++++++++++--------- lib/{index => }/mu-indexer.cc | 0 lib/{index => }/mu-indexer.hh | 0 lib/{index => }/mu-scanner.cc | 0 lib/{index => }/mu-scanner.hh | 0 lib/mu-server.cc | 3 +- lib/mu-store.cc | 9 ++---- lib/mu-store.hh | 14 ++++---- lib/tests/test-query.cc | 3 +- mu/mu-cmd-index.cc | 1 - 11 files changed, 45 insertions(+), 93 deletions(-) delete mode 100644 lib/index/meson.build rename lib/{index => }/mu-indexer.cc (100%) rename lib/{index => }/mu-indexer.hh (100%) rename lib/{index => }/mu-scanner.cc (100%) rename lib/{index => }/mu-scanner.hh (100%) diff --git a/lib/index/meson.build b/lib/index/meson.build deleted file mode 100644 index 39737409..00000000 --- a/lib/index/meson.build +++ /dev/null @@ -1,60 +0,0 @@ -## Copyright (C) 2021-2023 Dirk-Jan C. Binnema -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software Foundation, -## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -index_srcs=[ - 'mu-indexer.hh', - 'mu-indexer.cc', - 'mu-scanner.hh', - 'mu-scanner.cc' -] - -xapian_incs = xapian_dep.get_variable(pkgconfig: 'includedir') -lib_mu_index_inc_dep = declare_dependency( - include_directories: include_directories(['.', '..', xapian_incs])) -lib_mu_index=static_library('mu-index', [index_srcs], - dependencies: [ - config_h_dep, - glib_dep, - lib_mu_utils_dep, - lib_mu_index_inc_dep - ], - install: false) - -lib_mu_index_dep = declare_dependency( - link_with: lib_mu_index -) - - -# -# test tool -# -executable('list-maildirs', 'mu-scanner.cc', - install: false, - cpp_args: ['-DBUILD_LIST_MAILDIRS'], - dependencies: [glib_dep, config_h_dep, - lib_mu_utils_dep]) - - -# -# unit tests -# - -test('test-scanner', - executable('test-scanner', 'mu-scanner.cc', - install: false, - cpp_args: ['-DBUILD_TESTS'], - dependencies: [glib_dep, config_h_dep, - lib_mu_utils_dep])) diff --git a/lib/meson.build b/lib/meson.build index 226b6dc1..3592b3a9 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -17,26 +17,31 @@ subdir('utils') subdir('message') -subdir('index') lib_mu=static_library( 'mu', [ - 'mu-bookmarks.cc', + # db 'mu-config.cc', 'mu-contacts-cache.cc', - 'mu-maildir.cc', - 'mu-query-match-deciders.cc', - 'mu-query-threads.cc', - 'mu-query.cc', - 'mu-script.cc', - 'mu-server.cc', 'mu-store.cc', 'mu-xapian-db.cc', - # query-parser - 'mu-query-processor.cc', + # querying + 'mu-bookmarks.cc', + 'mu-query-match-deciders.cc', 'mu-query-parser.cc', - 'mu-query-xapianizer.cc' + 'mu-query-processor.cc', + 'mu-query-threads.cc', + 'mu-query-xapianizer.cc', + 'mu-query.cc', + # indexing + 'mu-indexer.cc', + 'mu-scanner.cc', + # mu4e + 'mu-server.cc', + # misc + 'mu-maildir.cc', + 'mu-script.cc', ], dependencies: [ glib_dep, @@ -46,11 +51,9 @@ lib_mu=static_library( guile_dep, config_h_dep, lib_mu_utils_dep, - lib_mu_message_dep, - lib_mu_index_dep], + lib_mu_message_dep], install: false) - lib_mu_dep = declare_dependency( link_with: lib_mu, dependencies: [ lib_mu_message_dep, thread_dep ], @@ -58,8 +61,9 @@ lib_mu_dep = declare_dependency( include_directories(['.', '..'])) # -# query parser dev helpers +# dev helpers # + process_query = executable('process-query', [ 'mu-query-processor.cc'], install: false, cpp_args: ['-DBUILD_PROCESS_QUERY'], @@ -80,6 +84,12 @@ xapian_query = executable('xapianize-query', [ 'mu-query-xapianizer.cc' ], cpp_args: ['-DBUILD_XAPIANIZE_QUERY'], dependencies: [glib_dep, lib_mu_dep]) +list_maildirs = executable('list-maildirs', 'mu-scanner.cc', + install: false, + cpp_args: ['-DBUILD_LIST_MAILDIRS'], + dependencies: [glib_dep, config_h_dep, + lib_mu_utils_dep]) + # # unit tests # @@ -125,4 +135,12 @@ test('test-query-xapianizer', cpp_args: ['-DBUILD_TESTS'], dependencies: [lib_mu_dep])) + +test('test-scanner', + executable('test-scanner', 'mu-scanner.cc', + install: false, + cpp_args: ['-DBUILD_TESTS'], + dependencies: [glib_dep, config_h_dep, + lib_mu_utils_dep])) + subdir('tests') diff --git a/lib/index/mu-indexer.cc b/lib/mu-indexer.cc similarity index 100% rename from lib/index/mu-indexer.cc rename to lib/mu-indexer.cc diff --git a/lib/index/mu-indexer.hh b/lib/mu-indexer.hh similarity index 100% rename from lib/index/mu-indexer.hh rename to lib/mu-indexer.hh diff --git a/lib/index/mu-scanner.cc b/lib/mu-scanner.cc similarity index 100% rename from lib/index/mu-scanner.cc rename to lib/mu-scanner.cc diff --git a/lib/index/mu-scanner.hh b/lib/mu-scanner.hh similarity index 100% rename from lib/index/mu-scanner.hh rename to lib/mu-scanner.hh diff --git a/lib/mu-server.cc b/lib/mu-server.cc index d6ac7192..c2e19409 100644 --- a/lib/mu-server.cc +++ b/lib/mu-server.cc @@ -18,9 +18,9 @@ */ #include "config.h" +#include "mu-server.hh" #include "message/mu-message.hh" -#include "mu-server.hh" #include #include @@ -39,7 +39,6 @@ #include "mu-maildir.hh" #include "mu-query.hh" -#include "index/mu-indexer.hh" #include "mu-store.hh" #include "utils/mu-utils.hh" diff --git a/lib/mu-store.cc b/lib/mu-store.cc index e5576278..79359509 100644 --- a/lib/mu-store.cc +++ b/lib/mu-store.cc @@ -18,28 +18,23 @@ */ #include "config.h" +#include "mu-store.hh" #include -#include #include #include #include #include -#include #include #include #include #include #include -#include -#include - #include "mu-maildir.hh" -#include "mu-store.hh" #include "mu-query.hh" #include "mu-xapian-db.hh" -#include "index/mu-scanner.hh" +#include "mu-scanner.hh" #include "utils/mu-error.hh" diff --git a/lib/mu-store.hh b/lib/mu-store.hh index e67005e4..6ac96d17 100644 --- a/lib/mu-store.hh +++ b/lib/mu-store.hh @@ -17,22 +17,24 @@ ** */ -#ifndef __MU_STORE_HH__ -#define __MU_STORE_HH__ +#ifndef MU_STORE_HH__ +#define MU_STORE_HH__ #include #include #include #include +#include + +#include #include "mu-contacts-cache.hh" #include "mu-xapian-db.hh" #include "mu-config.hh" -#include +#include "mu-indexer.hh" +#include "mu-query-results.hh" #include -#include -#include #include #include @@ -476,4 +478,4 @@ format_as(const Store& store) } // namespace Mu -#endif /* __MU_STORE_HH__ */ +#endif /* MU_STORE_HH__ */ diff --git a/lib/tests/test-query.cc b/lib/tests/test-query.cc index 2fb6e39b..1fd57481 100644 --- a/lib/tests/test-query.cc +++ b/lib/tests/test-query.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2022 Dirk-Jan C. Binnema +** Copyright (C) 2022-2023 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -27,7 +27,6 @@ #include "mu-store.hh" #include "mu-query.hh" -#include "index/mu-indexer.hh" #include "utils/mu-result.hh" #include "utils/mu-utils.hh" #include "utils/mu-test-utils.hh" diff --git a/mu/mu-cmd-index.cc b/mu/mu-cmd-index.cc index 5dd8e3e4..e16f6c4a 100644 --- a/mu/mu-cmd-index.cc +++ b/mu/mu-cmd-index.cc @@ -30,7 +30,6 @@ #include #include -#include "index/mu-indexer.hh" #include "mu-store.hh" using namespace Mu;