312 Commits

Author SHA1 Message Date
MohitMaliFtechiz
ee9a47df38 main.html has extra spaces, which small.zim file not containing so in this commit i have removed that extra spaces to pass test cases 2023-03-21 12:38:44 +05:30
Matthieu Gautier
285817f959 Fix creation of Bookmark.
Bookmark wrapper can be created using two ways:
- From a existing (cpp) bookmark (done internally by Library wrapper code)
- As a totally new one (empty) the java code will have to setup (using
  `set*` methods).

If the `Bookmark` constructor always create an empty new cpp bookmark,
when we set the wrapper to point to the existing bookmark, we will have a
leak of the new created bookmark.

As we want to keep the "basic" constructor as the normal java api to
create an empty bookmark, we need another (private) constructor to avoid
the construction of an empty bookmark.

The new constructor take a handle and directly set the `nativeHandle`.

On `Library.getBookmarks` we cannot use the helper `BUILD_WRAPPER` and
we must use "internal" function to use the `(J)V` constructor instead of
the basic `()V`.
2023-03-20 14:50:46 +01:00
Matthieu Gautier
3073712aa9 Fix typo in Library.getBookmarks
Fix @28
2023-03-20 14:28:17 +01:00
MohitMali
c5bf83ad0b Removed absolute path of JNI_INCLUDE_DIR 2023-03-16 11:25:55 +05:30
MohitMali
441a154881 Add book to library for bookmark test 2023-03-14 19:00:10 +05:30
MohitMali
97f2b4d3f4 Added searcher test cases 2023-03-14 19:00:00 +05:30
MohitMali
9a2573e7ca Removed extra spaces from main.html, we have tested small.zim and there is no extra space in it. 2023-03-14 18:59:45 +05:30
MohitMali
09539e209e Added test cases for libkiwix package 2023-03-14 18:52:33 +05:30
MohitMali
7d073926c9 Re-enable failed test cases 2023-03-13 19:05:24 +05:30
MohitMali
45f3e86801 Fixed jacoco report path 2023-03-13 18:55:48 +05:30
MohitMali
9d962a3af1 Fixed generated jar path 2023-03-13 18:38:42 +05:30
MohitMali
306916fc5c Fixed jni directory in test cases 2023-03-10 16:54:46 +05:30
MohitMali
38043b0b67 Refactored test cases 2023-03-10 16:37:21 +05:30
MohitMali
f427d53957 Fix cpp error while compiling 2023-03-06 17:39:57 +05:30
MohitMali
37618f2c63 Reverting minSdk,targetSdk version 2023-03-06 15:47:35 +05:30
MohitMali
9b7067ddd2 Fix path according to new folder structure 2023-03-03 18:38:40 +05:30
MohitMali
f7e4a5be6c Fix path of compiled so file 2023-03-03 18:23:08 +05:30
MohitMali
e14a12324e Removed wrapper.app from testing 2023-03-03 17:10:04 +05:30
MohitMali
49de5c457e Include new wrapper files in test CmakeLists file 2023-03-03 16:08:53 +05:30
Kelson
4b5cc44577
Merge pull request #23 from kiwix/adapt_wrapper
Adapt wrapper to new API of libzim/libkiwix
2023-02-09 17:28:25 +01:00
Matthieu Gautier
929ae6d1c3 Explicitly list the java files for what we need to generate header. 2023-02-09 14:59:09 +01:00
Matthieu Gautier
12a6898060 Rename back JNIKiwix.java_ to JNIKiwix.java 2023-02-03 15:52:20 +01:00
Matthieu Gautier
7c95917a52 Add bookmark wrapper. 2023-02-01 18:20:36 +01:00
Matthieu Gautier
06638d46b8 Remove thread lock.
This make the JNI wrapping *somehow* NOT threadsafe.

Few things are threadsafe "by nature":
- A lot of native method in libzim are threadsafe.
- Wrapping internal are threadsafe (shared_ptr).

