@@ -160,7 +160,6 @@ public boolean equals(BoardDescriptor otherBoardDescriptor) {
160
160
*/
161
161
public boolean needsSettingDirty (BoardDescriptor otherBoardDescriptor ) {
162
162
163
-
164
163
if (!this .getBoardID ().equals (otherBoardDescriptor .getBoardID ())) {
165
164
return true ;
166
165
}
@@ -180,8 +179,8 @@ public boolean needsSettingDirty(BoardDescriptor otherBoardDescriptor) {
180
179
return true ;
181
180
}
182
181
if (!this .getMyWorkSpaceLocation ().equals (otherBoardDescriptor .getMyWorkSpaceLocation ())) {
183
- return true ;
184
- }
182
+ return true ;
183
+ }
185
184
return false ;
186
185
}
187
186
@@ -244,14 +243,29 @@ private void ParseSection(Map<String, String> boardInfo) {
244
243
upload = uploadOption ;
245
244
}
246
245
}
247
-
246
+ String architecture = getArchitecture ();
248
247
if (core != null ) {
249
248
String valueSplit [] = core .split (":" );
250
249
if (valueSplit .length == 2 ) {
251
250
String refVendor = valueSplit [0 ];
252
251
String actualValue = valueSplit [1 ];
253
252
this .myBoardsCore = actualValue ;
254
- this .myReferencedCorePlatformPath = findReferencedPlatform (refVendor );
253
+ this .myReferencedCorePlatformPath = Manager .getPlatformInstallPath (refVendor , architecture );
254
+ if (this .myReferencedCorePlatformPath == null ) {
255
+ Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
256
+ Messages .Helpers_tool_reference_missing .replaceAll (TOOL_KEY , core )
257
+ .replaceAll (FILE_KEY , getReferencingBoardsFile ().toString ())
258
+ .replaceAll (BOARD_KEY , getBoardID ())));
259
+ return ;
260
+ }
261
+ } else if (valueSplit .length == 4 ) {
262
+ String refVendor = valueSplit [0 ];
263
+ String refArchitecture = valueSplit [1 ];
264
+ String refVersion = valueSplit [2 ];
265
+ String actualValue = valueSplit [3 ];
266
+ this .myUploadTool = actualValue ;
267
+ this .myReferencedCorePlatformPath = Manager .getPlatformInstallPath (refVendor , refArchitecture ,
268
+ refVersion );
255
269
if (this .myReferencedCorePlatformPath == null ) {
256
270
Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
257
271
Messages .Helpers_tool_reference_missing .replaceAll (TOOL_KEY , core )
@@ -269,7 +283,22 @@ private void ParseSection(Map<String, String> boardInfo) {
269
283
String refVendor = valueSplit [0 ];
270
284
String actualValue = valueSplit [1 ];
271
285
this .myBoardsVariant = actualValue ;
272
- this .myReferencedBoardVariantPlatformPath = findReferencedPlatform (refVendor );
286
+ this .myReferencedBoardVariantPlatformPath = Manager .getPlatformInstallPath (refVendor , architecture );
287
+ if (this .myReferencedBoardVariantPlatformPath == null ) {
288
+ Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
289
+ Messages .Helpers_tool_reference_missing .replaceAll (TOOL_KEY , variant )
290
+ .replaceAll (FILE_KEY , getReferencingBoardsFile ().toString ())
291
+ .replaceAll (BOARD_KEY , getBoardID ())));
292
+ return ;
293
+ }
294
+ } else if (valueSplit .length == 4 ) {
295
+ String refVendor = valueSplit [0 ];
296
+ String refArchitecture = valueSplit [1 ];
297
+ String refVersion = valueSplit [2 ];
298
+ String actualValue = valueSplit [3 ];
299
+ this .myUploadTool = actualValue ;
300
+ this .myReferencedBoardVariantPlatformPath = Manager .getPlatformInstallPath (refVendor , refArchitecture ,
301
+ refVersion );
273
302
if (this .myReferencedBoardVariantPlatformPath == null ) {
274
303
Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
275
304
Messages .Helpers_tool_reference_missing .replaceAll (TOOL_KEY , variant )
@@ -287,7 +316,22 @@ private void ParseSection(Map<String, String> boardInfo) {
287
316
String refVendor = valueSplit [0 ];
288
317
String actualValue = valueSplit [1 ];
289
318
this .myUploadTool = actualValue ;
290
- this .myReferencedUploadToolPlatformPath = findReferencedPlatform (refVendor );
319
+ this .myReferencedUploadToolPlatformPath = Manager .getPlatformInstallPath (refVendor , architecture );
320
+ if (this .myReferencedUploadToolPlatformPath == null ) {
321
+ Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
322
+ Messages .Helpers_tool_reference_missing .replaceAll (TOOL_KEY , upload )
323
+ .replaceAll (FILE_KEY , getReferencingBoardsFile ().toString ())
324
+ .replaceAll (BOARD_KEY , getBoardID ())));
325
+ return ;
326
+ }
327
+ } else if (valueSplit .length == 4 ) {
328
+ String refVendor = valueSplit [0 ];
329
+ String refArchitecture = valueSplit [1 ];
330
+ String refVersion = valueSplit [2 ];
331
+ String actualValue = valueSplit [3 ];
332
+ this .myUploadTool = actualValue ;
333
+ this .myReferencedUploadToolPlatformPath = Manager .getPlatformInstallPath (refVendor , refArchitecture ,
334
+ refVersion );
291
335
if (this .myReferencedUploadToolPlatformPath == null ) {
292
336
Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,
293
337
Messages .Helpers_tool_reference_missing .replaceAll (TOOL_KEY , upload )
@@ -324,8 +368,7 @@ protected BoardDescriptor(ICConfigurationDescription confdesc) {
324
368
"" );
325
369
this .myWorkEclipseLocation = Common .getBuildEnvironmentVariable (confdesc , ENV_KEY_JANTJE_ECLIPSE_LOCATION ,
326
370
"" );
327
- String optinconcat = Common .getBuildEnvironmentVariable (confdesc , ENV_KEY_JANTJE_MENU_SELECTION ,
328
- "" );
371
+ String optinconcat = Common .getBuildEnvironmentVariable (confdesc , ENV_KEY_JANTJE_MENU_SELECTION , "" );
329
372
this .myOptions = KeyValue .makeMap (optinconcat );
330
373
}
331
374
calculateDerivedFields ();
@@ -595,8 +638,8 @@ public boolean saveConfiguration(ICConfigurationDescription confDesc, IContribut
595
638
Common .setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_JANTJE_ECLIPSE_LOCATION ,
596
639
this .myWorkEclipseLocation );
597
640
Common .setBuildEnvironmentVariable (confDesc , JANTJE_ACTION_UPLOAD , this .myProgrammer );
598
- String value = KeyValue .makeString (this .myOptions );
599
- Common .setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_JANTJE_MENU_SELECTION , value );
641
+ String value = KeyValue .makeString (this .myOptions );
642
+ Common .setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_JANTJE_MENU_SELECTION , value );
600
643
601
644
Common .setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_SERIAL_PORT , this .myUploadPort );
602
645
Common .setBuildEnvironmentVariable (contribEnv , confDesc , ENV_KEY_SERIAL_PORT_FILE ,
@@ -702,7 +745,7 @@ public String[] getCompatibleBoards() {
702
745
703
746
public String [] getUploadProtocols () {
704
747
705
- return Programmers .getUploadProtocols (this );
748
+ return Programmers .getUploadProtocols (this );
706
749
707
750
}
708
751
@@ -769,24 +812,6 @@ public String getProjectName() {
769
812
return this .myProjectName ;
770
813
}
771
814
772
- /**
773
- * This method looks for a referenced platform. Ask the boards manager to find
774
- * the latest installed vendor/architecture platform file
775
- *
776
- * If this is not found there is still sme old code that probably can be
777
- * deleted.
778
- *
779
- * @param vendor
780
- * @param architecture
781
- * @return
782
- */
783
- private IPath findReferencedPlatform (String vendor ) {
784
- // ask the boardsmanager for the platform file
785
- IPath ret = Manager .getPlatformInstallPath (vendor , getArchitecture ());
786
- return ret ;
787
-
788
- }
789
-
790
815
/**
791
816
* provide the actual path to the variant. Use this method if you want to know
792
817
* where the variant is
@@ -871,24 +896,25 @@ public IPath getReferencingLibraryPath() {
871
896
872
897
public String getUploadCommand (ICConfigurationDescription confdesc ) {
873
898
String upLoadTool = getActualUploadTool (confdesc );
874
- String action = "UPLOAD" ;
899
+ String action = "UPLOAD" ;
875
900
if (usesProgrammer ()) {
876
- action = "PROGRAM" ;
901
+ action = "PROGRAM" ;
877
902
}
878
- return Common .getBuildEnvironmentVariable (confdesc , "A.TOOLS." + upLoadTool . toUpperCase () + "." + action + ".PATTERN" ,
879
- upLoadTool .toUpperCase ());
903
+ return Common .getBuildEnvironmentVariable (confdesc ,
904
+ "A.TOOLS." + upLoadTool . toUpperCase () + "." + action + ".PATTERN" , upLoadTool .toUpperCase ());
880
905
}
881
906
882
907
public String getActualUploadTool (ICConfigurationDescription confdesc ) {
883
- if (confdesc == null ) {
884
- Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID ,"Confdesc null is not alowed here" ));
908
+ if (confdesc == null ) {
909
+ Common .log (new Status (IStatus .ERROR , Const .CORE_PLUGIN_ID , "Confdesc null is not alowed here" ));
885
910
return this .myUploadTool ;
886
911
}
887
- if (usesProgrammer ()) {
888
- return Common .getBuildEnvironmentVariable (confdesc , "A.PROGRAM.TOOL" , "Program tool not properly configured" );
912
+ if (usesProgrammer ()) {
913
+ return Common .getBuildEnvironmentVariable (confdesc , "A.PROGRAM.TOOL" ,
914
+ "Program tool not properly configured" );
889
915
}
890
- if (this .myUploadTool == null ) {
891
- return Common .getBuildEnvironmentVariable (confdesc , "A.UPLOAD.TOOL" , "upload tool not properly configured" );
916
+ if (this .myUploadTool == null ) {
917
+ return Common .getBuildEnvironmentVariable (confdesc , "A.UPLOAD.TOOL" , "upload tool not properly configured" );
892
918
}
893
919
return this .myUploadTool ;
894
920
}
0 commit comments