@@ -511,7 +511,7 @@ private List<File> compileFiles(File outputPath, File sourcePath,
511511 for (File file : sSources ) {
512512 File objectFile = new File (outputPath , file .getName () + ".o" );
513513 objectPaths .add (objectFile );
514- String [] cmd = getCommandCompilerS (includeFolders , file , objectFile );
514+ String [] cmd = getCommandCompilerByRecipe (includeFolders , file , objectFile , "recipe.S.o.pattern" );
515515 execAsynchronously (cmd );
516516 }
517517
@@ -521,7 +521,7 @@ private List<File> compileFiles(File outputPath, File sourcePath,
521521 objectPaths .add (objectFile );
522522 if (isAlreadyCompiled (file , objectFile , dependFile , prefs ))
523523 continue ;
524- String [] cmd = getCommandCompilerC (includeFolders , file , objectFile );
524+ String [] cmd = getCommandCompilerByRecipe (includeFolders , file , objectFile , "recipe.c.o.pattern" );
525525 execAsynchronously (cmd );
526526 }
527527
@@ -531,7 +531,7 @@ private List<File> compileFiles(File outputPath, File sourcePath,
531531 objectPaths .add (objectFile );
532532 if (isAlreadyCompiled (file , objectFile , dependFile , prefs ))
533533 continue ;
534- String [] cmd = getCommandCompilerCPP (includeFolders , file , objectFile );
534+ String [] cmd = getCommandCompilerByRecipe (includeFolders , file , objectFile , "recipe.cpp.o.pattern" );
535535 execAsynchronously (cmd );
536536 }
537537
@@ -811,55 +811,15 @@ public void message(String s) {
811811 System .err .print (s );
812812 }
813813
814- private String [] getCommandCompilerS (List <File > includeFolders ,
815- File sourceFile , File objectFile )
816- throws RunnerException , PreferencesMapException {
817- String includes = prepareIncludes (includeFolders );
818- PreferencesMap dict = new PreferencesMap (prefs );
819- dict .put ("ide_version" , "" + BaseNoGui .REVISION );
820- dict .put ("includes" , includes );
821- dict .put ("source_file" , sourceFile .getAbsolutePath ());
822- dict .put ("object_file" , objectFile .getAbsolutePath ());
823-
824- String cmd = prefs .getOrExcept ("recipe.S.o.pattern" );
825- try {
826- return StringReplacer .formatAndSplit (cmd , dict , true );
827- } catch (Exception e ) {
828- throw new RunnerException (e );
829- }
830- }
831-
832- private String [] getCommandCompilerC (List <File > includeFolders ,
833- File sourceFile , File objectFile )
834- throws RunnerException , PreferencesMapException {
835- String includes = prepareIncludes (includeFolders );
836-
837- PreferencesMap dict = new PreferencesMap (prefs );
838- dict .put ("ide_version" , "" + BaseNoGui .REVISION );
839- dict .put ("includes" , includes );
840- dict .put ("source_file" , sourceFile .getAbsolutePath ());
841- dict .put ("object_file" , objectFile .getAbsolutePath ());
842-
843- String cmd = prefs .getOrExcept ("recipe.c.o.pattern" );
844- try {
845- return StringReplacer .formatAndSplit (cmd , dict , true );
846- } catch (Exception e ) {
847- throw new RunnerException (e );
848- }
849- }
850-
851- private String [] getCommandCompilerCPP (List <File > includeFolders ,
852- File sourceFile , File objectFile )
853- throws RunnerException , PreferencesMapException {
814+ private String [] getCommandCompilerByRecipe (List <File > includeFolders , File sourceFile , File objectFile , String recipe ) throws PreferencesMapException , RunnerException {
854815 String includes = prepareIncludes (includeFolders );
855-
856816 PreferencesMap dict = new PreferencesMap (prefs );
857817 dict .put ("ide_version" , "" + BaseNoGui .REVISION );
858818 dict .put ("includes" , includes );
859819 dict .put ("source_file" , sourceFile .getAbsolutePath ());
860820 dict .put ("object_file" , objectFile .getAbsolutePath ());
861821
862- String cmd = prefs .getOrExcept (" recipe.cpp.o.pattern" );
822+ String cmd = prefs .getOrExcept (recipe );
863823 try {
864824 return StringReplacer .formatAndSplit (cmd , dict , true );
865825 } catch (Exception e ) {
0 commit comments