|
1 | 1 | package processing.app;
|
2 | 2 |
|
| 3 | +import static processing.app.I18n.tr; |
| 4 | +import static processing.app.helpers.filefilters.OnlyDirs.ONLY_DIRS; |
| 5 | + |
| 6 | +import java.beans.PropertyChangeListener; |
| 7 | +import java.beans.PropertyChangeSupport; |
| 8 | +import java.io.File; |
| 9 | +import java.io.FileWriter; |
| 10 | +import java.io.IOException; |
| 11 | +import java.util.ArrayList; |
| 12 | +import java.util.Arrays; |
| 13 | +import java.util.Collection; |
| 14 | +import java.util.Date; |
| 15 | +import java.util.HashMap; |
| 16 | +import java.util.LinkedHashMap; |
| 17 | +import java.util.List; |
| 18 | +import java.util.Map; |
| 19 | +import java.util.logging.Level; |
| 20 | +import java.util.logging.Logger; |
| 21 | +import java.util.stream.Collectors; |
| 22 | + |
| 23 | +import org.apache.commons.compress.utils.IOUtils; |
| 24 | +import org.apache.commons.logging.impl.LogFactoryImpl; |
| 25 | +import org.apache.commons.logging.impl.NoOpLog; |
| 26 | + |
| 27 | +import com.fasterxml.jackson.core.JsonProcessingException; |
| 28 | + |
3 | 29 | import cc.arduino.Constants;
|
4 | 30 | import cc.arduino.contributions.GPGDetachedSignatureVerifier;
|
5 | 31 | import cc.arduino.contributions.SignatureVerificationFailedException;
|
|
8 | 34 | import cc.arduino.contributions.packages.ContributedPlatform;
|
9 | 35 | import cc.arduino.contributions.packages.ContributedTool;
|
10 | 36 | import cc.arduino.contributions.packages.ContributionsIndexer;
|
| 37 | +import cc.arduino.files.DeleteFilesOnShutdown; |
| 38 | +import cc.arduino.packages.BoardPort; |
11 | 39 | import cc.arduino.packages.DiscoveryManager;
|
12 |
| -import com.fasterxml.jackson.core.JsonProcessingException; |
13 |
| -import org.apache.commons.compress.utils.IOUtils; |
14 |
| -import org.apache.commons.logging.impl.LogFactoryImpl; |
15 |
| -import org.apache.commons.logging.impl.NoOpLog; |
16 |
| -import processing.app.debug.*; |
17 |
| -import processing.app.helpers.*; |
| 40 | +import processing.app.debug.LegacyTargetPackage; |
| 41 | +import processing.app.debug.LegacyTargetPlatform; |
| 42 | +import processing.app.debug.TargetBoard; |
| 43 | +import processing.app.debug.TargetPackage; |
| 44 | +import processing.app.debug.TargetPlatform; |
| 45 | +import processing.app.debug.TargetPlatformException; |
| 46 | +import processing.app.helpers.BasicUserNotifier; |
| 47 | +import processing.app.helpers.CommandlineParser; |
| 48 | +import processing.app.helpers.FileUtils; |
| 49 | +import processing.app.helpers.OSUtils; |
| 50 | +import processing.app.helpers.PreferencesMap; |
| 51 | +import processing.app.helpers.UserNotifier; |
18 | 52 | import processing.app.helpers.filefilters.OnlyDirs;
|
19 | 53 | import processing.app.helpers.filefilters.OnlyFilesWithExtension;
|
20 | 54 | import processing.app.legacy.PApplet;
|
@@ -247,6 +281,22 @@ static public File getHardwareFolder() {
|
247 | 281 | return getContentFile("hardware");
|
248 | 282 | }
|
249 | 283 |
|
| 284 | + static public List<File> getAllHardwareFolders() { |
| 285 | + List<File> res = new ArrayList<>(); |
| 286 | + res.add(getHardwareFolder()); |
| 287 | + res.add(new File(getSettingsFolder(), "packages")); |
| 288 | + res.add(getSketchbookHardwareFolder()); |
| 289 | + return res.stream().filter(x -> x.isDirectory()).collect(Collectors.toList()); |
| 290 | + } |
| 291 | + |
| 292 | + static public List<File> getAllToolsFolders() { |
| 293 | + List<File> res = new ArrayList<>(); |
| 294 | + res.add(BaseNoGui.getContentFile("tools-builder")); |
| 295 | + res.add(FileUtils.newFile(BaseNoGui.getHardwareFolder(), "tools", "avr")); |
| 296 | + res.add(new File(getSettingsFolder(), "packages")); |
| 297 | + return res.stream().filter(x -> x.isDirectory()).collect(Collectors.toList()); |
| 298 | + } |
| 299 | + |
250 | 300 | static public String getHardwarePath() {
|
251 | 301 | return getHardwareFolder().getAbsolutePath();
|
252 | 302 | }
|
|
0 commit comments