From c7aad36143a3cdac71103a752cdeffc6733bdf6d Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Thu, 18 Jan 2024 18:49:24 +0530 Subject: [PATCH] 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. --- lib/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/build.gradle b/lib/build.gradle index 9e04db4..129860d 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -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)