|
1 | 1 | package io.sloeber.core.api;
|
2 | 2 |
|
3 |
| -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; |
| 3 | +import static java.nio.file.StandardCopyOption.*; |
4 | 4 |
|
5 | 5 | import java.io.File;
|
6 | 6 | import java.io.FileReader;
|
@@ -80,33 +80,34 @@ public class PackageManager {
|
80 | 80 | * if jsonFileName equals "local" the filename of the boards.txt
|
81 | 81 | * containing the boards. otherwise the name of the package
|
82 | 82 | * containing the board
|
83 |
| - * @param platformName |
84 |
| - * ignored if jsonFileName equals "local" otherwise the name of the |
85 |
| - * platform containing the board |
| 83 | + * @param architectureName |
| 84 | + * ignored if jsonFileName equals "local" otherwise the architecture |
| 85 | + * name of the platform containing the board (this assumes the |
| 86 | + * architecture is the unique id for the platform) |
86 | 87 | * @param boardID
|
87 | 88 | * the id of the board in the boards.txt file
|
88 | 89 | * @param options
|
89 | 90 | * the options to specify the board (the menu named on the boards.txt
|
90 | 91 | * file) or null for defaults
|
91 | 92 | * @return The class BoardDescriptor or null
|
92 | 93 | */
|
93 |
| - static public BoardDescription getBoardDescriptor(String jsonFileName, String packageName, String platformName, |
| 94 | + static public BoardDescription getBoardDescriptor(String jsonFileName, String packageName, String architectureName, |
94 | 95 | String boardID, Map<String, String> options) {
|
95 | 96 | if (jsonFileName.equals("local")) { //$NON-NLS-1$
|
96 | 97 | return new BoardDescription(new File(packageName), boardID, options);
|
97 | 98 | }
|
98 |
| - return getNewestBoardIDFromBoardsManager(jsonFileName, packageName, platformName, boardID, options); |
| 99 | + return getNewestBoardIDFromBoardsManager(jsonFileName, packageName, architectureName, boardID, options); |
99 | 100 | }
|
100 | 101 |
|
101 | 102 | static private BoardDescription getNewestBoardIDFromBoardsManager(String jsonFileName, String packageName,
|
102 |
| - String platformName, String boardID, Map<String, String> options) { |
| 103 | + String architectureName, String boardID, Map<String, String> options) { |
103 | 104 |
|
104 | 105 | Package thePackage = InternalPackageManager.getPackage(jsonFileName, packageName);
|
105 | 106 | if (thePackage == null) {
|
106 | 107 | // fail("failed to find package:" + this.mPackageName);
|
107 | 108 | return null;
|
108 | 109 | }
|
109 |
| - ArduinoPlatform platform = thePackage.getLatestPlatform(platformName, true); |
| 110 | + ArduinoPlatform platform = thePackage.getLatestPlatform(architectureName, true); |
110 | 111 | if (platform == null) {
|
111 | 112 | // fail("failed to find platform " + this.mPlatform + " in
|
112 | 113 | // package:" + this.mPackageName);
|
@@ -182,23 +183,23 @@ public static void installAllLatestPlatforms() {
|
182 | 183 | installsubsetOfLatestPlatforms(0, 100000);
|
183 | 184 | }
|
184 | 185 |
|
185 |
| - public static void installLatestPlatform(String JasonName, String packageName, String platformName) { |
| 186 | + public static void installLatestPlatform(String JasonName, String packageName, String architectureName) { |
186 | 187 | if (!isReady()) {
|
187 | 188 | Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.BoardsManagerIsBussy, new Exception()));
|
188 | 189 | return;
|
189 | 190 | }
|
190 | 191 | platformsDirty = true;
|
191 | 192 | Package curPackage = InternalPackageManager.getPackage(JasonName, packageName);
|
192 | 193 | if (curPackage != null) {
|
193 |
| - ArduinoPlatform curPlatform = curPackage.getLatestPlatform(platformName, false); |
| 194 | + ArduinoPlatform curPlatform = curPackage.getLatestPlatform(architectureName, false); |
194 | 195 | if (curPlatform != null) {
|
195 | 196 | NullProgressMonitor monitor = new NullProgressMonitor();
|
196 | 197 | curPlatform.install(monitor);
|
197 | 198 | return;
|
198 | 199 | }
|
199 | 200 | }
|
200 | 201 | Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID,
|
201 |
| - "failed to find " + JasonName + " " + packageName + " " + platformName)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 202 | + "failed to find " + JasonName + " " + packageName + " " + architectureName)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
202 | 203 | }
|
203 | 204 |
|
204 | 205 | public static void addPrivateHardwarePath(String newHardwarePath) {
|
|
0 commit comments