@@ -74,7 +74,6 @@ public class BoardDescription {
74
74
private String myBoardID = EMPTY ;
75
75
private Map <String , String > myOptions = new TreeMap <>(String .CASE_INSENSITIVE_ORDER );
76
76
77
-
78
77
/*
79
78
* Stuff to make things work
80
79
*/
@@ -94,7 +93,6 @@ public class BoardDescription {
94
93
private final String KEY_SLOEBER_UPLOAD_PORT = "UPLOAD.PORT" ; //$NON-NLS-1$
95
94
private final String KEY_SLOEBER_MENU_SELECTION = "BOARD.MENU" ; //$NON-NLS-1$
96
95
97
-
98
96
@ Override
99
97
public String toString () {
100
98
return getReferencingBoardsFile () + " \" " + getBoardName () + "\" " + getUploadPort (); //$NON-NLS-1$//$NON-NLS-2$
@@ -207,7 +205,7 @@ private void ParseSection() {
207
205
} else if (valueSplit .length == 4 ) {
208
206
String refVendor = valueSplit [0 ];
209
207
String refArchitecture = valueSplit [1 ];
210
- String refVersion = valueSplit [2 ];
208
+ VersionNumber refVersion = new VersionNumber ( valueSplit [2 ]) ;
211
209
String actualValue = valueSplit [3 ];
212
210
myBoardsCore = actualValue ;
213
211
myReferencedCorePlatformPath = InternalPackageManager .getPlatformInstallPath (refVendor , refArchitecture ,
@@ -241,7 +239,7 @@ private void ParseSection() {
241
239
} else if (valueSplit .length == 4 ) {
242
240
String refVendor = valueSplit [0 ];
243
241
String refArchitecture = valueSplit [1 ];
244
- String refVersion = valueSplit [2 ];
242
+ VersionNumber refVersion = new VersionNumber ( valueSplit [2 ]) ;
245
243
String actualValue = valueSplit [3 ];
246
244
this .myBoardsVariant = actualValue ;
247
245
if ("*" .equals (refVersion )) { //$NON-NLS-1$
@@ -280,7 +278,7 @@ private void ParseSection() {
280
278
} else if (valueSplit .length == 4 ) {
281
279
String refVendor = valueSplit [0 ];
282
280
String refArchitecture = valueSplit [1 ];
283
- String refVersion = valueSplit [2 ];
281
+ VersionNumber refVersion = new VersionNumber ( valueSplit [2 ]) ;
284
282
String actualValue = valueSplit [3 ];
285
283
this .myUploadTool = actualValue ;
286
284
this .myReferencedUploadToolPlatformPath = InternalPackageManager .getPlatformInstallPath (refVendor ,
@@ -357,8 +355,6 @@ public BoardDescription(BoardDescription srcObject) {
357
355
myOptions = new TreeMap <>(srcObject .myOptions );
358
356
}
359
357
360
-
361
-
362
358
public String getuploadTool () {
363
359
return this .myUploadTool ;
364
360
}
@@ -374,7 +370,8 @@ private void setDefaultOptions() {
374
370
Map <String , String > allMenuIDs = this .myBoardTxtFile .getMenus ();
375
371
for (Map .Entry <String , String > curMenuID : allMenuIDs .entrySet ()) {
376
372
String providedMenuValue = this .myOptions .get (curMenuID .getKey ());
377
- ArrayList <String > menuOptions = this .myBoardTxtFile .getMenuItemIDsFromMenuID (curMenuID .getKey (), getBoardID ());
373
+ ArrayList <String > menuOptions = this .myBoardTxtFile .getMenuItemIDsFromMenuID (curMenuID .getKey (),
374
+ getBoardID ());
378
375
if (menuOptions .size () > 0 ) {
379
376
if (providedMenuValue == null ) {
380
377
@@ -398,7 +395,6 @@ public void saveUserSelection() {
398
395
myStorageNode .put (KEY_LAST_USED_BOARD_MENU_OPTIONS , KeyValue .makeString (this .myOptions ));
399
396
}
400
397
401
-
402
398
public String getArchitecture () {
403
399
return this .myBoardTxtFile .getArchitecture ();
404
400
}
@@ -526,7 +522,6 @@ public String[] getMenuItemNamesFromMenuID(String menuID) {
526
522
return this .myBoardTxtFile .getMenuItemNamesFromMenuID (menuID , this .myBoardID );
527
523
}
528
524
529
-
530
525
public TreeMap <String , IPath > getAllExamples () {
531
526
updateWhenDirty ();
532
527
return LibraryManager .getAllExamples (this );
@@ -661,7 +656,6 @@ public String getUploadPatternKey() {
661
656
return TOOLS + DOT + upLoadTool + DOT + UPLOAD + DOT + networkPrefix + PATTERN ;
662
657
}
663
658
664
-
665
659
public IPath getreferencedHardwarePath () {
666
660
updateWhenDirty ();
667
661
IPath platformPath = getReferencedCorePlatformPath ();
@@ -701,7 +695,6 @@ public boolean isNetworkUpload() {
701
695
return getHost () != null ;
702
696
}
703
697
704
-
705
698
protected BoardDescription (File txtFile , String boardID ) {
706
699
this .myBoardID = boardID ;
707
700
this .myreferencingBoardsFile = txtFile ;
@@ -730,7 +723,6 @@ protected BoardDescription(File txtFile, String boardID) {
730
723
}
731
724
}
732
725
733
-
734
726
private Map <String , String > onlyKeepValidOptions (Map <String , String > options ) {
735
727
Map <String , String > ret = new HashMap <>();
736
728
@@ -824,7 +816,6 @@ public Map<String, String> getEnvVars() {
824
816
allVars .put (ENV_KEY_HARDWARE_PATH , getreferencedHardwarePath ().toOSString ());
825
817
allVars .put (ENV_KEY_PLATFORM_PATH , getreferencingPlatformPath ().toOSString ());
826
818
827
-
828
819
allVars .put (ENV_KEY_SERIAL_PORT , getActualUploadPort ());
829
820
allVars .put (ENV_KEY_SERIAL_DOT_PORT , getActualUploadPort ());
830
821
@@ -846,7 +837,6 @@ public Map<String, String> getEnvVars() {
846
837
allVars .put (ENV_KEY_REFERENCED_VARIANT_PLATFORM_PATH , getReferencedVariantPlatformPath ().toOSString ());
847
838
allVars .put (ENV_KEY_REFERENCED_UPLOAD_PLATFORM_PATH , getReferencedUploadPlatformPath ().toOSString ());
848
839
849
-
850
840
PlatformTxtFile referencedPlatfromFile = getreferencedPlatformFile ();
851
841
// process the platform file referenced by the boards.txt
852
842
if (referencedPlatfromFile != null ) {
@@ -861,12 +851,10 @@ public Map<String, String> getEnvVars() {
861
851
// put in the installed tools info
862
852
allVars .putAll (getEnVarPlatformInfo ());
863
853
864
-
865
-
866
854
Programmers localProgrammers [] = Programmers .fromBoards (this );
867
855
String programmer = getProgrammer ();
868
856
for (Programmers curProgrammer : localProgrammers ) {
869
- // allVars.putAll(curProgrammer.getAllEnvironVars());
857
+ // allVars.putAll(curProgrammer.getAllEnvironVars());
870
858
String programmerID = curProgrammer .getIDFromNiceName (programmer );
871
859
if (programmerID != null ) {
872
860
allVars .putAll (curProgrammer .getAllEnvironVars (programmerID ));
@@ -1069,18 +1057,18 @@ public static BoardDescription getFromCDT(ICConfigurationDescription confDesc) {
1069
1057
ret .myBoardID = getOldWayEnvVar (confDesc , "JANTJE.board_ID" );
1070
1058
String optinconcat = getOldWayEnvVar (confDesc , "JANTJE.menu" );
1071
1059
ret .myOptions = KeyValue .makeMap (optinconcat );
1072
-
1060
+
1073
1061
String referencingBoardsFile = getOldWayEnvVar (confDesc , "JANTJE.boards_file" );
1074
- int packagesIndex = referencingBoardsFile .indexOf ( "\\ arduinoPlugin\\ packages\\ " );
1075
- if (packagesIndex == -1 ) {
1076
- packagesIndex = referencingBoardsFile .indexOf ( "/arduinoPlugin/packages/" );
1062
+ int packagesIndex = referencingBoardsFile .indexOf ("\\ arduinoPlugin\\ packages\\ " );
1063
+ if (packagesIndex == -1 ) {
1064
+ packagesIndex = referencingBoardsFile .indexOf ("/arduinoPlugin/packages/" );
1077
1065
}
1078
- if (packagesIndex != -1 ) {
1066
+ if (packagesIndex != -1 ) {
1079
1067
referencingBoardsFile = sloeberHomePath .append (referencingBoardsFile .substring (packagesIndex )).toString ();
1080
1068
}
1081
1069
ret .myreferencingBoardsFile = resolvePathEnvironmentString (new File (referencingBoardsFile ));
1082
1070
ret .myBoardTxtFile = new BoardTxtFile (ret .myreferencingBoardsFile );
1083
-
1071
+
1084
1072
return ret ;
1085
1073
}
1086
1074
0 commit comments