Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/main/java/com/cj/jshintmojo/Mojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,22 @@ private List<File> findFilesToCheck() {
List<File> javascriptFiles = new ArrayList<File>();

for(String next: directories){
File path = new File(basedir, next);
if(!path.exists() && !path.isDirectory()){
getLog().warn("You told me to find tests in " + next + ", but there is nothing there (" + path.getAbsolutePath() + ")");
}else{
collect(path, javascriptFiles);
}
File path = new File(basedir, next);
if(path.exists() && path.isDirectory()){
getLog().debug("You told me to find tests in " + next + ", which resolves to (" + path.getAbsolutePath() + ")");
}else{
File alternativePath = new File(next);
if(alternativePath.isAbsolute() && alternativePath.exists() && alternativePath.isDirectory()){
path = alternativePath;
getLog().debug("You told me to find tests in " + next + ", which resolves to (" + path.getAbsolutePath() + ")");
}else{
getLog().warn("You told me to find tests in " + next + ", but there is nothing there (" + path.getAbsolutePath() + ")");
path = null;
}
}
if(path != null){
collect(path, javascriptFiles);
}
}

List<File> matches = FunctionalJava.filter(javascriptFiles, new Fn<File, Boolean>(){
Expand Down