File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 1- try {
2-
31def file = new File (basedir, ' target' )
4- assert ! file. exists()
52
6- return true
3+ if (file. exists()){
4+ def targetEmpty = file. listFiles()
5+ .findAll { it. name != " project-local-repo" }
6+ .isEmpty()
77
8- } catch (Throwable e) {
9- e. printStackTrace()
10- return false
8+ return targetEmpty
119}
10+
11+ return true
Original file line number Diff line number Diff line change @@ -64,12 +64,10 @@ public class ScalaDocMojo extends ScalaSourceMojoSupport implements MavenReport
6464
6565 @ Override
6666 protected List <File > getSourceDirectories () throws Exception {
67- List <String > sources = project .getCompileSourceRoots ();
6867 // Quick fix in case the user has not added the "add-source" goal.
6968 String scalaSourceDir = FileUtils .pathOf (sourceDir , useCanonicalPath );
70- if (!sources .contains (scalaSourceDir )) {
71- sources .add (scalaSourceDir );
72- }
69+ project .addCompileSourceRoot (scalaSourceDir );
70+ List <String > sources = project .getCompileSourceRoots ();
7371 return normalize (sources );
7472 }
7573
Original file line number Diff line number Diff line change @@ -77,11 +77,9 @@ protected File getOutputDir() {
7777
7878 @ Override
7979 protected List <File > getSourceDirectories () throws Exception {
80- List <String > sources = project .getTestCompileSourceRoots ();
8180 String scalaSourceDir = testSourceDir .getAbsolutePath ();
82- if (!sources .contains (scalaSourceDir )) {
83- sources .add (scalaSourceDir );
84- }
81+ project .addTestCompileSourceRoot (scalaSourceDir );
82+ List <String > sources = project .getTestCompileSourceRoots ();
8583 return normalize (sources );
8684 }
8785
You can’t perform that action at this time.
0 commit comments