File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
cc/arduino/contributions/packages Expand file tree Collapse file tree 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) {
439439
440440 return platformOptional .orElse (null );
441441 }
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+ }
442450}
Original file line number Diff line number Diff line change 66import cc .arduino .contributions .GPGDetachedSignatureVerifier ;
77import cc .arduino .contributions .SignatureVerificationFailedException ;
88import cc .arduino .contributions .libraries .LibrariesIndexer ;
9+ import cc .arduino .contributions .packages .ContributedPlatform ;
910import cc .arduino .contributions .packages .ContributedTool ;
1011import cc .arduino .contributions .packages .ContributionsIndexer ;
1112import cc .arduino .files .DeleteFilesOnShutdown ;
@@ -160,6 +161,18 @@ static public PreferencesMap getBoardPreferences() {
160161 }
161162 }
162163 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+ }
163176 return prefs ;
164177 }
165178
You can’t perform that action at this time.
0 commit comments