Package scala_maven
Class ScalaContinuousCompileMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- scala_maven.ScalaMojoSupport
-
- scala_maven.ScalaSourceMojoSupport
-
- scala_maven.ScalaCompilerSupport
-
- scala_maven.ScalaContinuousCompileMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
ScalaContinuousTestMojo
@Mojo(name="cc", requiresDependencyResolution=TEST) public class ScalaContinuousCompileMojo extends ScalaCompilerSupportCompile the main and test scala source directory in continuous (infinite loop). !! This is an util goal for commandline usage only (Do not use or call it in a pom) !!!
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classScalaContinuousCompileMojo.StopServer
-
Field Summary
Fields Modifier and Type Field Description protected java.io.FileanalysisCacheFileAnalysis cache file for incremental recompilation.protected java.io.FilemainOutputDirThe output directory for compilation.protected java.io.FilemainSourceDirThe main directory containing scala source for compilationprotected booleanonceDefine if cc should run once or in infinite loop.protected java.io.FiletestAnalysisCacheFileAnalysis cache file for incremental recompilation.protected java.io.FiletestOutputDirThe directory to place test compilation output inprotected java.io.FiletestSourceDirThe directory containing test source for compilationprotected booleanuseFscDefine if fsc should be used, else scalac is used.protected booleanverboseTurns verbose output on.-
Fields inherited from class scala_maven.ScalaCompilerSupport
ALL, INCREMENTAL, MODIFIED_ONLY, recompileMode
-
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
-
-
Constructor Summary
Constructors Constructor Description ScalaContinuousCompileMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute()protected java.io.FilegetAnalysisCacheFile()Analysis cache file for incremental recompilation.protected java.util.List<java.lang.String>getClasspathElements()protected java.io.FilegetOutputDir()protected JavaMainCallergetScalaCommand()protected java.util.List<java.io.File>getSourceDirectories()Retrieves the list of *all* root source directories.protected voidpostCompileActions()Allows derived Mojos to do things after a compile has succesfully completed such as run test casesprivate voidstartNewCompileServer()-
Methods inherited from class scala_maven.ScalaCompilerSupport
clearCompileErrors, compile, defaultAnalysisCacheFile, defaultAnalysisDirectory, defaultTestAnalysisCacheFile, getAnalysisCacheMap, getFilesToCompile, hasCompileErrors, incrementalCompile
-
Methods inherited from class scala_maven.ScalaSourceMojoSupport
findSourceWithFilters, findSourceWithFilters, 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, getScalaOptions, getScalaOrganization, isJavaSupportedByCompiler, resolveArtifactDependencies, resolveDependencyArtifacts, resolveDependencyArtifacts, scalaCompilerArtifact
-
-
-
-
Field Detail
-
mainOutputDir
@Parameter(property="project.build.outputDirectory") protected java.io.File mainOutputDir
The output directory for compilation.
-
mainSourceDir
@Parameter(defaultValue="${project.build.sourceDirectory}/../scala") protected java.io.File mainSourceDirThe main directory containing scala source for compilation
-
testOutputDir
@Parameter(defaultValue="${project.build.testOutputDirectory}") protected java.io.File testOutputDirThe directory to place test compilation output in
-
testSourceDir
@Parameter(defaultValue="${project.build.testSourceDirectory}/../scala") protected java.io.File testSourceDirThe directory containing test source for compilation
-
analysisCacheFile
@Parameter(property="analysisCacheFile", defaultValue="${project.build.directory}/analysis/compile") protected java.io.File analysisCacheFileAnalysis cache file for incremental recompilation.
-
testAnalysisCacheFile
@Parameter(property="testAnalysisCacheFile", defaultValue="${project.build.directory}/analysis/test-compile") protected java.io.File testAnalysisCacheFileAnalysis cache file for incremental recompilation.
-
useFsc
@Parameter(property="fsc", defaultValue="true") protected boolean useFscDefine if fsc should be used, else scalac is used. fsc => scala.tools.nsc.CompileClient, scalac => scala.tools.nsc.Main.
-
once
@Parameter(property="once", defaultValue="false") protected boolean onceDefine if cc should run once or in infinite loop. (useful for test or working with editor)
-
verbose
@Parameter(property="verbose", defaultValue="false") protected boolean verboseTurns verbose output on.
-
-
Method Detail
-
getClasspathElements
protected java.util.List<java.lang.String> getClasspathElements() throws java.lang.Exception- Specified by:
getClasspathElementsin classScalaCompilerSupport- Throws:
java.lang.Exception
-
getOutputDir
protected java.io.File getOutputDir() throws java.lang.Exception- Specified by:
getOutputDirin classScalaCompilerSupport- Throws:
java.lang.Exception
-
getSourceDirectories
protected java.util.List<java.io.File> getSourceDirectories() throws java.lang.ExceptionDescription copied from class:ScalaSourceMojoSupportRetrieves the list of *all* root source directories. We need to pass all .java and .scala files into the scala compiler- Specified by:
getSourceDirectoriesin classScalaSourceMojoSupport- Throws:
java.lang.Exception
-
getAnalysisCacheFile
protected java.io.File getAnalysisCacheFile() throws java.lang.ExceptionDescription copied from class:ScalaCompilerSupportAnalysis cache file for incremental recompilation.- Specified by:
getAnalysisCacheFilein classScalaCompilerSupport- Throws:
java.lang.Exception
-
getScalaCommand
protected JavaMainCaller getScalaCommand() throws java.lang.Exception
- Overrides:
getScalaCommandin classScalaMojoSupport- Throws:
java.lang.Exception
-
doExecute
protected final void doExecute() throws java.lang.Exception- Overrides:
doExecutein classScalaCompilerSupport- Throws:
java.lang.Exception
-
postCompileActions
protected void postCompileActions() throws java.lang.ExceptionAllows derived Mojos to do things after a compile has succesfully completed such as run test cases- Throws:
java.lang.Exception
-
startNewCompileServer
private void startNewCompileServer() throws java.lang.Exception- Throws:
java.lang.Exception
-
-