Removed different tasks for coping libzim,libkiwix headers and .so files

This commit is contained in:
MohitMaliFtechiz 2023-03-28 18:38:32 +05:30 committed by Matthieu Gautier
parent f2dfa01a72
commit cee67f6129
3 changed files with 66 additions and 72 deletions

View File

@ -15,7 +15,7 @@ printf "${Green}Downloading libzim ${NC}\n"
printf "\n${Green}Done! ${NC}\n" printf "\n${Green}Done! ${NC}\n"
printf "${Green}Coping libzim header and so files ${NC}\n" printf "${Green}Coping libzim header and so files ${NC}\n"
./gradlew checkCurrentLibzimDate checkCurrentLinuxLibzimDate copyLibzimHeaderFiles copyLibzimAndroidArm copyLibzimAndroidArm64 copyLibzimAndroidx86 copyLibzimAndroidx86_64 copyLibzimLinux_x86_64 renameLibzimSoFile ./gradlew checkCurrentLibzimDate checkCurrentLinuxLibzimDate copyLibzimHeaderAndSoFiles renameLibzimSoFile
printf "\n${Green}Down! ${NC}\n" printf "\n${Green}Down! ${NC}\n"
printf "${Green}Downloading libkiwix ${NC}\n" printf "${Green}Downloading libkiwix ${NC}\n"
@ -23,5 +23,5 @@ printf "${Green}Downloading libkiwix ${NC}\n"
printf "\n${Green}Done! ${NC}\n" printf "\n${Green}Done! ${NC}\n"
printf "${Green}Coping libkiwix header and so files ${NC}\n" printf "${Green}Coping libkiwix header and so files ${NC}\n"
./gradlew checkCurrentLibkiwixDate checkCurrentLinuxLibkiwixDate copyLibkiwixHeaderFiles copyLibkiwixAndroidArm copyLibkiwixAndroidArm64 copyLibkiwixAndroidx86 copyLibkiwixAndroidx86_64 copyLibkiwixLinux_x86_64 renameLibkiwixSoFile ./gradlew checkCurrentLibkiwixDate checkCurrentLinuxLibkiwixDate copyLibkiwixHeaderAndSoFiles renameLibkiwixSoFile
printf "\n${Green}Done! ${NC}\n" printf "\n${Green}Done! ${NC}\n"

View File

