basis for a resident compiler

unstable, but can be tested with -Dsbt.resident.limit=n
 n is the maximum Globals kept around
This commit is contained in:
Mark Harrah 2012-04-28 18:58:38 -04:00
parent dd78d17335
commit c6c6061639
5 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,11 @@
package xsbti.compile;
import xsbti.AnalysisCallback;
import xsbti.Logger;
import xsbti.Reporter;
import java.io.File;
public interface CachedCompiler
{
public void run(File[] sources, DependencyChanges cpChanges, AnalysisCallback callback, Logger log, Reporter delegate);
}

View File

@ -0,0 +1,10 @@
package xsbti.compile;
import xsbti.Logger;
import xsbti.Reporter;
public interface CachedCompilerProvider
{
ScalaInstance scalaInstance();
CachedCompiler newCachedCompiler(String[] arguments, Logger log, Reporter reporter);
}

View File

@ -0,0 +1,13 @@
package xsbti.compile;
import java.io.File;
// only includes changes to dependencies outside of the project
public interface DependencyChanges
{
boolean isEmpty();
// class files or jar files
File[] modifiedBinaries();
// class names
String[] modifiedClasses();
}

View File

@ -0,0 +1,10 @@
package xsbti.compile;
import xsbti.Logger;
import xsbti.Reporter;
public interface GlobalsCache
{
public CachedCompiler apply(String[] args, boolean forceNew, CachedCompilerProvider provider, Logger log, Reporter reporter);
public void clear();
}

View File

@ -21,4 +21,6 @@ public interface Setup<Analysis>
* This file can be removed to force a full recompilation.
* The file should be unique and not shared between compilations. */
File cacheFile();
GlobalsCache cache();
}