// Path: src/com/microchip/mplab/nbide/embedded/arduino/importer/Board.java
// public static final PathMatcher SOURCE_FILE_MATCHER = FileSystems.getDefault().getPathMatcher("glob:*.{c,cpp,S}");    


import static com.microchip.mplab.nbide.embedded.arduino.importer.Board.SOURCE_FILE_MATCHER;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.logging.Logger;
import java.util.stream.Collectors;
                    } else {
                        throw new IllegalArgumentException("Did not find any variant directory for board \"" + board.getBoardId() + "\"");
                    }
                }
                return variantPath;
            } else {
                throw new IllegalArgumentException("Did not find any variant directory for board \"" + board.getBoardId() + "\"");
            }
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }

    public List<Path> getCoreFilePaths() throws IOException {
        Path variantPath = getVariantPath();
        Path corePath = getCoreDirectoryPath();

        // Find source files in variant directory:
        List<Path> variantFilePaths = new ArrayList<>();
        if (variantPath != null) {
            variantFilePaths = Files.list(variantPath)
                    .filter(filePath -> SOURCE_FILE_MATCHER.matches(filePath.getFileName()))
                    .collect(Collectors.toList());
        }

        // Create a list of source file names from the variant directory that will be used to filter core source files:
        List<String> variantFileNames = variantFilePaths.stream().map(p -> p.getFileName().toString()).collect(Collectors.toList());

        // Find source files in core directory but only those that have not been overriden in the variant directory:
        List<Path> coreFilePaths = Files.list(corePath)
// Path: src/com/microchip/mplab/nbide/embedded/arduino/importer/Board.java
// public static final PathMatcher SOURCE_FILE_MATCHER = FileSystems.getDefault().getPathMatcher("glob:*.{c,cpp,S}");    


// Path: src/com/microchip/mplab/nbide/embedded/arduino/importer/BoardConfiguration.java
import static com.microchip.mplab.nbide.embedded.arduino.importer.Board.SOURCE_FILE_MATCHER;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.logging.Logger;
import java.util.stream.Collectors;

                    } else {
                        throw new IllegalArgumentException("Did not find any variant directory for board \"" + board.getBoardId() + "\"");
                    }
                }
                return variantPath;
            } else {
                throw new IllegalArgumentException("Did not find any variant directory for board \"" + board.getBoardId() + "\"");
            }
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }

    public List<Path> getCoreFilePaths() throws IOException {
        Path variantPath = getVariantPath();
        Path corePath = getCoreDirectoryPath();

        // Find source files in variant directory:
        List<Path> variantFilePaths = new ArrayList<>();
        if (variantPath != null) {
            variantFilePaths = Files.list(variantPath)
                    .filter(filePath -> SOURCE_FILE_MATCHER.matches(filePath.getFileName()))
                    .collect(Collectors.toList());
        }

        // Create a list of source file names from the variant directory that will be used to filter core source files:
        List<String> variantFileNames = variantFilePaths.stream().map(p -> p.getFileName().toString()).collect(Collectors.toList());

        // Find source files in core directory but only those that have not been overriden in the variant directory:
        List<Path> coreFilePaths = Files.list(corePath)
                .filter(p -> SOURCE_FILE_MATCHER.matches(p.getFileName()))