mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-08-04 03:26:08 -04:00
commit
4a8e966e5d
@ -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
|
||||
* 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)
|
||||
|
||||
|
||||
1.0.0
|
||||
* NEW: Moved wrapper from libkiwix to java-libkiwix.
|
||||
* NEW: Adapted new build system.
|
||||
|
@ -19,12 +19,12 @@ ext["sonatypeStagingProfileId"] = properties.getProperty("sonatypeStagingProfile
|
||||
ext {
|
||||
set("GROUP_ID", "org.kiwix")
|
||||
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
|
||||
ext.libkiwix_version = "13.0.0"
|
||||
ext.libzim_version = "9.0.0"
|
||||
ext.libkiwix_version = "13.0.0-1"
|
||||
ext.libzim_version = "9.1.0"
|
||||
|
||||
apply from: 'publish.gradle'
|
||||
android {
|
||||
@ -146,17 +146,24 @@ task copyLibzimHeaderAndSoFiles(type: Copy) {
|
||||
|
||||
copy {
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
task renameLibzimSoFile(type: Copy) {
|
||||
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)
|
||||
include "libzim.so." + libzim_version
|
||||
include "libzim.so." + finalLibzimVersion
|
||||
destinationDir file(buildDir.path)
|
||||
rename "libzim.so." + libzim_version, "libzim.so"
|
||||
rename "libzim.so." + finalLibzimVersion, "libzim.so"
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,20 +247,36 @@ task copyLibkiwixHeaderAndSoFiles(type: Copy) {
|
||||
|
||||
copy {
|
||||
// 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
|
||||
}
|
||||
}
|
||||
|
||||
task renameLibkiwixSoFile(type: Copy) {
|
||||
if (libkiwix_version != null) {
|
||||
def finalLibkiwixVersion = getActualLibraryVersion(libkiwix_version)
|
||||
def sourceFile = file(buildDir.path + "/libkiwix.so." + finalLibkiwixVersion)
|
||||
|
||||
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." + libkiwix_version
|
||||
include "libkiwix.so." + finalLibkiwixVersion
|
||||
destinationDir file(buildDir.path)
|
||||
rename "libkiwix.so." + libkiwix_version, "libkiwix.so"
|
||||
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) {
|
||||
from android.sourceSets.test.java.srcDirs
|
||||
archiveName = 'test-sources.jar'
|
||||
|
@ -50,7 +50,6 @@ GETTER(jint, getScore)
|
||||
GETTER(jstring, getSnippet)
|
||||
GETTER(jint, getWordCount)
|
||||
GETTER(jint, getFileIndex)
|
||||
GETTER(jint, getSize)
|
||||
|
||||
METHOD0(jstring, getZimId) {
|
||||
return TO_JNI(std::string(THIS->getZimId()));
|
||||
|
@ -30,7 +30,6 @@ public class SearchIterator implements Iterator<Entry>
|
||||
public native String getSnippet();
|
||||
public native int getWordCount();
|
||||
public native int getFileIndex();
|
||||
public native int getSize();
|
||||
public native String getZimId();
|
||||
|
||||
public native boolean hasNext();
|
||||
|
@ -32,7 +32,6 @@ public class TestSearchIterator implements Iterator<TestEntry>
|
||||
public String getSnippet() { return inner.getSnippet(); }
|
||||
public int getWordCount() { return inner.getWordCount(); }
|
||||
public int getFileIndex() { return inner.getFileIndex(); }
|
||||
public int getSize() { return inner.getSize(); }
|
||||
public String getZimId() { return inner.getZimId(); }
|
||||
|
||||
public boolean hasNext() { return inner.hasNext(); }
|
||||
|
@ -510,7 +510,6 @@ public class test {
|
||||
assertEquals("<b>Test</b> ZIM file", iterator.getSnippet());
|
||||
assertEquals(3, iterator.getWordCount());
|
||||
assertEquals(0, iterator.getFileIndex());
|
||||
assertEquals(-1, iterator.getSize());
|
||||
assertEquals("e34f5109-ed0d-b93e-943d-06f7717c7340", iterator.getZimId());
|
||||
TestEntry entry = iterator.next();
|
||||
assertEquals("main.html", entry.getPath());
|
||||
|
Loading…
x
Reference in New Issue
Block a user