Skip to content

Commit 14109ec

Browse files
author
MohitMaliFtechiz
committed
Removed different copying tasks
Earlier in gradle, There are so many tasks for copying headers and .so files of libzim, libkiwix. Now, we are copying everything in copyLibzimHeaderAndSoFiles, copyLibkiwixHeaderAndSoFiles tasks.
1 parent 392f544 commit 14109ec

3 files changed

Lines changed: 67 additions & 73 deletions

File tree

install_deps.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ printf "${Green}Downloading libzim ${NC}\n"
1515
printf "\n${Green}Done! ${NC}\n"
1616

1717
printf "${Green}Coping libzim header and so files ${NC}\n"
18-
./gradlew checkCurrentLibzimDate checkCurrentLinuxLibzimDate copyLibzimHeaderFiles copyLibzimAndroidArm copyLibzimAndroidArm64 copyLibzimAndroidx86 copyLibzimAndroidx86_64 copyLibzimLinux_x86_64 renameLibzimSoFile
18+
./gradlew checkCurrentLibzimDate checkCurrentLinuxLibzimDate copyLibzimHeaderAndSoFiles renameLibzimSoFile
1919
printf "\n${Green}Down! ${NC}\n"
2020

2121
printf "${Green}Downloading libkiwix ${NC}\n"
2222
./gradlew downloadLibkiwixSoAndHeaderFiles unzipLibkiwix
2323
printf "\n${Green}Done! ${NC}\n"
2424

2525
printf "${Green}Coping libkiwix header and so files ${NC}\n"
26-
./gradlew checkCurrentLibkiwixDate checkCurrentLinuxLibkiwixDate copyLibkiwixHeaderFiles copyLibkiwixAndroidArm copyLibkiwixAndroidArm64 copyLibkiwixAndroidx86 copyLibkiwixAndroidx86_64 copyLibkiwixLinux_x86_64 renameLibkiwixSoFile
27-
printf "\n${Green}Done! ${NC}\n"
26+
./gradlew checkCurrentLibkiwixDate checkCurrentLinuxLibkiwixDate copyLibkiwixHeaderAndSoFiles renameLibkiwixSoFile
27+
printf "\n${Green}Done! ${NC}\n"

lib/build.gradle

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -126,41 +126,43 @@ task unzipLibzim(type: Copy) {
126126
into buildDir
127127
}
128128

