Merge pull request #79 from kiwix/release-1.0.2

Release 1.0.2
This commit is contained in:
Matthieu Gautier 2024-01-18 16:56:58 +01:00 committed by GitHub
commit 4a8e966e5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 36 additions and 14 deletions

View File

@ -1,8 +1,11 @@
1.0.2
* NEW: libkiwix 13.0.0 and libzim 9.1.0 (@mgautierfr https://github.com/kiwix/java-libkiwix/pull/68)
* NEW: libkiwix and libzim with debug symbols (@mgautierfr https://github.com/kiwix/kiwix-build/pull/664)
1.0.1 1.0.1
* FIX: Resolved an issue where the library was not saving all books that are read from the library. (https://github.com/kiwix/java-libkiwix/pull/72) * FIX: Resolved an issue where the library was not saving all books that are read from the library. (https://github.com/kiwix/java-libkiwix/pull/72)
* FIX: Fixed a problem where books were not returning the illustration. (https://github.com/kiwix/java-libkiwix/pull/74) * FIX: Fixed a problem where books were not returning the illustration. (https://github.com/kiwix/java-libkiwix/pull/74)
1.0.0 1.0.0
* NEW: Moved wrapper from libkiwix to java-libkiwix. * NEW: Moved wrapper from libkiwix to java-libkiwix.
* NEW: Adapted new build system. * NEW: Adapted new build system.

View File

@ -19,12 +19,12 @@ ext["sonatypeStagingProfileId"] = properties.getProperty("sonatypeStagingProfile
ext { ext {
set("GROUP_ID", "org.kiwix") set("GROUP_ID", "org.kiwix")
set("ARTIFACT_ID", "libkiwix") set("ARTIFACT_ID", "libkiwix")
set("VERSION", "1.0.1") set("VERSION", "1.0.2")
} }
// Replace these versions with the latest available versions of libkiwix and libzim // Replace these versions with the latest available versions of libkiwix and libzim
ext.libkiwix_version = "13.0.0" ext.libkiwix_version = "13.0.0-1"
ext.libzim_version = "9.0.0" ext.libzim_version = "9.1.0"
apply from: 'publish.gradle' apply from: 'publish.gradle'
android { android {
@ -146,17 +146,24 @@ task copyLibzimHeaderAndSoFiles(type: Copy) {
copy { copy {
// copying linux_x86_64 so file // copying linux_x86_64 so file
from buildDir.path + "/libzim_linux-x86_64-bionic/lib/x86_64-linux-gnu/libzim.so." + libzim_version from buildDir.path + "/libzim_linux-x86_64-bionic/lib/x86_64-linux-gnu/libzim.so." + getActualLibraryVersion(libzim_version)
into buildDir.path into buildDir.path
} }
} }
task renameLibzimSoFile(type: Copy) { task renameLibzimSoFile(type: Copy) {
if (libzim_version != null) { if (libzim_version != null) {
def finalLibzimVersion = getActualLibraryVersion(libzim_version)
def sourceFile = file(buildDir.path + "/libzim.so." + finalLibzimVersion)
if (project.gradle.startParameter.taskNames.contains("renameLibzimSoFile") && !sourceFile.exists()) {
throw new RuntimeException("Rename Libzim so file task failed, File not found: ${sourceFile}")
}
from(buildDir.path) from(buildDir.path)
include "libzim.so." + libzim_version include "libzim.so." + finalLibzimVersion
destinationDir file(buildDir.path) destinationDir file(buildDir.path)
rename "libzim.so." + libzim_version, "libzim.so" rename "libzim.so." + finalLibzimVersion, "libzim.so"
} }
} }
@ -240,18 +247,34 @@ task copyLibkiwixHeaderAndSoFiles(type: Copy) {
copy { copy {
// copying linux_x86_64 so file // copying linux_x86_64 so file
from buildDir.path + "/libkiwix_linux-x86_64/lib/x86_64-linux-gnu/libkiwix.so." + libkiwix_version from buildDir.path + "/libkiwix_linux-x86_64/lib/x86_64-linux-gnu/libkiwix.so." + getActualLibraryVersion(libkiwix_version)
into buildDir.path into buildDir.path
} }
} }
task renameLibkiwixSoFile(type: Copy) { task renameLibkiwixSoFile(type: Copy) {
if (libkiwix_version != null) { if (libkiwix_version != null) {
from(buildDir.path) def finalLibkiwixVersion = getActualLibraryVersion(libkiwix_version)
include "libkiwix.so." + libkiwix_version def sourceFile = file(buildDir.path + "/libkiwix.so." + finalLibkiwixVersion)
destinationDir file(buildDir.path)
rename "libkiwix.so." + libkiwix_version, "libkiwix.so" if (project.gradle.startParameter.taskNames.contains("renameLibkiwixSoFile") && !sourceFile.exists()) {
throw new RuntimeException("Rename Libkiwix so file task failed, File not found: ${sourceFile}")
} }
from(buildDir.path)
include "libkiwix.so." + finalLibkiwixVersion
destinationDir file(buildDir.path)
rename "libkiwix.so." + finalLibkiwixVersion, "libkiwix.so"
}
}
// Extracting the library version before the "-"
// see https://github.com/kiwix/java-libkiwix/pull/79 for more details
static String getActualLibraryVersion(String libraryVersion) {
// Find the index of the first occurrence of "-"
Integer dashIndex = libraryVersion.indexOf('-')
// Get the substring before the first "-"
return dashIndex != -1 ? libraryVersion.substring(0, dashIndex) : libraryVersion
} }
task testSourceJar(type: Jar) { task testSourceJar(type: Jar) {

View File

@ -50,7 +50,6 @@ GETTER(jint, getScore)
GETTER(jstring, getSnippet) GETTER(jstring, getSnippet)
GETTER(jint, getWordCount) GETTER(jint, getWordCount)
GETTER(jint, getFileIndex) GETTER(jint, getFileIndex)
GETTER(jint, getSize)
METHOD0(jstring, getZimId) { METHOD0(jstring, getZimId) {
return TO_JNI(std::string(THIS->getZimId())); return TO_JNI(std::string(THIS->getZimId()));

View File

@ -30,7 +30,6 @@ public class SearchIterator implements Iterator<Entry>
public native String getSnippet(); public native String getSnippet();
public native int getWordCount(); public native int getWordCount();
public native int getFileIndex(); public native int getFileIndex();
public native int getSize();
public native String getZimId(); public native String getZimId();
public native boolean hasNext(); public native boolean hasNext();

View File

@ -32,7 +32,6 @@ public class TestSearchIterator implements Iterator<TestEntry>
public String getSnippet() { return inner.getSnippet(); } public String getSnippet() { return inner.getSnippet(); }
public int getWordCount() { return inner.getWordCount(); } public int getWordCount() { return inner.getWordCount(); }
public int getFileIndex() { return inner.getFileIndex(); } public int getFileIndex() { return inner.getFileIndex(); }
public int getSize() { return inner.getSize(); }
public String getZimId() { return inner.getZimId(); } public String getZimId() { return inner.getZimId(); }
public boolean hasNext() { return inner.hasNext(); } public boolean hasNext() { return inner.hasNext(); }

View File

@ -510,7 +510,6 @@ public class test {
assertEquals("<b>Test</b> ZIM file", iterator.getSnippet()); assertEquals("<b>Test</b> ZIM file", iterator.getSnippet());
assertEquals(3, iterator.getWordCount()); assertEquals(3, iterator.getWordCount());
assertEquals(0, iterator.getFileIndex()); assertEquals(0, iterator.getFileIndex());
assertEquals(-1, iterator.getSize());
assertEquals("e34f5109-ed0d-b93e-943d-06f7717c7340", iterator.getZimId()); assertEquals("e34f5109-ed0d-b93e-943d-06f7717c7340", iterator.getZimId());
TestEntry entry = iterator.next(); TestEntry entry = iterator.next();
assertEquals("main.html", entry.getPath()); assertEquals("main.html", entry.getPath());