@Test public void givenAJavaccSourceFileWhenVisitFileThenDelegatesToTaskCompile() { FileVisitDetails fileDetails = mock(FileVisitDetails.class); when(fileDetails.getFile()).thenReturn(new File(JAVACC_SOURCE_FILE)); when(fileDetails.getName()).thenReturn(JAVACC_SOURCE_FILE); when(fileDetails.getPath()).thenReturn(JAVACC_SOURCE_FILE); sourceVisitor.visitFile(fileDetails); verify(compiler).compile(any(File.class), any(RelativePath.class)); }
@Override public void visitFile(FileVisitDetails fileDetails) { if (isValidSourceFileForTask(fileDetails)) { compiler.compile(computeInputDirectory(fileDetails), fileDetails.getRelativePath()); } else { compiler.getLogger().debug("Skipping file {} as it is not supported by program {}", fileDetails.getFile().getAbsolutePath(), compiler.getProgramName()); } }
JavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (isValidSourceFileForTask(fileDetails)) { compiler.compile(computeInputDirectory(fileDetails), fileDetails.getRelativePath()); } else { compiler.getLogger().debug("Skipping file {} as it is not supported by program {}", fileDetails.getFile().getAbsolutePath(), compiler.getProgramName()); } } }
JavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (isValidSourceFileForTask(fileDetails)) { compiler.compile(computeInputDirectory(fileDetails), fileDetails.getRelativePath()); } else { compiler.getLogger().debug("Skipping file {} as it is not supported by program {}", fileDetails.getFile().getAbsolutePath(), compiler.getProgramName()); } } JavaccSourceFileVisitor(SourceFileCompiler compiler); }
JavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (isValidSourceFileForTask(fileDetails)) { compiler.compile(computeInputDirectory(fileDetails), fileDetails.getRelativePath()); } else { compiler.getLogger().debug("Skipping file {} as it is not supported by program {}", fileDetails.getFile().getAbsolutePath(), compiler.getProgramName()); } } JavaccSourceFileVisitor(SourceFileCompiler compiler); @Override void visitFile(FileVisitDetails fileDetails); }
JavaccSourceFileVisitor extends EmptyFileVisitor { @Override public void visitFile(FileVisitDetails fileDetails) { if (isValidSourceFileForTask(fileDetails)) { compiler.compile(computeInputDirectory(fileDetails), fileDetails.getRelativePath()); } else { compiler.getLogger().debug("Skipping file {} as it is not supported by program {}", fileDetails.getFile().getAbsolutePath(), compiler.getProgramName()); } } JavaccSourceFileVisitor(SourceFileCompiler compiler); @Override void visitFile(FileVisitDetails fileDetails);  }