From 2b82ea4026636711c65ccd9a27174f0509000f74 Mon Sep 17 00:00:00 2001 From: Yanis HAMOUDI <yanis.hamoudi@etu.u-pec.fr> Date: Sun, 16 Mar 2025 17:54:19 +0100 Subject: [PATCH] =?UTF-8?q?Suppression=20des=20v=C3=A9rifications=20de=20c?= =?UTF-8?q?hemins=20avec=20tilde=20pour=20les=20d=C3=A9pendances=20et=20le?= =?UTF-8?q?s=20r=C3=A8gles=20afin=20de=20correspondre=20au=20comportement?= =?UTF-8?q?=20de=20make?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monlouyan/bakefile/CommandExecutor.java | 3 --- .../bakefile/DependencyResolver.java | 16 +-------------- src/fr/monlouyan/bakefile/Rule.java | 20 ------------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/fr/monlouyan/bakefile/CommandExecutor.java b/src/fr/monlouyan/bakefile/CommandExecutor.java index 4a1e565..736de20 100644 --- a/src/fr/monlouyan/bakefile/CommandExecutor.java +++ b/src/fr/monlouyan/bakefile/CommandExecutor.java @@ -56,9 +56,6 @@ public class CommandExecutor { // Vérifier les timestamps des dépendances pour détecter ceux dans le futur for (String dependency : rule.getDependencies()) { - if (dependency.startsWith("~")) { - continue; - } File depFile = new File(dependency); if (depFile.exists() && TimestampManager.getTimestamp(depFile) > System.currentTimeMillis()) { diff --git a/src/fr/monlouyan/bakefile/DependencyResolver.java b/src/fr/monlouyan/bakefile/DependencyResolver.java index e6f51ed..4680739 100644 --- a/src/fr/monlouyan/bakefile/DependencyResolver.java +++ b/src/fr/monlouyan/bakefile/DependencyResolver.java @@ -75,13 +75,7 @@ public class DependencyResolver { // Construire la liste finale des règles dans l'ordre for (String ruleName : buildOrder) { - // Skip rules with tilde in path (home directory) to match make behavior - if (ruleName.startsWith("~")) { - if (debug) { - System.out.println("Debug: Skipping home directory path in resolution: " + ruleName); - } - continue; - } + Rule rule = ruleMap.get(ruleName); if (rule != null) { @@ -108,10 +102,6 @@ public class DependencyResolver { // D'abord traiter les dépendances for (String dep : rule.getDependencies()) { - // Skip dependencies with tilde in path - if (dep.startsWith("~")) { - continue; - } topologicalSort(dep, processed, buildOrder); } @@ -147,10 +137,6 @@ public class DependencyResolver { if (rule != null) { List<String> dependenciesCopy = new ArrayList<>(rule.getDependencies()); for (String dependency : dependenciesCopy) { - // Skip dependencies with tilde in path - if (dependency.startsWith("~")) { - continue; - } if (ruleMap.containsKey(dependency)) { detectCycle(dependency, visited, stack, ruleName); diff --git a/src/fr/monlouyan/bakefile/Rule.java b/src/fr/monlouyan/bakefile/Rule.java index f4c1d4a..9a23cd1 100644 --- a/src/fr/monlouyan/bakefile/Rule.java +++ b/src/fr/monlouyan/bakefile/Rule.java @@ -108,20 +108,8 @@ public class Rule { return true; } - // Skip targets with tilde in path (home directory) to match make behavior - if (name.startsWith("~")) { - if (BakeCLI.isDebug()) { - System.out.println("Debug : Skipping home directory path: " + name); - } - return false; - } - // Vérifier d'abord toutes les dépendances avant d'exécuter quoi que ce soit for (String dependency : dependencies) { - // Skip dependencies with tilde in path - if (dependency.startsWith("~")) { - continue; - } File depFile = new File(cleanFileName(dependency)); boolean hasRule = BakeEngine.hasRule(dependency); @@ -143,10 +131,6 @@ public class Rule { // Si la règle n'a pas de commandes, on vérifie seulement si une dépendance doit être mise à jour if (commands.isEmpty()) { for (String dependency : dependencies) { - // Skip dependencies with tilde in path - if (dependency.startsWith("~")) { - continue; - } Rule depRule = BakeEngine.getRule(dependency); if (depRule != null && depRule.needsUpdate()) { @@ -173,10 +157,6 @@ public class Rule { long currentTime = System.currentTimeMillis(); for (String dependency : dependencies) { - // Skip dependencies with tilde in path - if (dependency.startsWith("~")) { - continue; - } File depFile = new File(cleanFileName(dependency)); if (!depFile.exists()) {