1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-19 08:52:15 +01:00

PluggableDiscovery: allow patterns to contain runtime variables

This commit is contained in:
Martino Facchin 2018-12-13 18:09:36 +01:00
parent e1caaf1c45
commit feb863dfc9

View File

@ -39,6 +39,7 @@ import java.util.Map;
import cc.arduino.packages.discoverers.PluggableDiscovery;
import cc.arduino.packages.discoverers.serial.SerialDiscovery;
import cc.arduino.packages.discoverers.NetworkDiscovery;
import processing.app.PreferencesData;
import processing.app.debug.TargetPackage;
import processing.app.debug.TargetPlatform;
import processing.app.helpers.PreferencesMap;
@ -75,6 +76,7 @@ public class DiscoveryManager {
try {
System.out.println("found discovery: " + discoveryName + " -> " + pattern);
System.out.println("with preferencess -> " + discoveryPrefs);
pattern = StringReplacer.replaceFromMapping(pattern, PreferencesData.getMap());
String[] cmd = StringReplacer.formatAndSplit(pattern, discoveryPrefs);
discoverers.add(new PluggableDiscovery(discoveryName, cmd));
} catch (Exception e) {