| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -128,7 +128,7 @@ protected void handle() { | |||
| 128 | 128 | StringDict exportTable = exportSettings.exists() ? | |
| 129 | 129 | Util.readSettings(exportSettings) : new StringDict(); | |
| 130 | 130 | ||
| 131 | - exportList = new HashMap<String, String[]>(); | ||
| 131 | + exportList = new HashMap<>(); | ||
| 132 | 132 | ||
| 133 | 133 | // get the list of files just in the library root | |
| 134 | 134 | String[] baseList = libraryFolder.list(standardFilter); | |
@@ -298,7 +298,7 @@ public void addPackageList(Map<String, List<Library>> importToLibraryTable) { | |||
| 298 | 298 | // Library library = importToLibraryTable.get(pkg); | |
| 299 | 299 | List<Library> libraries = importToLibraryTable.get(pkg); | |
| 300 | 300 | if (libraries == null) { | |
| 301 | - libraries = new ArrayList<Library>(); | ||
| 301 | + libraries = new ArrayList<>(); | ||
| 302 | 302 | importToLibraryTable.put(pkg, libraries); | |
| 303 | 303 | } else { | |
| 304 | 304 | if (Base.DEBUG) { | |
@@ -470,10 +470,10 @@ static public boolean hasMultipleArch(int platform, List<Library> libraries) { | |||
| 470 | 470 | ||
| 471 | 471 | static protected FilenameFilter junkFolderFilter = new FilenameFilter() { | |
| 472 | 472 | public boolean accept(File dir, String name) { | |
| 473 | - // skip .DS_Store files, .svn folders, etc | ||
| 473 | + // skip .DS_Store files, .svn and .git folders, etc | ||
| 474 | 474 | if (name.charAt(0) == '.') return false; | |
| 475 | - if (name.equals("CVS")) return false; | ||
| 476 | - return (new File(dir, name).isDirectory()); | ||
| 475 | + if (name.equals("CVS")) return false; // old skool | ||
| 476 | + return new File(dir, name).isDirectory(); | ||
| 477 | 477 | } | |
| 478 | 478 | }; | |
| 479 | 479 | ||
@@ -482,12 +482,14 @@ static public List<File> discover(File folder) { | |||
| 482 | 482 | List<File> libraries = new ArrayList<>(); | |
| 483 | 483 | String[] folderNames = folder.list(junkFolderFilter); | |
| 484 | 484 | ||
| 485 | - // if a bad folder or something like that, this might come back null | ||
| 485 | + // if a bad folder or unreadable, folderNames might be null | ||
| 486 | 486 | if (folderNames != null) { | |
| 487 | 487 | // alphabetize list, since it's not always alpha order | |
| 488 | 488 | // replaced hella slow bubble sort with this feller for 0093 | |
| 489 | 489 | Arrays.sort(folderNames, String.CASE_INSENSITIVE_ORDER); | |
| 490 | 490 | ||
| 491 | + // TODO some weirdness because ContributionType.LIBRARY.isCandidate() | ||
| 492 | + // handles some, but not all, of this [fry 200116] | ||
| 491 | 493 | for (String potentialName : folderNames) { | |
| 492 | 494 | File baseFolder = new File(folder, potentialName); | |
| 493 | 495 | File libraryFolder = new File(baseFolder, "library"); | |
@@ -500,22 +502,13 @@ static public List<File> discover(File folder) { | |||
| 500 | 502 | libraries.add(baseFolder); | |
| 501 | 503 | ||
| 502 | 504 | } else { | |
| 503 | - String mess = "The library \"" | ||
| 504 | - + potentialName | ||
| 505 | - + "\" cannot be used.\n" | ||
| 506 | - + "Library names must contain only basic letters and numbers.\n" | ||
| 507 | - + "(ASCII only and no spaces, and it cannot start with a number)"; | ||
| 505 | + final String mess = | ||
| 506 | + "The library \"" + potentialName + "\" cannot be used.\n" + | ||
| 507 | + "Library names must contain only basic letters and numbers.\n" + | ||
| 508 | + "(ASCII only and no spaces, and it cannot start with a number)"; | ||
| 508 | 509 | Messages.showMessage("Ignoring bad library name", mess); | |
| 509 | 510 | continue; | |
| 510 | 511 | } | |
| 511 | - /* | ||
| 512 | - } else { // maybe it's a JS library | ||
| 513 | - // TODO this should be in a better location | ||
| 514 | - File jsLibrary = new File(libraryFolder, potentialName + ".js"); | ||
| 515 | - if (jsLibrary.exists()) { | ||
| 516 | - libraries.add(baseFolder); | ||
| 517 | - } | ||
| 518 | - */ | ||
| 519 | 512 | } | |
| 520 | 513 | } | |
| 521 | 514 | } | |
@@ -532,6 +525,7 @@ static public List<Library> list(File folder) { | |||
| 532 | 525 | libraries.add(new Library(baseFolder)); | |
| 533 | 526 | } | |
| 534 | 527 | ||
| 528 | + /* | ||
| 535 | 529 | // Support libraries inside of one level of subfolders? I believe this was | |
| 536 | 530 | // the compromise for supporting library groups, but probably a bad idea | |
| 537 | 531 | // because it's not compatible with the Manager. | |
@@ -548,6 +542,7 @@ static public List<Library> list(File folder) { | |||
| 548 | 542 | } | |
| 549 | 543 | } | |
| 550 | 544 | } | |
| 545 | + */ | ||
| 551 | 546 | return libraries; | |
| 552 | 547 | } | |
| 553 | 548 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments