diff --git a/src/fr/monlouyan/bakefile/CommandExecutor.java b/src/fr/monlouyan/bakefile/CommandExecutor.java index 87ff678..0c46343 100644 --- a/src/fr/monlouyan/bakefile/CommandExecutor.java +++ b/src/fr/monlouyan/bakefile/CommandExecutor.java @@ -50,6 +50,7 @@ public class CommandExecutor { public void execute(Rule rule) { // On vérifie d'abord si cette règle a besoin d'être mise à jour boolean ruleNeedsUpdate = rule.needsUpdate(); + if (ruleNeedsUpdate) { needsUpdate = true; // Au moins une règle doit être mise à jour @@ -89,7 +90,7 @@ public class CommandExecutor { actualCommand = actualCommand.substring(1).trim(); } - if (isCircular){ + if (isCircular && needsUpdate){ if (!silent && displayLines != null && !displayLines.isEmpty()) { boolean isFirstLine = true; for (String line : displayLines) { diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/Bakefile b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/Bakefile new file mode 100644 index 0000000..396d522 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/Bakefile @@ -0,0 +1,27 @@ +# Variables +JC = javac +JFLAGS = -g + +# Cible par défaut +all: TestMain.class + +# Dépendance circulaire délibérée +FunctionA.class: FunctionA.java FunctionB.class + $(JC) $(JFLAGS) FunctionA.java + +FunctionB.class: FunctionB.java FunctionC.class + $(JC) $(JFLAGS) FunctionB.java + +FunctionC.class: FunctionC.java FunctionA.class + $(JC) $(JFLAGS) FunctionC.java + +# Cible principale +TestMain.class: TestMain.java FunctionA.class FunctionB.class FunctionC.class + $(JC) $(JFLAGS) TestMain.java + +# Nettoyage +clean: + rm -f *.class + +# Cibles spéciales +.PHONY: all clean \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionA.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionA.java new file mode 100644 index 0000000..4d02400 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionA.java @@ -0,0 +1,5 @@ +public class FunctionA { + public static void execute() { + System.out.println("Function A"); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionB.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionB.java new file mode 100644 index 0000000..f825c76 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionB.java @@ -0,0 +1,5 @@ +public class FunctionB { + public static void execute() { + System.out.println("Function B"); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionC.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionC.java new file mode 100644 index 0000000..ba332d3 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/FunctionC.java @@ -0,0 +1,5 @@ +public class FunctionC { + public static void execute() { + System.out.println("Function C"); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/TestMain.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/TestMain.java new file mode 100644 index 0000000..94dcf39 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/bake/TestMain.java @@ -0,0 +1,11 @@ +public class TestMain { + public static void main(String[] args) { + System.out.println("Lancement du programme de test..."); + + FunctionA.execute(); + FunctionB.execute(); + FunctionC.execute(); + + System.out.println("Programme de test effectué."); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionA.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionA.java new file mode 100644 index 0000000..4d02400 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionA.java @@ -0,0 +1,5 @@ +public class FunctionA { + public static void execute() { + System.out.println("Function A"); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionB.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionB.java new file mode 100644 index 0000000..f825c76 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionB.java @@ -0,0 +1,5 @@ +public class FunctionB { + public static void execute() { + System.out.println("Function B"); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionC.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionC.java new file mode 100644 index 0000000..ba332d3 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/FunctionC.java @@ -0,0 +1,5 @@ +public class FunctionC { + public static void execute() { + System.out.println("Function C"); + } +} \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/Makefile b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/Makefile new file mode 100644 index 0000000..396d522 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/Makefile @@ -0,0 +1,27 @@ +# Variables +JC = javac +JFLAGS = -g + +# Cible par défaut +all: TestMain.class + +# Dépendance circulaire délibérée +FunctionA.class: FunctionA.java FunctionB.class + $(JC) $(JFLAGS) FunctionA.java + +FunctionB.class: FunctionB.java FunctionC.class + $(JC) $(JFLAGS) FunctionB.java + +FunctionC.class: FunctionC.java FunctionA.class + $(JC) $(JFLAGS) FunctionC.java + +# Cible principale +TestMain.class: TestMain.java FunctionA.class FunctionB.class FunctionC.class + $(JC) $(JFLAGS) TestMain.java + +# Nettoyage +clean: + rm -f *.class + +# Cibles spéciales +.PHONY: all clean \ No newline at end of file diff --git a/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/TestMain.java b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/TestMain.java new file mode 100644 index 0000000..94dcf39 --- /dev/null +++ b/tests/tests-autres-groupes/lenny-khalid-thomas/test-6-Dependance-Circulaire/make/TestMain.java @@ -0,0 +1,11 @@ +public class TestMain { + public static void main(String[] args) { + System.out.println("Lancement du programme de test..."); + + FunctionA.execute(); + FunctionB.execute(); + FunctionC.execute(); + + System.out.println("Programme de test effectué."); + } +} \ No newline at end of file