@@ -152,7 +152,10 @@ public boolean needsRebuild(BoardDescription otherBoardDescriptor) {
152
152
if (!this .getBoardID ().equals (otherBoardDescriptor .getBoardID ())) {
153
153
return true ;
154
154
}
155
- if (!this .getReferencingBoardsFile ().equals (otherBoardDescriptor .getReferencingBoardsFile ())) {
155
+ String moddedReferencingBoardsFile = makePathEnvironmentString (getReferencingBoardsFile ());
156
+ String moddedOtherReferencingBoardsFile = makePathEnvironmentString (
157
+ otherBoardDescriptor .getReferencingBoardsFile ());
158
+ if (!moddedReferencingBoardsFile .equals (moddedOtherReferencingBoardsFile )) {
156
159
return true ;
157
160
}
158
161
if (!this .getOptions ().equals (otherBoardDescriptor .getOptions ())) {
@@ -320,7 +323,7 @@ private void ParseSection() {
320
323
* @return a list of board descriptors
321
324
*/
322
325
public static List <BoardDescription > makeBoardDescriptors (File boardFile , Map <String , String > options ) {
323
- BoardTxtFile txtFile = new BoardTxtFile (boardFile );
326
+ BoardTxtFile txtFile = new BoardTxtFile (resolvePathEnvironmentString ( boardFile ) );
324
327
List <BoardDescription > boards = new ArrayList <>();
325
328
String [] allSectionNames = txtFile .getAllSectionNames ();
326
329
for (String curboardName : allSectionNames ) {
@@ -344,7 +347,7 @@ public static List<BoardDescription> makeBoardDescriptors(File boardFile, Map<St
344
347
*/
345
348
BoardDescription (File boardsFile , String boardID , Map <String , String > options ) {
346
349
this .myBoardID = boardID ;
347
- this .myreferencingBoardsFile = boardsFile ;
350
+ this .myreferencingBoardsFile = resolvePathEnvironmentString ( boardsFile ) ;
348
351
this .myTxtFile = new BoardTxtFile (this .myreferencingBoardsFile );
349
352
setDefaultOptions ();
350
353
if (options != null ) {
@@ -353,7 +356,8 @@ public static List<BoardDescription> makeBoardDescriptors(File boardFile, Map<St
353
356
}
354
357
355
358
public BoardDescription () {
356
- myreferencingBoardsFile = new File (myStorageNode .get (KEY_LAST_USED_BOARDS_FILE , EMPTY ));
359
+ myreferencingBoardsFile = resolvePathEnvironmentString (
360
+ new File (myStorageNode .get (KEY_LAST_USED_BOARDS_FILE , EMPTY )));
357
361
myTxtFile = new BoardTxtFile (this .myreferencingBoardsFile );
358
362
myBoardID = myStorageNode .get (KEY_LAST_USED_BOARD , EMPTY );
359
363
myUploadPort = myStorageNode .get (KEY_LAST_USED_UPLOAD_PORT , EMPTY );
@@ -410,7 +414,7 @@ private void setDefaultOptions() {
410
414
* project
411
415
*/
412
416
public void saveUserSelection () {
413
- myStorageNode .put (KEY_LAST_USED_BOARDS_FILE , makePathEnvironmentString (getReferencingBoardsFile (). toString () ));
417
+ myStorageNode .put (KEY_LAST_USED_BOARDS_FILE , makePathEnvironmentString (getReferencingBoardsFile ()));
414
418
myStorageNode .put (KEY_LAST_USED_BOARD , this .myBoardID );
415
419
myStorageNode .put (KEY_LAST_USED_UPLOAD_PORT , this .myUploadPort );
416
420
myStorageNode .put (KEY_LAST_USED_UPLOAD_PROTOCOL , this .myProgrammer );
@@ -492,11 +496,11 @@ public void setreferencingBoardsFile(File boardsFile) {
492
496
if (boardsFile == null ) {
493
497
return ;// ignore
494
498
}
495
- if (this .myreferencingBoardsFile .equals (boardsFile )) {
499
+ if (this .myreferencingBoardsFile .equals (resolvePathEnvironmentString ( boardsFile ) )) {
496
500
return ;
497
501
}
498
502
499
- this .myreferencingBoardsFile = boardsFile ;
503
+ this .myreferencingBoardsFile = resolvePathEnvironmentString ( boardsFile ) ;
500
504
this .myTxtFile = new BoardTxtFile (this .myreferencingBoardsFile );
501
505
setDirty ();
502
506
}
@@ -773,7 +777,7 @@ private Map<String, String> getEnvVarsTxt() {
773
777
KeyValueTree optionsTree = section .getChild (KEY_SLOEBER_MENU_SELECTION );
774
778
Map <String , String > options = optionsTree .toKeyValues (EMPTY , false );
775
779
776
- myreferencingBoardsFile = new File (board_txt );
780
+ myreferencingBoardsFile = resolvePathEnvironmentString ( new File (board_txt ) );
777
781
this .myTxtFile = new BoardTxtFile (this .myreferencingBoardsFile );
778
782
setDefaultOptions ();
779
783
if (options != null ) {
@@ -809,7 +813,7 @@ private Map<String, String> onlyKeepValidOptions(Map<String, String> options) {
809
813
*/
810
814
public Map <String , String > getEnvVarsConfig (String prefix ) {
811
815
Map <String , String > allVars = new TreeMap <>();
812
- String board_txt = myreferencingBoardsFile . toString ( );
816
+ String board_txt = makePathEnvironmentString ( getReferencingBoardsFile () );
813
817
814
818
allVars .put (prefix + KEY_SLOEBER_PROGRAMMER , myProgrammer );
815
819
allVars .put (prefix + KEY_SLOEBER_BOARD_ID , myBoardID );
@@ -1109,9 +1113,9 @@ public static BoardDescription getFromCDT(ICConfigurationDescription confDesc) {
1109
1113
packagesIndex =referencingBoardsFile .indexOf ( "/arduinoPlugin/packages/" );
1110
1114
}
1111
1115
if (packagesIndex !=-1 ) {
1112
- referencingBoardsFile = eclipseHomePath .append (referencingBoardsFile .substring (packagesIndex )).toString ();
1116
+ referencingBoardsFile = sloeberHomePath .append (referencingBoardsFile .substring (packagesIndex )).toString ();
1113
1117
}
1114
- ret .myreferencingBoardsFile = new File (referencingBoardsFile );
1118
+ ret .myreferencingBoardsFile = resolvePathEnvironmentString ( new File (referencingBoardsFile ) );
1115
1119
ret .myTxtFile = new BoardTxtFile (ret .myreferencingBoardsFile );
1116
1120
1117
1121
return ret ;
0 commit comments