Package scala_maven
Class ScalaCompilerSupport
java.lang.Object
org.apache.maven.plugin.AbstractMojo
scala_maven.ScalaMojoSupport
scala_maven.ScalaSourceMojoSupport
scala_maven.ScalaCompilerSupport
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ScalaCompileMojo
,ScalaContinuousCompileMojo
,ScalaTestCompileMojo
Abstract parent of all Scala Mojo who run compilation
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private String
Additional parameter to use to call zinc server It is a pipe '|' separated list of arguments, so it can be used from command line ("-DaddZincArgs=arg1|arg2|arg3|...").static final String
private boolean
Keeps track of if we get compile errors in incremental modeprivate String
Compile order for Scala and Java sources for sbt incremental compile.private SbtIncrementalCompiler
static final String
static final String
private boolean
notifyCompilation if true then print a message "path: compiling" for each root directory or files that will be compiled.protected String
Recompile mode to use when sources were previously compiled and there is at least one change: "modified-only" => only modified sources are recompiled (pre 2.13 behavior), "all" => all sources are recompiled, "incremental" => incrementally recompile modified sources and other affected sources.private boolean
Use zinc server for incremental recompilation.private String
Zinc server host, if running with incremental zinc server mode.private int
Zinc server port, if running with incremental zinc server mode.Fields inherited from class scala_maven.ScalaSourceMojoSupport
excludes, includes, sendJavaToScalac
Fields inherited from class scala_maven.ScalaMojoSupport
addJavacArgs, addScalacArgs, args, checkMultipleScalaVersions, compilerPlugins, dependencies, displayCmd, encoding, factory, failOnMultipleScalaVersions, forceUseArgFile, fork, JAR, javacArgs, javacGenerateDebugSymbols, jvmArgs, localRepo, mavenProjectBuilder, POM, project, reactorProjects, remoteRepos, resolver, SCALA_COMPILER_ARTIFACTID, SCALA_LIBRARY_ARTIFACTID, scalaClassName, session, source, target, toolchainManager, useCanonicalPath
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected int
compile
(List<File> sourceRootDirs, File outputDir, File analysisCacheFile, List<String> classpathElements, boolean compileInLoop) protected File
defaultAnalysisCacheFile
(org.apache.maven.project.MavenProject p) protected File
defaultAnalysisDirectory
(org.apache.maven.project.MavenProject p) protected File
defaultTestAnalysisCacheFile
(org.apache.maven.project.MavenProject p) protected void
protected abstract File
Analysis cache file for incremental recompilation.getFilesToCompile
(List<File> sourceRootDirs, long lastSuccessfullCompileTime) protected abstract File
protected boolean
Returns true if the previous compile failedprotected int
incrementalCompile
(List<String> classpathElements, List<File> sourceRootDirs, File outputDir, File cacheFile, boolean compileInLoop) private void
notifyCompilation
(List<File> files) Methods inherited from class scala_maven.ScalaSourceMojoSupport
findSourceWithFilters, findSourceWithFilters, getSourceDirectories, initFilters, normalize
Methods inherited from class scala_maven.ScalaMojoSupport
addCompilerPluginOptions, addCompilerToClasspath, addLibraryToClasspath, addToClasspath, addToClasspath, addToClasspath, addToClasspath, checkScalaVersion, execute, findScalaVersion, findVersionFromDependencies, findVersionFromPluginArtifacts, getAllDependencies, getArtifactJar, getArtifactJar, getCompilerDependencies, getCompilerJar, getCompilerPluginOptions, getDependencies, getEmptyScalaCommand, getEmptyScalaCommand, getJavacOptions, getLibraryJar, getPluginArtifactJar, getPluginArtifactJar, getScalaCommand, getScalaCommand, getScalaOptions, getScalaOrganization, isJavaSupportedByCompiler, resolveArtifactDependencies, resolveDependencyArtifacts, resolveDependencyArtifacts, scalaCompilerArtifact
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
ALL
- See Also:
-
MODIFIED_ONLY
- See Also:
-
INCREMENTAL
- See Also:
-
compileErrors
private boolean compileErrorsKeeps track of if we get compile errors in incremental mode -
recompileMode
Recompile mode to use when sources were previously compiled and there is at least one change: "modified-only" => only modified sources are recompiled (pre 2.13 behavior), "all" => all sources are recompiled, "incremental" => incrementally recompile modified sources and other affected sources. -
notifyCompilation
@Parameter(property="notifyCompilation", defaultValue="true") private boolean notifyCompilationnotifyCompilation if true then print a message "path: compiling" for each root directory or files that will be compiled. Useful for debug, and for integration with Editor/IDE to reset markers only for compiled files. -
_lastCompileAt
private long _lastCompileAt -
incremental
-
compileOrder
Compile order for Scala and Java sources for sbt incremental compile. Can be Mixed, JavaThenScala, or ScalaThenJava. -
useZincServer
@Parameter(property="useZincServer", defaultValue="false") private boolean useZincServerUse zinc server for incremental recompilation. -
zincPort
@Parameter(property="zincPort", defaultValue="3030") private int zincPortZinc server port, if running with incremental zinc server mode. -
zincHost
Zinc server host, if running with incremental zinc server mode. Defaults to 127.0.0.1. -
addZincArgs
Additional parameter to use to call zinc server It is a pipe '|' separated list of arguments, so it can be used from command line ("-DaddZincArgs=arg1|arg2|arg3|...").
-
-
Constructor Details
-
ScalaCompilerSupport
public ScalaCompilerSupport()
-
-
Method Details
-
getOutputDir
- Throws:
Exception
-
getClasspathElements
- Throws:
Exception
-
getAnalysisCacheFile
Analysis cache file for incremental recompilation.- Throws:
Exception
-
doExecute
- Specified by:
doExecute
in classScalaMojoSupport
- Throws:
Exception
-
compile
protected int compile(List<File> sourceRootDirs, File outputDir, File analysisCacheFile, List<String> classpathElements, boolean compileInLoop) throws Exception, InterruptedException - Throws:
Exception
InterruptedException
-
hasCompileErrors
protected boolean hasCompileErrors()Returns true if the previous compile failed -
clearCompileErrors
protected void clearCompileErrors() -
getFilesToCompile
protected List<File> getFilesToCompile(List<File> sourceRootDirs, long lastSuccessfullCompileTime) throws Exception - Throws:
Exception
-
notifyCompilation
- Throws:
Exception
-
incrementalCompile
protected int incrementalCompile(List<String> classpathElements, List<File> sourceRootDirs, File outputDir, File cacheFile, boolean compileInLoop) throws Exception, InterruptedException - Throws:
Exception
InterruptedException
-
getAnalysisCacheMap
-
defaultAnalysisDirectory
-
defaultAnalysisCacheFile
-
defaultTestAnalysisCacheFile
-