129-
task copyLibzimHeaderFiles(type: Copy) {
130-
// copying header file
131-
from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/include/'
132-
into buildDir.path + "/include/libzim/"
133-
}
129+
task copyLibzimHeaderAndSoFiles(type: Copy) {
130+
copy {
131+
// copying header file
132+
from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/include/'
133+
into buildDir.path + "/include/libzim/"
134+
}
134135

135-
task copyLibzimAndroidArm(type: Copy) {
136-
// copying android_arm so file
137-
from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/lib/arm-linux-androideabi/'
138-
into buildDir.path + "/jniLibs/armeabi-v7a/libzim/"
139-
}
136+
copy {
137+
// copying android_arm so file
138+
from buildDir.path + "/libzim_android-arm-" + nightly_date_for_libzim + '/lib/arm-linux-androideabi/'
139+
into buildDir.path + "/jniLibs/armeabi-v7a/libzim/"
140+
}
140141

141-
task copyLibzimAndroidArm64(type: Copy) {
142-
// copying android_arm64 so file
143-
from buildDir.path + "/libzim_android-arm64-" + nightly_date_for_libzim + '/lib/aarch64-linux-android/'
144-
into buildDir.path + "/jniLibs/arm64-v8a/libzim/"
145-
}
142+
copy {
143+
// copying android_arm64 so file
144+
from buildDir.path + "/libzim_android-arm64-" + nightly_date_for_libzim + '/lib/aarch64-linux-android/'
145+
into buildDir.path + "/jniLibs/arm64-v8a/libzim/"
146+
}
146147

147-
task copyLibzimAndroidx86(type: Copy) {
148-
// copying android_x86 so file
149-
from buildDir.path + "/libzim_android-x86-" + nightly_date_for_libzim + '/lib/i686-linux-android/'
150-
into buildDir.path + "/jniLibs/x86/libzim/"
151-
}
148+
copy {
149+
// copying android_x86 so file
150+
from buildDir.path + "/libzim_android-x86-" + nightly_date_for_libzim + '/lib/i686-linux-android/'
151+
into buildDir.path + "/jniLibs/x86/libzim/"
152+
}
152153

153-
task copyLibzimAndroidx86_64(type: Copy) {
154-
// copying android_x86_64 so file
155-
from buildDir.path + "/libzim_android-x86_64-" + nightly_date_for_libzim + '/lib/x86_64-linux-android/'
156-
into buildDir.path + "/jniLibs/x86_64/libzim/"
157-
}
154+
copy {
155+
// copying android_x86_64 so file
156+
from buildDir.path + "/libzim_android-x86_64-" + nightly_date_for_libzim + '/lib/x86_64-linux-android/'
157+
into buildDir.path + "/jniLibs/x86_64/libzim/"
158+
}
158159

159-
task copyLibzimLinux_x86_64(type: Copy) {
160-
// copying linux_x86_64 so file
161-
project.ext.set("libzim_version", getFileFromFolder(buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/"))
162-
from buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/" + libzim_version
163-
into buildDir.path
160+
copy {
161+
// copying linux_x86_64 so file
162+
project.ext.set("libzim_version", getFileFromFolder(buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/"))
163+
from buildDir.path + "/libzim_linux-x86_64-" + nightly_date_for_libzim_linux + "/lib/x86_64-linux-gnu/" + libzim_version
164+
into buildDir.path
165+
}
164166
}
165167

166168
task renameLibzimSoFile(type: Copy) {
@@ -221,41 +223,43 @@ task unzipLibkiwix(type: Copy) {
221223
into buildDir
222224
}
223225

224-
task copyLibkiwixHeaderFiles(type: Copy) {
225-
// copying header file
226-
from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/include/kiwix/'
227-
into buildDir.path + "/include/libkiwix/"
228-
}
226+
task copyLibkiwixHeaderAndSoFiles(type: Copy) {
227+
copy {
228+
// copying header file
229+
from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/include/kiwix/'
230+
into buildDir.path + "/include/libkiwix/"
231+
}
229232

230-
task copyLibkiwixAndroidArm(type: Copy) {
231-
// copying android_arm so file
232-
from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/lib/arm-linux-androideabi/'
233-
into buildDir.path + "/jniLibs/armeabi-v7a/libkiwix/"
234-
}
233+
copy {
234+
// copying android_arm so file
235+
from buildDir.path + "/libkiwix_android-arm-" + nightly_date_for_libkiwix + '/lib/arm-linux-androideabi/'
236+
into buildDir.path + "/jniLibs/armeabi-v7a/libkiwix/"
237+
}
235238

236-
task copyLibkiwixAndroidArm64(type: Copy) {
237-
// copying android_arm64 so file
238-
from buildDir.path + "/libkiwix_android-arm64-" + nightly_date_for_libkiwix + '/lib/aarch64-linux-android/'
239-
into buildDir.path + "/jniLibs/arm64-v8a/libkiwix/"
240-
}
239+
copy {
240+
// copying android_arm64 so file
241+
from buildDir.path + "/libkiwix_android-arm64-" + nightly_date_for_libkiwix + '/lib/aarch64-linux-android/'
242+
into buildDir.path + "/jniLibs/arm64-v8a/libkiwix/"
243+
}
241244

242-
task copyLibkiwixAndroidx86(type: Copy) {
243-
// copying android_x86 so file
244-
from buildDir.path + "/libkiwix_android-x86-" + nightly_date_for_libkiwix + '/lib/i686-linux-android/'
245-
into buildDir.path + "/jniLibs/x86/libkiwix/"
246-
}
245+
copy {
246+
// copying android_x86 so file
247+
from buildDir.path + "/libkiwix_android-x86-" + nightly_date_for_libkiwix + '/lib/i686-linux-android/'
248+
into buildDir.path + "/jniLibs/x86/libkiwix/"
249+
}
247250

248-
task copyLibkiwixAndroidx86_64(type: Copy) {
249-
// copying android_x86_64 so file
250-
from buildDir.path + "/libkiwix_android-x86_64-" + nightly_date_for_libkiwix + '/lib/x86_64-linux-android/'
251-
into buildDir.path + "/jniLibs/x86_64/libkiwix/"
252-
}
251+
copy {
252+
// copying android_x86_64 so file
253+
from buildDir.path + "/libkiwix_android-x86_64-" + nightly_date_for_libkiwix + '/lib/x86_64-linux-android/'
254+
into buildDir.path + "/jniLibs/x86_64/libkiwix/"
255+
}
253256

254-
task copyLibkiwixLinux_x86_64(type: Copy) {
255-
// copying linux_x86_64 so file
256-
project.ext.set("libkiwix_version", getFileFromFolder(buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/"))
257-
from buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/" + libkiwix_version
258-
into buildDir.path
257+
copy {
258+
// copying linux_x86_64 so file
259+
project.ext.set("libkiwix_version", getFileFromFolder(buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/"))
260+
from buildDir.path + "/libkiwix_linux-x86_64-" + nightly_date_for_libkiwix_linux + "/lib/x86_64-linux-gnu/" + libkiwix_version
261+
into buildDir.path
262+
}
259263
}
260264

261265
static String getFileFromFolder(String path) {
@@ -277,12 +281,6 @@ task renameLibkiwixSoFile(type: Copy) {
277281
}
278282
}
279283

280-
task copyBuildKiwixSoFile(type: Copy) {
281-
// copying linux_x86_64 so file
282-
from projectDir.path + "/src/test/libbuildkiwix.so"
283-
into buildDir.path
284-
}
285-
286284
task createCodeCoverageReport(type: Exec) {
287285
workingDir "${projectDir}/src/test/"
288286
commandLine 'sh', '-c', "bash 'compile_and_run_test.sh' ${buildDir}/libs/*lib*.jar $buildDir"

lib/src/test/compile_and_run_test.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ die()
99
exit 1
1010
}
1111

12-
# This is for building wrapper so file
13-
cmake .
14-
make
15-
1612
# Copy generated .so file to build directory to run test cases
1713
cd ../../../
1814
./gradlew copyBuildKiwixSoFile

0 commit comments

Comments
 (0)