45
45
public class WorkAround extends Const {
46
46
// Each time this class is touched consider changing the String below to enforce
47
47
// updates
48
- private static final String FIRST_SLOEBER_WORKAROUND_LINE = "#Sloeber created TXT file V2.00.test 04 " ;
48
+ private static final String FIRST_SLOEBER_WORKAROUND_LINE = "#Sloeber created TXT file V2.00.test 07 " ;
49
49
50
50
/**
51
51
* workarounds done at installation time. I try to keep those at a minimum but
@@ -320,39 +320,43 @@ private static String platformApplyStandardWorkArounds(String inPlatformTxt) {
320
320
321
321
String origRecipe = findLineStartingWith (platformTXT , RECIPE_C_to_O );
322
322
if (null != origRecipe ) {
323
- String changed = origRecipe .replace ("\" {source_file}\" " , "{INPUTS}" );
324
- changed = changed .replace ("\" {object_file}\" " , "{OUTPUT}" );
325
- changed = changed .replace ("{includes}" , "{FLAGS} -D__IN_ECLIPSE__=1" );
326
- changed = changed + " {sloeber.extra.compile} {sloeber.extra.c.compile} {sloeber.extra.all}" ;
323
+ String changed = origRecipe + " " ;
324
+ changed = changed .replace (" \" {source_file}\" " , " {INPUTS} " );
325
+ changed = changed .replace (" \" {object_file}\" " , " {OUTPUT} " );
326
+ changed = changed .replace (" {includes} " , " {FLAGS} -D__IN_ECLIPSE__=1 " );
327
+ changed = changed + "{sloeber.extra.compile} {sloeber.extra.c.compile} {sloeber.extra.all}" ;
327
328
platformTXT = platformTXT .replace (origRecipe , changed );
328
329
}
329
330
330
331
origRecipe = findLineStartingWith (platformTXT , RECIPE_CPP_to_O );
331
332
if (null != origRecipe ) {
332
- String changed = origRecipe .replace ("\" {source_file}\" " , "{INPUTS}" );
333
- changed = changed .replace ("\" {object_file}\" " , "{OUTPUT}" );
334
- changed = changed .replace ("{includes}" , "{FLAGS} -D__IN_ECLIPSE__=1" );
335
- changed = changed + " {sloeber.extra.compile} {sloeber.extra.cpp.compile} {sloeber.extra.all}" ;
333
+ String changed = origRecipe + " " ;
334
+ changed = changed .replace (" \" {source_file}\" " , " {INPUTS} " );
335
+ changed = changed .replace (" \" {object_file}\" " , " {OUTPUT} " );
336
+ changed = changed .replace (" {includes} " , " {FLAGS} -D__IN_ECLIPSE__=1 " );
337
+ changed = changed + "{sloeber.extra.compile} {sloeber.extra.cpp.compile} {sloeber.extra.all}" ;
336
338
platformTXT = platformTXT .replace (origRecipe , changed );
337
339
}
338
340
339
341
origRecipe = findLineStartingWith (platformTXT , RECIPE_S_to_O );
340
342
if (null != origRecipe ) {
341
- String changed = origRecipe .replace ("\" {source_file}\" " , "{INPUTS}" );
342
- changed = changed .replace ("\" {object_file}\" " , "{OUTPUT}" );
343
- changed = changed .replace ("{includes}" , "{FLAGS} -D__IN_ECLIPSE__=1" );
344
- changed = changed + " {sloeber.extra.assembly} {sloeber.extra.all}" ;
343
+ String changed = origRecipe + " " ;
344
+ changed = changed .replace (" \" {source_file}\" " , " {INPUTS} " );
345
+ changed = changed .replace (" \" {object_file}\" " , " {OUTPUT} " );
346
+ changed = changed .replace (" {includes} " , " {FLAGS} -D__IN_ECLIPSE__=1 " );
347
+ changed = changed + "{sloeber.extra.assembly} {sloeber.extra.all}" ;
345
348
platformTXT = platformTXT .replace (origRecipe , changed );
346
349
}
347
350
348
351
origRecipe = findLineStartingWith (platformTXT , RECIPE_AR );
349
352
if (null != origRecipe ) {
350
353
//archives should get a different key but for now I didn't get that to work
351
- String changed = origRecipe .replace ("\" {archive_file_path}\" " , "{OUTPUT}" );
352
- changed = changed .replace ("{archive_file_path}" , "{OUTPUT}" );
353
- changed = changed .replace ("\" {object_file}\" " , "{INPUTS}" );
354
- changed = changed .replace ("{object_file}" , "{INPUTS}" );
355
- changed = changed + " {sloeber.extra_archive} {sloeber.extra_all}" ;
354
+ String changed = origRecipe + " " ;
355
+ changed = changed .replace (" \" {archive_file_path}\" " , " {OUTPUT} " );
356
+ changed = changed .replace (" {archive_file_path} " , " {OUTPUT} " );
357
+ changed = changed .replace (" \" {object_file}\" " , " {INPUTS} " );
358
+ changed = changed .replace (" {object_file} " , " {INPUTS} " );
359
+ changed = changed + "{sloeber.extra_archive} {sloeber.extra_all}" ;
356
360
platformTXT = platformTXT .replace (origRecipe , changed );
357
361
}
358
362
@@ -361,13 +365,14 @@ private static String platformApplyStandardWorkArounds(String inPlatformTxt) {
361
365
// the fix below seems no longer needed but is still on august 2021
362
366
// Arduino treats core differently so we need to change the location of directly
363
367
// referenced files this manifests only in the combine recipe
364
- String changed = origRecipe .replaceAll ("(\\ {build\\ .path})(/core)?/sys" , "$1/core/core/sys" );
368
+ String changed = origRecipe .replaceAll ("(\\ {build\\ .path})(/core)?/sys" , "$1/core/core/sys" ) + " " ;
365
369
366
- changed = changed .replace (" \" {build.path}/{archive_file}\" " , " {ARCHIVES}" );
367
- changed = changed .replace (" {object_files}" , " ${FLAGS} {INPUTS}" );
370
+ changed = changed .replace (" \" {build.path}/{archive_file}\" " , " {ARCHIVES} " );
371
+ changed = changed .replace (" \" {archive_file_path}\" " , " {ARCHIVES} " );
372
+ changed = changed .replace (" {object_files} " , " {FLAGS} {INPUTS} " );
368
373
String [] splits = changed .split ("=" , 2 );
369
374
changed = splits [0 ] + "={sloeber.pre.link}" + splits [1 ]
370
- + " {sloeber.extra_all} {sloeber.extra.link}{sloeber.post.link}" ;
375
+ + "{sloeber.extra_all} {sloeber.extra.link}{sloeber.post.link}" ;
371
376
platformTXT = platformTXT .replace (origRecipe , changed );
372
377
}
373
378
0 commit comments