1
- package io .sloeber .core .api ;
1
+ package io .sloeber .arduinoFramework .api ;
2
2
3
3
import static io .sloeber .core .Messages .*;
4
4
import static io .sloeber .core .api .Common .*;
26
26
import org .eclipse .core .runtime .preferences .IEclipsePreferences ;
27
27
import org .eclipse .core .runtime .preferences .InstanceScope ;
28
28
29
+ import io .sloeber .arduinoFramework .internal .ArduinoPlatformTooldDependency ;
29
30
import io .sloeber .autoBuild .api .IAutoBuildConfigurationDescription ;
30
31
import io .sloeber .autoBuild .helpers .api .KeyValueTree ;
31
- import io .sloeber .core .api .Json .ArduinoPlatform ;
32
- import io .sloeber .core .api .Json .ArduinoPlatformTooldDependency ;
33
- import io .sloeber .core .api .Json .ArduinoPlatformVersion ;
32
+ import io .sloeber .core .api .Common ;
33
+ import io .sloeber .core .api .ConfigurationPreferences ;
34
+ import io .sloeber .core .api .Const ;
35
+ import io .sloeber .core .api .Preferences ;
36
+ import io .sloeber .core .api .VersionNumber ;
34
37
import io .sloeber .core .tools .KeyValue ;
35
38
import io .sloeber .core .txt .BoardTxtFile ;
36
39
import io .sloeber .core .txt .PlatformTxtFile ;
@@ -54,9 +57,9 @@ public class BoardDescription {
54
57
private String myBoardsVariant = null ;
55
58
private String myUploadTool = null ;
56
59
57
- private ArduinoPlatformVersion myReferencedPlatformVariant = null ;
58
- private ArduinoPlatformVersion myReferencedPlatformCore = null ;
59
- private ArduinoPlatformVersion myReferencedPlatformUpload = null ;
60
+ private IArduinoPlatformVersion myReferencedPlatformVariant = null ;
61
+ private IArduinoPlatformVersion myReferencedPlatformCore = null ;
62
+ private IArduinoPlatformVersion myReferencedPlatformUpload = null ;
60
63
61
64
private boolean isDirty = true ;
62
65
@@ -281,7 +284,7 @@ public static List<BoardDescription> makeBoardDescriptors(File boardFile) {
281
284
* @param options
282
285
* if null default options are taken
283
286
*/
284
- BoardDescription (File boardsFile , String boardID , Map <String , String > options ) {
287
+ public BoardDescription (File boardsFile , String boardID , Map <String , String > options ) {
285
288
myBoardID = boardID ;
286
289
myUserSelectedBoardsTxtFile = boardsFile ;
287
290
mySloeberBoardTxtFile = new BoardTxtFile (resolvePathEnvironmentString (myUserSelectedBoardsTxtFile ));
@@ -295,9 +298,9 @@ public BoardDescription() {
295
298
myUserSelectedBoardsTxtFile = new File (myStorageNode .get (KEY_LAST_USED_BOARDS_FILE , EMPTY ));
296
299
if (!myUserSelectedBoardsTxtFile .exists ()) {
297
300
298
- ArduinoPlatformVersion platform = BoardsManager .getNewestInstalledPlatform (VENDOR_ARDUINO , AVR );
301
+ IArduinoPlatformVersion platform = BoardsManager .getNewestInstalledPlatform (VENDOR_ARDUINO , AVR );
299
302
if (platform == null ) {
300
- List <ArduinoPlatformVersion > platforms = BoardsManager .getInstalledPlatforms ();
303
+ List <IArduinoPlatformVersion > platforms = BoardsManager .getInstalledPlatforms ();
301
304
//If you crash on the next line no platform have been installed
302
305
platform = platforms .get (0 );
303
306
}
@@ -644,11 +647,11 @@ public IPath getreferencedCoreHardwarePath() {
644
647
*/
645
648
public IPath getArduinoPlatformPath () {
646
649
updateWhenDirty ();
647
- ArduinoPlatform platform = BoardsManager .getPlatform (VENDOR_ARDUINO , getArchitecture ());
650
+ IArduinoPlatform platform = BoardsManager .getPlatform (VENDOR_ARDUINO , getArchitecture ());
648
651
if (platform == null ) {
649
652
return null ;
650
653
}
651
- ArduinoPlatformVersion platformVersion = platform .getNewestInstalled ();
654
+ IArduinoPlatformVersion platformVersion = platform .getNewestInstalled ();
652
655
if (platformVersion == null ) {
653
656
return null ;
654
657
}
@@ -938,14 +941,14 @@ private Map<String, String> getEnVarPlatformInfo() {
938
941
}
939
942
940
943
IPath referencingPlatformPath = getreferencingPlatformPath ();
941
- ArduinoPlatformVersion referencingPlatform = BoardsManager .getPlatform (referencingPlatformPath );
944
+ IArduinoPlatformVersion referencingPlatform = BoardsManager .getPlatform (referencingPlatformPath );
942
945
943
946
if (referencingPlatform == null ) {
944
947
// This is the case for private hardware
945
948
//there is no need to specify tool path as they do not use them
946
949
return ret ;
947
950
}
948
- ArduinoPlatformVersion latestArduinoPlatform = BoardsManager .getNewestInstalledPlatform (Const .VENDOR_ARDUINO ,
951
+ IArduinoPlatformVersion latestArduinoPlatform = BoardsManager .getNewestInstalledPlatform (Const .VENDOR_ARDUINO ,
949
952
referencingPlatform .getArchitecture ());
950
953
if (latestArduinoPlatform != null ) {
951
954
ret .putAll (getEnvVarPlatformFileTools (latestArduinoPlatform ));
@@ -978,7 +981,7 @@ private Map<String, String> getEnVarPlatformInfo() {
978
981
* @param platformVersion
979
982
* @return environment variables pointing to the tools used by the platform
980
983
*/
981
- private static Map <String , String > getEnvVarPlatformFileTools (ArduinoPlatformVersion platformVersion ) {
984
+ private static Map <String , String > getEnvVarPlatformFileTools (IArduinoPlatformVersion platformVersion ) {
982
985
HashMap <String , String > vars = new HashMap <>();
983
986
for (ArduinoPlatformTooldDependency tool : platformVersion .getToolsDependencies ()) {
984
987
IPath installPath = tool .getInstallPath ();
0 commit comments