mirror of https://github.com/kiwix/libkiwix.git
commit
651cb9165c
|
@ -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
|
kiwix-lib 6.0.4
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ task writePom {
|
||||||
project {
|
project {
|
||||||
groupId 'org.kiwix.kiwixlib'
|
groupId 'org.kiwix.kiwixlib'
|
||||||
artifactId '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'
|
packaging 'aar'
|
||||||
name 'kiwixlib'
|
name 'kiwixlib'
|
||||||
url 'https://github.com/kiwix/kiwix-lib'
|
url 'https://github.com/kiwix/kiwix-lib'
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define KIWIXLIB_KIWIX_SERVE_H_
|
#define KIWIXLIB_KIWIX_SERVE_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class Subprocess;
|
class Subprocess;
|
||||||
namespace kiwix {
|
namespace kiwix {
|
||||||
|
@ -9,7 +10,7 @@ namespace kiwix {
|
||||||
class KiwixServe
|
class KiwixServe
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KiwixServe(int port = 8181);
|
KiwixServe(const std::string& libraryPath, int port = 8181);
|
||||||
~KiwixServe();
|
~KiwixServe();
|
||||||
|
|
||||||
void run();
|
void run();
|
||||||
|
@ -20,6 +21,7 @@ class KiwixServe
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Subprocess> mp_kiwixServe;
|
std::unique_ptr<Subprocess> mp_kiwixServe;
|
||||||
int m_port;
|
int m_port;
|
||||||
|
std::string m_libraryPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; //end namespace kiwix
|
}; //end namespace kiwix
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
project('kiwix-lib', 'cpp',
|
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',
|
license : 'GPL',
|
||||||
default_options : ['c_std=c11', 'cpp_std=c++11', 'werror=true'])
|
default_options : ['c_std=c11', 'cpp_std=c++11', 'werror=true'])
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
|
|
||||||
namespace kiwix {
|
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.
|
// Try to use a potential installed kiwix-serve.
|
||||||
callCmd.push_back(KIWIXSERVE_CMD);
|
callCmd.push_back(KIWIXSERVE_CMD);
|
||||||
}
|
}
|
||||||
std::string libraryPath = getDataDirectory() + "/library.xml";
|
|
||||||
std::string attachProcessOpt = "-a" + to_string(pid);
|
std::string attachProcessOpt = "-a" + to_string(pid);
|
||||||
std::string portOpt = "-p" + to_string(m_port);
|
std::string portOpt = "-p" + to_string(m_port);
|
||||||
callCmd.push_back(attachProcessOpt.c_str());
|
callCmd.push_back(attachProcessOpt.c_str());
|
||||||
callCmd.push_back(portOpt.c_str());
|
callCmd.push_back(portOpt.c_str());
|
||||||
callCmd.push_back("-l");
|
callCmd.push_back("-l");
|
||||||
callCmd.push_back(libraryPath.c_str());
|
callCmd.push_back(m_libraryPath.c_str());
|
||||||
mp_kiwixServe = Subprocess::run(callCmd);
|
mp_kiwixServe = Subprocess::run(callCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue