File tree 2 files changed +21
-0
lines changed
cc/arduino/contributions/packages
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -439,4 +439,12 @@ public ContributedPlatform getPlatformByFolder(final File folder) {
439
439
440
440
return platformOptional .orElse (null );
441
441
}
442
+
443
+ public ContributedPlatform getContributedPlaform (TargetPlatform targetPlatform ) {
444
+ for (ContributedPlatform plat : getInstalledPlatforms ()) {
445
+ if (plat .getInstalledFolder ().equals (targetPlatform .getFolder ()))
446
+ return plat ;
447
+ }
448
+ return null ;
449
+ }
442
450
}
Original file line number Diff line number Diff line change 6
6
import cc .arduino .contributions .GPGDetachedSignatureVerifier ;
7
7
import cc .arduino .contributions .SignatureVerificationFailedException ;
8
8
import cc .arduino .contributions .libraries .LibrariesIndexer ;
9
+ import cc .arduino .contributions .packages .ContributedPlatform ;
9
10
import cc .arduino .contributions .packages .ContributedTool ;
10
11
import cc .arduino .contributions .packages .ContributionsIndexer ;
11
12
import cc .arduino .files .DeleteFilesOnShutdown ;
@@ -160,6 +161,18 @@ static public PreferencesMap getBoardPreferences() {
160
161
}
161
162
}
162
163
prefs .put ("name" , extendedName );
164
+
165
+ // Resolve tools needed for this board
166
+ ContributedPlatform platform = indexer .getContributedPlaform (getTargetPlatform ());
167
+ if (platform != null ) {
168
+ String prefix = "runtime.tools." ;
169
+ for (ContributedTool tool : platform .getResolvedTools ()) {
170
+ File folder = tool .getDownloadableContribution (getPlatform ()).getInstalledFolder ();
171
+ String toolPath = folder .getAbsolutePath ();
172
+ PreferencesData .set (prefix + tool .getName () + ".path" , toolPath );
173
+ PreferencesData .set (prefix + tool .getName () + "-" + tool .getVersion () + ".path" , toolPath );
174
+ }
175
+ }
163
176
return prefs ;
164
177
}
165
178
You can’t perform that action at this time.
0 commit comments