1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Tools path are now always available through preferences

The preference key is:
{runtime.tools.TOOLNAME.path}
{runtime.tools.TOOLNAME-VERSION.path}

For example the tool "avrdude" is now available through

{runtime.tools.avrdude.path}

or if a specific version is needed:

{runtime.tools.avrdude-5.11.path}
This commit is contained in:
Cristian Maglie
2015-02-16 12:42:48 +01:00
committed by Federico Fissore
parent 2c941d424e
commit b1e0249a4f
4 changed files with 41 additions and 36 deletions

View File

@ -19,8 +19,8 @@ import org.apache.commons.logging.impl.NoOpLog;
import cc.arduino.packages.DiscoveryManager;
import cc.arduino.packages.Uploader;
import processing.app.debug.Compiler;
import cc.arduino.libraries.contributions.LibrariesIndexer;
import cc.arduino.packages.contributions.ContributedTool;
import cc.arduino.packages.contributions.ContributionsIndexer;
import cc.arduino.utils.ArchiveExtractor;
import processing.app.debug.TargetBoard;
@ -618,6 +618,7 @@ public class BaseNoGui {
loadHardware(getHardwareFolder());
loadHardware(getSketchbookHardwareFolder());
loadContributedHardware(indexer);
createToolPreferences(indexer);
librariesIndexer = new LibrariesIndexer(BaseNoGui.getSettingsFolder());
File librariesIndexFile = librariesIndexer.getIndexFile();
@ -771,6 +772,21 @@ public class BaseNoGui {
}
}
static private void createToolPreferences(ContributionsIndexer indexer) {
// Remove previous runtime preferences
final String prefix = "runtime.tools.";
PreferencesData.removeAllKeysWithPrefix(prefix);
for (ContributedTool tool : indexer.getInstalledTools()) {
String path = tool.getDownloadableContribution().getInstalledFolder()
.getAbsolutePath();
String toolId = tool.getName();
PreferencesData.set(prefix + toolId + ".path", path);
toolId += "-" + tool.getVersion();
PreferencesData.set(prefix + toolId + ".path", path);
}
}
static public void populateImportToLibraryTable() {
// Populate importToLibraryTable
importToLibraryTable = new HashMap<String, UserLibrary>();