@@ -351,8 +351,7 @@ public boolean compile(boolean _verbose) throws RunnerException, PreferencesMapE
351
351
sketchIsCompiled = false ;
352
352
353
353
// Hook runs at Start of Compilation
354
- if (prefs .containsKey ("recipe.hooks.prebuild" ))
355
- runRecipe ("recipe.hooks.prebuild" );
354
+ runActions ("hooks.prebuild" , prefs );
356
355
357
356
objectFiles = new ArrayList <File >();
358
357
@@ -422,9 +421,8 @@ public boolean compile(boolean _verbose) throws RunnerException, PreferencesMapE
422
421
423
422
progressListener .progress (90 );
424
423
425
- // Hook runs at End of Compilation
426
- if (prefs .containsKey ("recipe.hooks.postbuild" ))
427
- runRecipe ("recipe.hooks.postbuild" );
424
+ // Hook runs at End of Compilation
425
+ runActions ("hooks.postbuild" , prefs );
428
426
429
427
return true ;
430
428
}
@@ -1047,6 +1045,18 @@ void compileLink()
1047
1045
execAsynchronously (cmdArray );
1048
1046
}
1049
1047
1048
+ void runActions (String recipeClass , PreferencesMap prefs ) throws RunnerException , PreferencesMapException {
1049
+ List <String > patterns = new ArrayList <String >();
1050
+ for (String key : prefs .keySet ()) {
1051
+ if (key .startsWith ("recipe." +recipeClass ) && key .endsWith (".pattern" ))
1052
+ patterns .add (key );
1053
+ }
1054
+ Collections .sort (patterns );
1055
+ for (String recipe : patterns ) {
1056
+ runRecipe (recipe );
1057
+ }
1058
+ }
1059
+
1050
1060
void runRecipe (String recipe ) throws RunnerException , PreferencesMapException {
1051
1061
PreferencesMap dict = new PreferencesMap (prefs );
1052
1062
dict .put ("ide_version" , "" + BaseNoGui .REVISION );
0 commit comments