Ajout de la gestion des timestamps pour les fichiers cibles et dépendances, avec des messages de débogage pour faciliter le suivi des modifications.

This commit is contained in:
2025-02-06 17:54:18 +01:00
parent 459c681a00
commit 5775eee448
2 changed files with 22 additions and 0 deletions

View File

@@ -101,9 +101,18 @@ public class Rule {
System.out.println("Debug : Checking if target file " + name + " exist and is up to date");
}
long targetTimestamp = targetFile.exists() ? TimestampManager.getTimestamp(targetFile) : 0;
if (BakeCLI.isDebug()) {
System.out.println("Debug : Target file '" + name + "' last modified at " + TimestampManager.formatTimestamp(targetTimestamp));
}
for (String dependency : dependencies) {
File depFile = new File(dependency);
long depTimestamp = depFile.exists() ? TimestampManager.getTimestamp(depFile) : 0;
if (BakeCLI.isDebug()) {
System.out.println("Debug : Dependency '" + dependency + "' last modified at " + TimestampManager.formatTimestamp(depTimestamp));
}
if (!depFile.exists() && !dependency.isEmpty()) {
System.out.println("bake: *** No rule to make target '" + dependency + "', needed by '" + name + "'. Stop.");