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 longprivate StringAdditional 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 Stringprivate booleanKeeps track of if we get compile errors in incremental modeprivate StringCompile order for Scala and Java sources for sbt incremental compile.private SbtIncrementalCompilerstatic final Stringstatic final Stringprivate booleannotifyCompilation if true then print a message "path: compiling" for each root directory or files that will be compiled.protected StringRecompile 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 booleanUse zinc server for incremental recompilation.private StringZinc server host, if running with incremental zinc server mode.private intZinc server port, if running with incremental zinc server mode.Fields inherited from class scala_maven.ScalaSourceMojoSupport
excludes, includes, sendJavaToScalacFields 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, useCanonicalPathFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected intcompile(List<File> sourceRootDirs, File outputDir, File analysisCacheFile, List<String> classpathElements, boolean compileInLoop) protected FiledefaultAnalysisCacheFile(org.apache.maven.project.MavenProject p) protected FiledefaultAnalysisDirectory(org.apache.maven.project.MavenProject p) protected FiledefaultTestAnalysisCacheFile(org.apache.maven.project.MavenProject p) protected voidprotected abstract FileAnalysis cache file for incremental recompilation.getFilesToCompile(List<File> sourceRootDirs, long lastSuccessfullCompileTime) protected abstract Fileprotected booleanReturns true if the previous compile failedprotected intincrementalCompile(List<String> classpathElements, List<File> sourceRootDirs, File outputDir, File cacheFile, boolean compileInLoop) private voidnotifyCompilation(List<File> files) Methods inherited from class scala_maven.ScalaSourceMojoSupport
findSourceWithFilters, findSourceWithFilters, getSourceDirectories, initFilters, normalizeMethods 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, scalaCompilerArtifactMethods 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:
doExecutein classScalaMojoSupport- Throws:
Exception
-
compile
protected int compile(List<File> sourceRootDirs, File outputDir, File analysisCacheFile, List<String> classpathElements, boolean compileInLoop) throws Exception, InterruptedException - Throws:
ExceptionInterruptedException
-
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:
ExceptionInterruptedException
-
getAnalysisCacheMap
-
defaultAnalysisDirectory
-
defaultAnalysisCacheFile
-
defaultTestAnalysisCacheFile
-