Skip to content

Commit 928d599

Browse files
author
Libor Rysavy
committed
Some minor code/comment/javadoc fixes
1 parent cd85cf9 commit 928d599

File tree

6 files changed

+36
-42
lines changed

6 files changed

+36
-42
lines changed

Diff for: .gitignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ interpolated-*.xml
4040
#SHITTY output not in target directory
4141
build.log
4242

43-
/maven-scala-plugin.iml
44-
/maven-scala-plugin.ipr
45-
/maven-scala-plugin.iws
43+
# IDEA conf files
44+
*.iml
45+
*.ipr
46+
*.iws

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Currently, you need Maven 3.x to build the plugin, create the site, and run `int
2525
* `mvn package` : generate jar
2626
* `mvn site` : generate the plugin website
2727
* `mvn integration-test` : `mvn package` + run all integration test
28+
* note: to run _test\_scalaHome_: you have to set `scala.home` property in `src/it/test_scalaHome/pom.xml` to correspond to your environment
2829
* `mvn invoker:run -Dinvoker.test=test1` : run integration test 'test1' useful for tuning/debug
2930
* `mvn install` : `mvn integration-test` + publish on local maven repository
3031
* `mvn install -Dmaven.test.skip=true` : `mvn install` without run of unit test and run of integration test

Diff for: src/main/java/scala_maven/ScalaCompilerSupport.java

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package scala_maven;
22

3-
import java.io.File;
4-
import java.util.ArrayList;
5-
import java.util.HashMap;
6-
import java.util.Map;
7-
import java.util.List;
83
import org.apache.maven.model.Plugin;
94
import org.apache.maven.plugin.descriptor.PluginDescriptor;
105
import org.apache.maven.project.MavenProject;
@@ -13,6 +8,12 @@
138
import scala_maven_executions.JavaMainCaller;
149
import scala_maven_executions.MainHelper;
1510

11+
import java.io.File;
12+
import java.util.ArrayList;
13+
import java.util.HashMap;
14+
import java.util.List;
15+
import java.util.Map;
16+
1617
/**
1718
* Abstract parent of all Scala Mojo who run compilation
1819
*/
@@ -27,25 +28,19 @@ public abstract class ScalaCompilerSupport extends ScalaSourceMojoSupport {
2728
*/
2829
private boolean compileErrors;
2930

30-
31-
/**
32-
* Pause duration between to scan to detect changed file to compile.
33-
* Used only if compileInLoop or testCompileInLoop is true.
34-
*/
35-
protected long loopSleep = 2500;
36-
3731
/**
3832
* Recompile mode to use when sources were previously compiled and there is at least one change:
3933
* "modified-only" => only modified sources are recompiled (pre 2.13 behavior), "all" => all sources are recompiled,
4034
* "incremental" => incrementally recompile modified sources and other affected sources.
35+
*
4136
* @parameter expression="${recompileMode}" default-value="all"
4237
*/
4338
protected String recompileMode = ALL;
4439

4540
/**
4641
* notifyCompilation if true then print a message "path: compiling"
4742
* for each root directory or files that will be compiled.
48-
* Usefull for debug, and for integration with Editor/IDE to reset markers only for compiled files.
43+
* Useful for debug, and for integration with Editor/IDE to reset markers only for compiled files.
4944
*
5045
* @parameter expression="${notifyCompilation}" default-value="true"
5146
*/

Diff for: src/main/java/scala_maven/ScalaDocMojo.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package scala_maven;
22

3-
import java.io.File;
4-
import java.util.ArrayList;
5-
import java.util.Calendar;
6-
import java.util.List;
7-
import java.util.Locale;
8-
93
import org.apache.maven.project.MavenProject;
104
import org.apache.maven.reporting.MavenReport;
115
import org.apache.maven.reporting.MavenReportException;
126
import org.codehaus.doxia.sink.Sink;
137
import org.codehaus.plexus.util.StringUtils;
14-
158
import scala_maven_executions.JavaMainCaller;
169
import scala_maven_executions.MainHelper;
1710

11+
import java.io.File;
12+
import java.util.ArrayList;
13+
import java.util.Calendar;
14+
import java.util.List;
15+
import java.util.Locale;
16+
1817
/**
1918
* Produces Scala API documentation.
2019
*
@@ -414,7 +413,6 @@ protected void aggregate(MavenProject parent) throws Exception {
414413
* Method that sets the bottom text that will be displayed on the bottom of
415414
* the javadocs.
416415
*
417-
* @param inceptionYear the year when the project was started
418416
* @return a String that contains the text that will be displayed at the
419417
* bottom of the javadoc
420418
*/

Diff for: src/main/java/scala_maven/ScalaMojoSupport.java

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
package scala_maven;
22

3-
import java.io.File;
4-
import java.util.ArrayList;
5-
import java.util.Arrays;
6-
import java.util.Collections;
7-
import java.util.HashSet;
8-
import java.util.LinkedHashSet;
9-
import java.util.List;
10-
import java.util.Set;
11-
123
import org.apache.maven.artifact.Artifact;
134
import org.apache.maven.artifact.ArtifactUtils;
145
import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -21,7 +12,6 @@
2112
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
2213
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
2314
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
24-
import org.apache.maven.artifact.versioning.VersionRange;
2515
import org.apache.maven.execution.MavenSession;
2616
import org.apache.maven.model.Dependency;
2717
import org.apache.maven.plugin.AbstractMojo;
@@ -49,6 +39,14 @@
4939
import scala_maven_executions.JavaMainCallerInProcess;
5040
import scala_maven_executions.MainHelper;
5141

42+
import java.io.File;
43+
import java.util.ArrayList;
44+
import java.util.Collections;
45+
import java.util.HashSet;
46+
import java.util.LinkedHashSet;
47+
import java.util.List;
48+
import java.util.Set;
49+
5250
public abstract class ScalaMojoSupport extends AbstractMojo {
5351

5452
public static final String SCALA_GROUPID= "org.scala-lang";
@@ -197,15 +195,16 @@ public abstract class ScalaMojoSupport extends AbstractMojo {
197195
*
198196
* @parameter expression="${javacArgs}"
199197
*/
200-
protected String[] javacArgs;@SuppressWarnings("unused")
198+
protected String[] javacArgs;
201199

202200
/**
203201
* Whether to instruct javac to generate debug symbols (when using incremental compiler)
204-
* @see {@link http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debug}
202+
* @see <a href="http://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debug">://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debug</a>
205203
*
206204
* @parameter expression="${javacGenerateDebugSymbols}"
207205
* default-value="true"
208206
*/
207+
@SuppressWarnings("unused")
209208
protected boolean javacGenerateDebugSymbols = true;
210209

211210
/**
@@ -278,7 +277,7 @@ public abstract class ScalaMojoSupport extends AbstractMojo {
278277

279278
/**
280279
* Should use CanonicalPath to normalize path (true => getCanonicalPath, false => getAbsolutePath)
281-
* @see https://github.com/davidB/maven-scala-plugin/issues/50
280+
* @see <a href="https://github.com/davidB/maven-scala-plugin/issues/50">https://github.com/davidB/maven-scala-plugin/issues/50</a>
282281
* @parameter expression="${maven.scala.useCanonicalPath}" default-value="true"
283282
*/
284283
protected boolean useCanonicalPath = true;

Diff for: src/main/java/scala_maven/ScalaSourceMojoSupport.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package scala_maven;
22

3+
import scala_maven_executions.MainHelper;
4+
35
import java.io.File;
46
import java.util.ArrayList;
57
import java.util.Collections;
68
import java.util.HashSet;
79
import java.util.List;
810
import java.util.Set;
911

10-
import scala_maven_executions.MainHelper;
11-
1212
/**
1313
* @author david.bernard
1414
*/
@@ -48,7 +48,7 @@ abstract public class ScalaSourceMojoSupport extends ScalaMojoSupport {
4848
protected Set<String> excludes = new HashSet<String>();
4949

5050
/**
51-
* Retreives the list of *all* root source directories. We need to pass all .java and .scala files into the scala compiler
51+
* Retrieves the list of *all* root source directories. We need to pass all .java and .scala files into the scala compiler
5252
*/
5353
abstract protected List<File> getSourceDirectories() throws Exception;
5454

@@ -103,8 +103,8 @@ protected List<File> findSourceWithFilters(List<File> sourceRootDirs) throws Exc
103103
sourceFiles.add(tmpAbsFile);
104104
}
105105
}
106-
//scalac is sensible to scala file order, file system can't garanty file order => unreproductible build error across platform
107-
// to garanty reproductible command line we order file by path (os dependend).
106+
// scalac is sensitive to scala file order, file system can't guarantee file order => unreproducible build error across platforms
107+
// sort files by path (OS dependent) to guarantee reproducible command line.
108108
Collections.sort(sourceFiles);
109109
return sourceFiles;
110110
}

0 commit comments

Comments
 (0)