From cee67f6129e5eeff99c0ca64ad159d31b17ac15d Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Tue, 28 Mar 2023 18:38:32 +0530 Subject: [PATCH] Removed different tasks for coping libzim,libkiwix headers and .so files --- install_deps.sh | 4 +- lib/build.gradle | 130 +++++++++++++-------------- lib/src/test/compile_and_run_test.sh | 4 - 3 files changed, 66 insertions(+), 72 deletions(-) diff --git a/install_deps.sh b/install_deps.sh index 6b58322..84a3a0e 100755 --- a/install_deps.sh +++ b/install_deps.sh @@ -15,7 +15,7 @@ printf "${Green}Downloading libzim ${NC}\n" printf "\n${Green}Done! ${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 "${Green}Downloading libkiwix ${NC}\n" @@ -23,5 +23,5 @@ printf "${Green}Downloading libkiwix ${NC}\n" printf "\n${Green}Done! ${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" diff --git a/lib/build.gradle b/lib/build.gradle index 293d345..861b268 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -124,41 +124,43 @@ task unzipLibzim(type: Copy) { into buildDir } -task copyLibzimHeaderFiles(type: Copy) { - // copying header file - from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/include/' - into buildDir.path + "/include/libzim/" -} +task copyLibzimHeaderAndSoFiles(type: Copy) { + copy { + // copying header file + from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/include/' + into buildDir.path + "/include/libzim/" + } -task copyLibzimAndroidArm(type: Copy) { - // copying android_arm so file - from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/lib/arm-linux-androideabi/' - into buildDir.path + "/jniLibs/armeabi-v7a/libzim/" -} + copy { + // copying android_arm so file + from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/lib/arm-linux-androideabi/' + into buildDir.path + "/jniLibs/armeabi-v7a/libzim/" + } -task copyLibzimAndroidArm64(type: Copy) { - // copying android_arm64 so file - from buildDir.path + "/libzim_android-arm64-" + nightly_date_for_libzim + '/lib/aarch64-linux-android/' - into buildDir.path + "/jniLibs/arm64-v8a/libzim/" -} + copy { + // copying android_arm64 so file + from buildDir.path + "/libzim_android-arm64-" + nightly_date_for_libzim + '/lib/aarch64-linux-android/' + into buildDir.path + "/jniLibs/arm64-v8a/libzim/" + } -task copyLibzimAndroidx86(type: Copy) { - // copying android_x86 so file - from buildDir.path + "/libzim_android-x86-" + nightly_date_for_libzim + '/lib/i686-linux-android/' - into buildDir.path + "/jniLibs/x86/libzim/" -} + copy { + // copying android_x86 so file + from buildDir.path + "/libzim_android-x86-" + nightly_date_for_libzim + '/lib/i686-linux-android/' + into buildDir.path + "/jniLibs/x86/libzim/" + } -task copyLibzimAndroidx86_64(type: Copy) { - // copying android_x86_64 so file - from buildDir.path + "/libzim_android-x86_64-" + nightly_date_for_libzim + '/lib/x86_64-linux-android/' - into buildDir.path + "/jniLibs/x86_64/libzim/" -} + copy { + // copying android_x86_64 so file + from buildDir.path + "/libzim_android-x86_64-" + nightly_date_for_libzim + '/lib/x86_64-linux-android/' + into buildDir.path + "/jniLibs/x86_64/libzim/" + } -task copyLibzimLinux_x86_64(type: Copy) { - // 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/")) - from buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/" + libzim_version - into buildDir.path + copy { + // 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/")) + from buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/" + libzim_version + into buildDir.path + } } task renameLibzimSoFile(type: Copy) { @@ -219,41 +221,43 @@ task unzipLibkiwix(type: Copy) { into buildDir } -task copyLibkiwixHeaderFiles(type: Copy) { - // copying header file - from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/include/kiwix/' - into buildDir.path + "/include/libkiwix/" -} +task copyLibkiwixHeaderAndSoFiles(type: Copy) { + copy { + // copying header file + from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/include/kiwix/' + into buildDir.path + "/include/libkiwix/" + } -task copyLibkiwixAndroidArm(type: Copy) { - // copying android_arm so file - from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/lib/arm-linux-androideabi/' - into buildDir.path + "/jniLibs/armeabi-v7a/libkiwix/" -} + copy { + // copying android_arm so file + from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/lib/arm-linux-androideabi/' + into buildDir.path + "/jniLibs/armeabi-v7a/libkiwix/" + } -task copyLibkiwixAndroidArm64(type: Copy) { - // copying android_arm64 so file - from buildDir.path + "/libkiwix_android-arm64-" + nightly_date_for_libkiwix + '/lib/aarch64-linux-android/' - into buildDir.path + "/jniLibs/arm64-v8a/libkiwix/" -} + copy { + // copying android_arm64 so file + from buildDir.path + "/libkiwix_android-arm64-" + nightly_date_for_libkiwix + '/lib/aarch64-linux-android/' + into buildDir.path + "/jniLibs/arm64-v8a/libkiwix/" + } -task copyLibkiwixAndroidx86(type: Copy) { - // copying android_x86 so file - from buildDir.path + "/libkiwix_android-x86-" + nightly_date_for_libkiwix + '/lib/i686-linux-android/' - into buildDir.path + "/jniLibs/x86/libkiwix/" -} + copy { + // copying android_x86 so file + from buildDir.path + "/libkiwix_android-x86-" + nightly_date_for_libkiwix + '/lib/i686-linux-android/' + into buildDir.path + "/jniLibs/x86/libkiwix/" + } -task copyLibkiwixAndroidx86_64(type: Copy) { - // copying android_x86_64 so file - from buildDir.path + "/libkiwix_android-x86_64-" + nightly_date_for_libkiwix + '/lib/x86_64-linux-android/' - into buildDir.path + "/jniLibs/x86_64/libkiwix/" -} + copy { + // copying android_x86_64 so file + from buildDir.path + "/libkiwix_android-x86_64-" + nightly_date_for_libkiwix + '/lib/x86_64-linux-android/' + into buildDir.path + "/jniLibs/x86_64/libkiwix/" + } -task copyLibkiwixLinux_x86_64(type: Copy) { - // 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/")) - from buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/" + libkiwix_version - into buildDir.path + copy { + // 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/")) + from buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/" + libkiwix_version + into buildDir.path + } } static String getFileFromFolder(String 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) { workingDir "${projectDir}/src/test/" commandLine 'sh', '-c', "bash 'compile_and_run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir" diff --git a/lib/src/test/compile_and_run_test.sh b/lib/src/test/compile_and_run_test.sh index e4337a2..97fc6d4 100755 --- a/lib/src/test/compile_and_run_test.sh +++ b/lib/src/test/compile_and_run_test.sh @@ -9,10 +9,6 @@ die() exit 1 } -# This is for building wrapper so file -cmake . -make - # Copy generated .so file to build directory to run test cases cd ../../../ ./gradlew copyBuildKiwixSoFile