Compare commits

..

4 Commits
6.0.4 ... 7.0.0

Author SHA1 Message Date
Matthieu Gautier
651cb9165c Win kiwix serve (#274)
Win kiwix serve
2019-09-11 15:25:41 +02:00
Matthieu Gautier
49046248fd New version 7.0.0 2019-09-11 14:04:21 +02:00
Matthieu Gautier
e42e061d45 Add a way to specify a library to use with kiwix-serve.
If kiwix-desktop use a `library.xml` in the same directory than the
executable, we need to use it instead of the default one.

Instead of detect again the `library.xml` to use, let `kiwix-desktop` set
the library to use.

This also fix a issue when `/` is not a valid path separator in windows.
2019-09-11 14:04:21 +02:00
Kelson
d90774450d Slightly bigger top-padding for kiwix-serve 2019-09-11 13:50:33 +02:00
6 changed files with 15 additions and 7 deletions

View File

@@ -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
===============

View File

@@ -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'

View File

@@ -2,6 +2,7 @@
#define KIWIXLIB_KIWIX_SERVE_H_
#include <memory>
#include <string>
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<Subprocess> mp_kiwixServe;
int m_port;
std::string m_libraryPath;
};
}; //end namespace kiwix

View File

@@ -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'])

View File

@@ -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);
}

View File

@@ -124,7 +124,7 @@ label[for=kiwixsearchbox] {
}
body {
padding-top: 40px !important;
padding-top: 3em !important;
}
/* Try to fix buggy stuff in jquery-ui autocomplete */