Displaying an error in the Install Dependencies task when no file is available for renaming.

* We have incorporated an additional validation check to verify the existence of the file during the copy/rename process. By default, the copy operation does not raise an error if the source file is unavailable.
This commit is contained in:
MohitMaliFtechiz 2024-01-18 18:49:24 +05:30
parent 435cf3a302
commit c7aad36143

View File

@ -153,6 +153,11 @@ task copyLibzimHeaderAndSoFiles(type: Copy) {
task renameLibzimSoFile(type: Copy) {
if (libzim_version != null) {
def sourceFile = file(buildDir.path + "/libzim.so." + libzim_version)
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
destinationDir file(buildDir.path)
@ -247,6 +252,11 @@ task copyLibkiwixHeaderAndSoFiles(type: Copy) {
task renameLibkiwixSoFile(type: Copy) {
if (libkiwix_version != null) {
def sourceFile = file(buildDir.path + "/libkiwix.so." + libkiwix_version)
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
destinationDir file(buildDir.path)