What is not threadsafe is accessing the SAME java object from different
thread. But accessing the same wrapped cpp object using two different java
wrapper in two different thread is ok (assuming that the called cpp method
is threadsafe itself).
2023-01-24 17:11:27 +01:00
Matthieu Gautier
b2b7dad84f Add missing getDirectAccessInformation in libzim.Item. 2023-01-24 17:11:27 +01:00
Matthieu Gautier
150af85a7a All java class wrapping a native object must call dispose at destruction. 2023-01-24 17:11:27 +01:00
Matthieu Gautier
1dd170bd59 Add missing implementation of Searcher setNativeSearcherMulti 2023-01-24 17:11:27 +01:00
Matthieu Gautier
6fd7849241 Fix implementation of method in Archive.
A lot of methods are overloaded, so we must include the argument type
in the name.
2023-01-24 17:11:27 +01:00
Matthieu Gautier
775b55c3b0 Fix wrong implementation in Book.
As `update` is overloaded, the jni method name include the argument type.
And we have changed the type of one version of `update`, so we need
to change its name.
2023-01-24 17:11:27 +01:00
Matthieu Gautier
897c78a718 Add missing method in Book. 2023-01-24 17:11:27 +01:00
Matthieu Gautier
2ef64ac8b3 Use correct method in SearchIterator. 2023-01-24 17:11:27 +01:00
Matthieu Gautier
1c963273b7 Fix typos in Item.java.
The cpp method name is `getMimetype`, not `getMimeType`.
2023-01-24 17:11:27 +01:00
Matthieu Gautier
28f0acde24 Reorder methods' definitions.
For better comparaison with the generated header.
2023-01-24 17:11:27 +01:00
Matthieu Gautier
fe1de03b23 Intrudoce DISPOSE macro to implement the dispose method. 2023-01-24 17:11:27 +01:00
Matthieu Gautier
fbdea0dda2 Rename JNIKiwixServer to Server. 2023-01-24 15:07:49 +01:00
Matthieu Gautier
17b85bfff6 Remove some warning. 2023-01-18 19:23:33 +01:00
Matthieu Gautier
9426c6fcb8 Use Illustration api instead of deprecated favicon for Book 2023-01-18 19:23:16 +01:00
Matthieu Gautier
876d38b9f3 Introduce BUILD_WRAPPER macro 2023-01-18 19:21:35 +01:00
Matthieu Gautier
d63b84a5cc Repass on kiwix::Library wrapper 2023-01-18 17:12:22 +01:00
Matthieu Gautier
29518279dc Introduce macros.h to define common macro 2023-01-18 17:12:22 +01:00
Matthieu Gautier
edea648634 Introduce GETTER_METHOD in utils.h 2023-01-18 17:12:22 +01:00
Matthieu Gautier
ee5a6b3eeb Make METHOD macro not using libzim by default.
(Adapt only libzim part)
2023-01-18 17:12:22 +01:00
Matthieu Gautier
4e840ba5a9 Add compilation of libkiwix wrapper.
JNIKiwix.java is not compiled as it needs modules not found.
To be fixed.
2023-01-18 17:12:22 +01:00
Matthieu Gautier
0be73ef8e9 Remove wrapper around obsolete kiwix::Reader and kiwix::Searcher. 2023-01-18 17:12:22 +01:00
Matthieu Gautier
763731a5e1 Rename kiwixlib to libkiwix 2023-01-18 17:12:22 +01:00
Matthieu Gautier
4aa8eeedfb Wrap Archive::iterByFoo and Archive::findByFoo 2023-01-18 17:12:22 +01:00
Matthieu Gautier
3d2f3083b0 Wrap suggestion searcher. 2023-01-18 17:12:22 +01:00
Matthieu Gautier
f3ac28f56a Generate headers for all the *.java files. 2023-01-18 17:12:22 +01:00
Matthieu Gautier
9b971ce4dc Add wrapping around Search 2023-01-18 17:12:22 +01:00
Matthieu Gautier
7887202eb0 Better wrapping structure.
Avoid the Handle and directly use a shared_ptr.
This simplify a lot the wrapping code and potentially remove some bug.
2023-01-18 17:12:22 +01:00