+ /*
+ * Collect all files which affect YANG context. This includes all
+ * files in current project and optionally any jars/files in the
+ * dependencies.
+ */
+ final Collection<File> yangFilesInProject = Util.listFiles(yangFilesRootDir, excludedFiles);
+
+
+ final Collection<File> allFiles = new ArrayList<>(yangFilesInProject);
+ if (inspectDependencies) {
+ allFiles.addAll(Util.findYangFilesInDependencies(project));
+ }
+
+ if (allFiles.isEmpty()) {
+ LOG.info("{} No input files found", LOG_PREFIX);
+ return null;
+ }
+
+ /*
+ * Check if any of the listed files changed. If no changes occurred,
+ * simply return null, which indicates and of execution.
+ */
+ boolean noChange = true;
+ for (final File f : allFiles) {
+ if (buildContext.hasDelta(f)) {
+ LOG.debug("{} buildContext {} indicates {} changed, forcing regeneration", LOG_PREFIX,
+ buildContext, f);
+ noChange = false;
+ }
+ }
+
+ if (noChange) {
+ LOG.info("{} None of {} input files changed", LOG_PREFIX, allFiles.size());
+ return null;
+ }
+
+ final List<NamedFileInputStream> yangsInProject = new ArrayList<>();
+ for (final File f : yangFilesInProject) {
+ // FIXME: This is hack - normal path should be reported.
+ yangsInProject.add(new NamedFileInputStream(f, META_INF_YANG_STRING + File.separator + f.getName()));
+ }
+
+ List<InputStream> all = new ArrayList<>();
+ all.addAll(yangsInProject);