@@ -511,7 +511,7 @@ private List<File> compileFiles(File outputPath, File sourcePath,
511
511
for (File file : sSources ) {
512
512
File objectFile = new File (outputPath , file .getName () + ".o" );
513
513
objectPaths .add (objectFile );
514
- String [] cmd = getCommandCompilerS (includeFolders , file , objectFile );
514
+ String [] cmd = getCommandCompilerByRecipe (includeFolders , file , objectFile , "recipe.S.o.pattern" );
515
515
execAsynchronously (cmd );
516
516
}
517
517
@@ -521,7 +521,7 @@ private List<File> compileFiles(File outputPath, File sourcePath,
521
521
objectPaths .add (objectFile );
522
522
if (isAlreadyCompiled (file , objectFile , dependFile , prefs ))
523
523
continue ;
524
- String [] cmd = getCommandCompilerC (includeFolders , file , objectFile );
524
+ String [] cmd = getCommandCompilerByRecipe (includeFolders , file , objectFile , "recipe.c.o.pattern" );
525
525
execAsynchronously (cmd );
526
526
}
527
527
@@ -531,7 +531,7 @@ private List<File> compileFiles(File outputPath, File sourcePath,
531
531
objectPaths .add (objectFile );
532
532
if (isAlreadyCompiled (file , objectFile , dependFile , prefs ))
533
533
continue ;
534
- String [] cmd = getCommandCompilerCPP (includeFolders , file , objectFile );
534
+ String [] cmd = getCommandCompilerByRecipe (includeFolders , file , objectFile , "recipe.cpp.o.pattern" );
535
535
execAsynchronously (cmd );
536
536
}
537
537
@@ -811,55 +811,15 @@ public void message(String s) {
811
811
System .err .print (s );
812
812
}
813
813
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 {
854
815
String includes = prepareIncludes (includeFolders );
855
-
856
816
PreferencesMap dict = new PreferencesMap (prefs );
857
817
dict .put ("ide_version" , "" + BaseNoGui .REVISION );
858
818
dict .put ("includes" , includes );
859
819
dict .put ("source_file" , sourceFile .getAbsolutePath ());
860
820
dict .put ("object_file" , objectFile .getAbsolutePath ());
861
821
862
- String cmd = prefs .getOrExcept (" recipe.cpp.o.pattern" );
822
+ String cmd = prefs .getOrExcept (recipe );
863
823
try {
864
824
return StringReplacer .formatAndSplit (cmd , dict , true );
865
825
} catch (Exception e ) {
0 commit comments