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
-
3
1
def file = new File (basedir, ' target' )
4
- assert ! file. exists()
5
2
6
- return true
3
+ if (file. exists()){
4
+ def targetEmpty = file. listFiles()
5
+ .findAll { it. name != " project-local-repo" }
6
+ .isEmpty()
7
7
8
- } catch (Throwable e) {
9
- e. printStackTrace()
10
- return false
8
+ return targetEmpty
11
9
}
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
64
64
65
65
@ Override
66
66
protected List <File > getSourceDirectories () throws Exception {
67
- List <String > sources = project .getCompileSourceRoots ();
68
67
// Quick fix in case the user has not added the "add-source" goal.
69
68
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 ();
73
71
return normalize (sources );
74
72
}
75
73
Original file line number Diff line number Diff line change @@ -77,11 +77,9 @@ protected File getOutputDir() {
77
77
78
78
@ Override
79
79
protected List <File > getSourceDirectories () throws Exception {
80
- List <String > sources = project .getTestCompileSourceRoots ();
81
80
String scalaSourceDir = testSourceDir .getAbsolutePath ();
82
- if (!sources .contains (scalaSourceDir )) {
83
- sources .add (scalaSourceDir );
84
- }
81
+ project .addTestCompileSourceRoot (scalaSourceDir );
82
+ List <String > sources = project .getTestCompileSourceRoots ();
85
83
return normalize (sources );
86
84
}
87
85
You can’t perform that action at this time.
0 commit comments