@ -124,42 +124,44 @@ task unzipLibzim(type: Copy) {
into buildDir into buildDir
} }
task copyLibzimHeaderFiles(type: Copy) { task copyLibzimHeaderAndSoFiles(type: Copy) {
copy {
// copying header file // copying header file
from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/include/' from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/include/'
into buildDir.path + "/include/libzim/" into buildDir.path + "/include/libzim/"
} }
task copyLibzimAndroidArm(type: Copy) { copy {
// copying android_arm so file // copying android_arm so file
from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/lib/arm-linux-androideabi/' from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/lib/arm-linux-androideabi/'
into buildDir.path + "/jniLibs/armeabi-v7a/libzim/" into buildDir.path + "/jniLibs/armeabi-v7a/libzim/"
} }
task copyLibzimAndroidArm64(type: Copy) { copy {
// copying android_arm64 so file // copying android_arm64 so file
from buildDir.path + "/libzim_android-arm64-" + nightly_date_for_libzim + '/lib/aarch64-linux-android/' from buildDir.path + "/libzim_android-arm64-" + nightly_date_for_libzim + '/lib/aarch64-linux-android/'
into buildDir.path + "/jniLibs/arm64-v8a/libzim/" into buildDir.path + "/jniLibs/arm64-v8a/libzim/"
} }
task copyLibzimAndroidx86(type: Copy) { copy {
// copying android_x86 so file // copying android_x86 so file
from buildDir.path + "/libzim_android-x86-" + nightly_date_for_libzim + '/lib/i686-linux-android/' from buildDir.path + "/libzim_android-x86-" + nightly_date_for_libzim + '/lib/i686-linux-android/'
into buildDir.path + "/jniLibs/x86/libzim/" into buildDir.path + "/jniLibs/x86/libzim/"
} }
task copyLibzimAndroidx86_64(type: Copy) { copy {
// copying android_x86_64 so file // copying android_x86_64 so file
from buildDir.path + "/libzim_android-x86_64-" + nightly_date_for_libzim + '/lib/x86_64-linux-android/' from buildDir.path + "/libzim_android-x86_64-" + nightly_date_for_libzim + '/lib/x86_64-linux-android/'
into buildDir.path + "/jniLibs/x86_64/libzim/" into buildDir.path + "/jniLibs/x86_64/libzim/"
} }
task copyLibzimLinux_x86_64(type: Copy) { copy {
// copying linux_x86_64 so file // copying linux_x86_64 so file
project.ext.set("libzim_version", getFileFromFolder(buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/")) project.ext.set("libzim_version", getFileFromFolder(buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/"))
from buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/" + libzim_version from buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/" + libzim_version
into buildDir.path into buildDir.path
} }
}
task renameLibzimSoFile(type: Copy) { task renameLibzimSoFile(type: Copy) {
if (libzim_version != null) { if (libzim_version != null) {
@ -219,42 +221,44 @@ task unzipLibkiwix(type: Copy) {
into buildDir into buildDir
} }
task copyLibkiwixHeaderFiles(type: Copy) { task copyLibkiwixHeaderAndSoFiles(type: Copy) {
copy {
// copying header file // copying header file
from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/include/kiwix/' from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/include/kiwix/'
into buildDir.path + "/include/libkiwix/" into buildDir.path + "/include/libkiwix/"
} }
task copyLibkiwixAndroidArm(type: Copy) { copy {
// copying android_arm so file // copying android_arm so file
from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/lib/arm-linux-androideabi/' from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/lib/arm-linux-androideabi/'
into buildDir.path + "/jniLibs/armeabi-v7a/libkiwix/" into buildDir.path + "/jniLibs/armeabi-v7a/libkiwix/"
} }
task copyLibkiwixAndroidArm64(type: Copy) { copy {
// copying android_arm64 so file // copying android_arm64 so file
from buildDir.path + "/libkiwix_android-arm64-" + nightly_date_for_libkiwix + '/lib/aarch64-linux-android/' from buildDir.path + "/libkiwix_android-arm64-" + nightly_date_for_libkiwix + '/lib/aarch64-linux-android/'
into buildDir.path + "/jniLibs/arm64-v8a/libkiwix/" into buildDir.path + "/jniLibs/arm64-v8a/libkiwix/"
} }
task copyLibkiwixAndroidx86(type: Copy) { copy {
// copying android_x86 so file // copying android_x86 so file
from buildDir.path + "/libkiwix_android-x86-" + nightly_date_for_libkiwix + '/lib/i686-linux-android/' from buildDir.path + "/libkiwix_android-x86-" + nightly_date_for_libkiwix + '/lib/i686-linux-android/'
into buildDir.path + "/jniLibs/x86/libkiwix/" into buildDir.path + "/jniLibs/x86/libkiwix/"
} }
task copyLibkiwixAndroidx86_64(type: Copy) { copy {
// copying android_x86_64 so file // copying android_x86_64 so file
from buildDir.path + "/libkiwix_android-x86_64-" + nightly_date_for_libkiwix + '/lib/x86_64-linux-android/' from buildDir.path + "/libkiwix_android-x86_64-" + nightly_date_for_libkiwix + '/lib/x86_64-linux-android/'
into buildDir.path + "/jniLibs/x86_64/libkiwix/" into buildDir.path + "/jniLibs/x86_64/libkiwix/"
} }
task copyLibkiwixLinux_x86_64(type: Copy) { copy {
// copying linux_x86_64 so file // copying linux_x86_64 so file
project.ext.set("libkiwix_version", getFileFromFolder(buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/")) project.ext.set("libkiwix_version", getFileFromFolder(buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/"))
from buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/" + libkiwix_version from buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/" + libkiwix_version
into buildDir.path into buildDir.path
} }
}
static String getFileFromFolder(String path) { static String getFileFromFolder(String path) {
File folderFile = new File(path) File folderFile = new File(path)
@ -275,12 +279,6 @@ task renameLibkiwixSoFile(type: Copy) {
} }
} }
task copyBuildKiwixSoFile(type: Copy) {
// copying linux_x86_64 so file
from projectDir.path + "/src/test/libbuildkiwix.so"
into buildDir.path
}
task createCodeCoverageReport(type: Exec) { task createCodeCoverageReport(type: Exec) {
workingDir "${projectDir}/src/test/" workingDir "${projectDir}/src/test/"
commandLine 'sh', '-c', "bash 'compile_and_run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir" commandLine 'sh', '-c', "bash 'compile_and_run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir"

View File

@ -9,10 +9,6 @@ die()
exit 1 exit 1
} }
# This is for building wrapper so file
cmake .
make
# Copy generated .so file to build directory to run test cases # Copy generated .so file to build directory to run test cases
cd ../../../ cd ../../../
./gradlew copyBuildKiwixSoFile ./gradlew copyBuildKiwixSoFile