|
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;
|
21 | 55 | import processing.app.packages.LibraryList;
|
22 | 56 | import processing.app.packages.UserLibrary;
|
23 | 57 |
|
24 |
| -import cc.arduino.files.DeleteFilesOnShutdown; |
25 |
| -import processing.app.helpers.FileUtils; |
26 |
| - |
27 |
| -import java.beans.PropertyChangeListener; |
28 |
| -import java.beans.PropertyChangeSupport; |
29 |
| -import java.io.File; |
30 |
| -import java.io.FileWriter; |
31 |
| -import java.io.IOException; |
32 |
| -import java.util.*; |
33 |
| -import java.util.logging.Level; |
34 |
| -import java.util.logging.Logger; |
35 |
| - |
36 |
| -import cc.arduino.packages.BoardPort; |
37 |
| - |
38 |
| -import static processing.app.I18n.tr; |
39 |
| -import static processing.app.helpers.filefilters.OnlyDirs.ONLY_DIRS; |
40 |
| - |
41 | 58 | public class BaseNoGui {
|
42 | 59 |
|
43 | 60 | /** Version string to be used for build */
|
@@ -241,6 +258,22 @@ static public File getHardwareFolder() {
|
241 | 258 | return getContentFile("hardware");
|
242 | 259 | }
|
243 | 260 |
|
| 261 | + static public List<File> getAllHardwareFolders() { |
| 262 | + List<File> res = new ArrayList<>(); |
| 263 | + res.add(getHardwareFolder()); |
| 264 | + res.add(new File(getSettingsFolder(), "packages")); |
| 265 | + res.add(getSketchbookHardwareFolder()); |
| 266 | + return res.stream().filter(x -> x.isDirectory()).collect(Collectors.toList()); |
| 267 | + } |
| 268 | + |
| 269 | + static public List<File> getAllToolsFolders() { |
| 270 | + List<File> res = new ArrayList<>(); |
| 271 | + res.add(BaseNoGui.getContentFile("tools-builder")); |
| 272 | + res.add(FileUtils.newFile(BaseNoGui.getHardwareFolder(), "tools", "avr")); |
| 273 | + res.add(new File(getSettingsFolder(), "packages")); |
| 274 | + return res.stream().filter(x -> x.isDirectory()).collect(Collectors.toList()); |
| 275 | + } |
| 276 | + |
244 | 277 | static public String getHardwarePath() {
|
245 | 278 | return getHardwareFolder().getAbsolutePath();
|
246 | 279 | }
|
|
0 commit comments