|
28 | 28 |
|
29 | 29 | /**
|
30 | 30 | * A class to apply workarounds to installed packages. Workaround are done after
|
31 |
| - * installation and at usage of boards.txt or platform.txt file currently there |
32 |
| - * are noworkarounds for programmers.trx |
| 31 | + * installation on boards.txt or platform.txt programmers.txt files |
| 32 | + * Sloeber creates boards.sloeber.txt or platform.sloeber.txt |
| 33 | + * programmers.sloeber.txt files |
| 34 | + * |
| 35 | + * Sloeber tries to minimize workarounds in the code |
33 | 36 | *
|
34 | 37 | * The first line of the worked around files contain a key. A newer version of
|
35 | 38 | * sloeber that has a different workaround should change the key. This way the
|
|
42 | 45 | public class WorkAround extends Const {
|
43 | 46 | // Each time this class is touched consider changing the String below to enforce
|
44 | 47 | // updates
|
45 |
| - // for debugging I added the system time so the files get refresed at each run |
46 |
| - private static final String FIRST_SLOEBER_WORKAROUND_LINE = "#Sloeber created workaound file V1.04.test 02 "; |
47 |
| - // + String.valueOf(System.currentTimeMillis()); |
| 48 | + private static final String FIRST_SLOEBER_WORKAROUND_LINE = "#Sloeber created workaound file V1.04.test 03 "; |
48 | 49 |
|
49 | 50 | /**
|
50 | 51 | * workarounds done at installation time. I try to keep those at a minimum but
|
@@ -268,6 +269,9 @@ private static String platformApplyCustomWorkArounds(String inPlatformTxt) {
|
268 | 269 | platformTXT = platformTXT.replace(" -DVARIANT_H=\"{build.variant_h}\"",
|
269 | 270 | " \"-DVARIANT_H=\\\"{build.variant_h}\\\"\"");
|
270 | 271 |
|
| 272 | + // for ESP32 remove the build options fix for arduino ide #1390 |
| 273 | + platformTXT = platformTXT.replace(" \"@{build.opt.path}\" ", " "); |
| 274 | + |
271 | 275 | return platformTXT;
|
272 | 276 | }
|
273 | 277 |
|
@@ -366,9 +370,9 @@ private static String platformApplyStandardWorkArounds(String inPlatformTxt) {
|
366 | 370 | while (regex_macher.find()) {
|
367 | 371 | String origLine = platformTXT.substring(regex_macher.start(), regex_macher.end());
|
368 | 372 | String workedAroundLine = origLine.replace("(?:", "(");
|
369 |
| - String badSuffix="\\s+([0-9]+).*"; |
370 |
| - if(workedAroundLine.endsWith(badSuffix)) { |
371 |
| - workedAroundLine=workedAroundLine.substring(0, workedAroundLine.length()-badSuffix.length()); |
| 373 | + String badSuffix = "\\s+([0-9]+).*"; |
| 374 | + if (workedAroundLine.endsWith(badSuffix)) { |
| 375 | + workedAroundLine = workedAroundLine.substring(0, workedAroundLine.length() - badSuffix.length()); |
372 | 376 | }
|
373 | 377 | if (!origLine.equals(workedAroundLine)) {
|
374 | 378 | replaceInfo.put(origLine, workedAroundLine);
|
|
0 commit comments