Package scala_maven

Class ScalaCompilerSupport

    • Field Detail

      • compileErrors

        private boolean compileErrors
        Keeps track of if we get compile errors in incremental mode
      • recompileMode

        @Parameter(property="recompileMode",
                   defaultValue="all")
        protected java.lang.String 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 notifyCompilation
        notifyCompilation 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
      • compileOrder

        @Parameter(property="compileOrder",
                   defaultValue="mixed")
        private java.lang.String 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 useZincServer
        Use zinc server for incremental recompilation.
      • zincPort

        @Parameter(property="zincPort",
                   defaultValue="3030")
        private int zincPort
        Zinc server port, if running with incremental zinc server mode.
      • zincHost

        @Parameter(property="zincHost",
                   defaultValue="127.0.0.1")
        private java.lang.String zincHost
        Zinc server host, if running with incremental zinc server mode. Defaults to 127.0.0.1.
      • addZincArgs

        @Parameter(property="addZincArgs")
        private java.lang.String 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 Detail

      • ScalaCompilerSupport

        public ScalaCompilerSupport()
    • Method Detail

      • getOutputDir

        protected abstract java.io.File getOutputDir()
                                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getClasspathElements

        protected abstract java.util.List<java.lang.String> getClasspathElements()
                                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAnalysisCacheFile

        protected abstract java.io.File getAnalysisCacheFile()
                                                      throws java.lang.Exception
        Analysis cache file for incremental recompilation.
        Throws:
        java.lang.Exception
      • doExecute

        protected void doExecute()
                          throws java.lang.Exception
        Specified by:
        doExecute in class ScalaMojoSupport
        Throws:
        java.lang.Exception
      • compile

        protected int compile​(java.util.List<java.io.File> sourceRootDirs,
                              java.io.File outputDir,
                              java.io.File analysisCacheFile,
                              java.util.List<java.lang.String> classpathElements,
                              boolean compileInLoop)
                       throws java.lang.Exception,
                              java.lang.InterruptedException
        Throws:
        java.lang.Exception
        java.lang.InterruptedException
      • hasCompileErrors

        protected boolean hasCompileErrors()
        Returns true if the previous compile failed
      • clearCompileErrors

        protected void clearCompileErrors()
      • getFilesToCompile

        protected java.util.List<java.io.File> getFilesToCompile​(java.util.List<java.io.File> sourceRootDirs,
                                                                 long lastSuccessfullCompileTime)
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • notifyCompilation

        private void notifyCompilation​(java.util.List<java.io.File> files)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • incrementalCompile

        protected int incrementalCompile​(java.util.List<java.lang.String> classpathElements,
                                         java.util.List<java.io.File> sourceRootDirs,
                                         java.io.File outputDir,
                                         java.io.File cacheFile,
                                         boolean compileInLoop)
                                  throws java.lang.Exception,
                                         java.lang.InterruptedException
        Throws:
        java.lang.Exception
        java.lang.InterruptedException
      • getAnalysisCacheMap

        protected java.util.Map<java.io.File,​java.io.File> getAnalysisCacheMap()
      • defaultAnalysisDirectory

        protected java.io.File defaultAnalysisDirectory​(org.apache.maven.project.MavenProject p)
      • defaultAnalysisCacheFile

        protected java.io.File defaultAnalysisCacheFile​(org.apache.maven.project.MavenProject p)
      • defaultTestAnalysisCacheFile

        protected java.io.File defaultTestAnalysisCacheFile​(org.apache.maven.project.MavenProject p)