Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Commit

Permalink
Merge 5694513 into 94052a1
Browse files Browse the repository at this point in the history
  • Loading branch information
BenNzewi committed Jul 19, 2018
2 parents 94052a1 + 5694513 commit 05eee89
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,14 @@ private Collection<Path> getPaths(final Path path, final String[] includes, fina
private void parseSourceDirectory(final GenerateGoalConfig config, final GeneratorConfig generatorConfig,
final Collection<Path> paths, boolean isPathFromClasspath) {
parser
.parse((isPathFromClasspath?Paths.get(format("%s/%s",config.getSourceDirectory().toString(),CLASSPATH)):config.getSourceDirectory()), paths)
.parse((isPathFromClasspath? getRequiredPath(config) :config.getSourceDirectory()), paths)
.forEach(file -> mojoGeneratorFactory.instanceOf(config.getGeneratorName()).run(file, generatorConfig));
}

private Path getRequiredPath(final GenerateGoalConfig config) {
return config.getSourceDirectory().toString().contains(CLASSPATH)? config.getSourceDirectory():Paths.get(format("%s/%s",config.getSourceDirectory().toString(),CLASSPATH));
}

private boolean isPathFromClasspath(final Path baseDir, final GenerateMojo.GenerationPath generationPath){
return baseDir.toString().contains(CLASSPATH) || (generationPath != null && generationPath.name()==(CLASSPATH));
}
Expand Down

0 comments on commit 05eee89

Please sign in to comment.