diff --git a/ChangeLog b/ChangeLog index 86f75b7c..dcb22832 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +kiwix-lib 7.0.0 +=============== + + * [API break] Add a argument to kiwix-serve to specify the library to use. + kiwix-lib 6.0.4 =============== diff --git a/android-kiwix-lib-publisher/kiwixLibAndroid/build.gradle b/android-kiwix-lib-publisher/kiwixLibAndroid/build.gradle index 2560b71c..cf01550b 100644 --- a/android-kiwix-lib-publisher/kiwixLibAndroid/build.gradle +++ b/android-kiwix-lib-publisher/kiwixLibAndroid/build.gradle @@ -26,7 +26,7 @@ task writePom { project { groupId 'org.kiwix.kiwixlib' artifactId 'kiwixlib' - version '6.0.4' + (System.env.KIWIXLIB_BUILDVERSION == null ? '' : '-'+System.env.KIWIXLIB_BUILDVERSION) + version '7.0.0' + (System.env.KIWIXLIB_BUILDVERSION == null ? '' : '-'+System.env.KIWIXLIB_BUILDVERSION) packaging 'aar' name 'kiwixlib' url 'https://github.com/kiwix/kiwix-lib' diff --git a/include/kiwixserve.h b/include/kiwixserve.h index 54deb390..dcf5a064 100644 --- a/include/kiwixserve.h +++ b/include/kiwixserve.h @@ -2,6 +2,7 @@ #define KIWIXLIB_KIWIX_SERVE_H_ #include +#include class Subprocess; namespace kiwix { @@ -9,7 +10,7 @@ namespace kiwix { class KiwixServe { public: - KiwixServe(int port = 8181); + KiwixServe(const std::string& libraryPath, int port = 8181); ~KiwixServe(); void run(); @@ -20,6 +21,7 @@ class KiwixServe private: std::unique_ptr mp_kiwixServe; int m_port; + std::string m_libraryPath; }; }; //end namespace kiwix diff --git a/meson.build b/meson.build index d1be0aa8..3696eddc 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('kiwix-lib', 'cpp', - version : '6.0.4', # Also change this in android-kiwix-lib-publisher/kiwixLibAndroid/build.gradle + version : '7.0.0', # Also change this in android-kiwix-lib-publisher/kiwixLibAndroid/build.gradle license : 'GPL', default_options : ['c_std=c11', 'cpp_std=c++11', 'werror=true']) diff --git a/src/kiwixserve.cpp b/src/kiwixserve.cpp index c1dcdfbd..1111fec1 100644 --- a/src/kiwixserve.cpp +++ b/src/kiwixserve.cpp @@ -14,7 +14,9 @@ namespace kiwix { -KiwixServe::KiwixServe(int port) : m_port(port) +KiwixServe::KiwixServe(const std::string& libraryPath, int port) + : m_port(port), + m_libraryPath(libraryPath) { } @@ -43,13 +45,12 @@ void KiwixServe::run() // Try to use a potential installed kiwix-serve. callCmd.push_back(KIWIXSERVE_CMD); } - std::string libraryPath = getDataDirectory() + "/library.xml"; std::string attachProcessOpt = "-a" + to_string(pid); std::string portOpt = "-p" + to_string(m_port); callCmd.push_back(attachProcessOpt.c_str()); callCmd.push_back(portOpt.c_str()); callCmd.push_back("-l"); - callCmd.push_back(libraryPath.c_str()); + callCmd.push_back(m_libraryPath.c_str()); mp_kiwixServe = Subprocess::run(callCmd); }