Changes required to use sbt as-is from Scala-IDE.

This commit is contained in:
Eugene Vigdorchik 2012-07-10 21:12:39 +04:00 committed by Mark Harrah
parent 35cfba21c0
commit 550599bea0
11 changed files with 62 additions and 10 deletions

View File

@ -9,9 +9,13 @@ SourceAPI
packages : Package*
definitions: Definition*
OutputSetting
sourceDirectory: String
outputDirectory: String
Compilation
startTime: Long
target: String
outputs: OutputSetting*
Package
name: String

View File

@ -7,5 +7,5 @@ import java.io.File;
public interface CachedCompiler
{
public void run(File[] sources, DependencyChanges cpChanges, AnalysisCallback callback, Logger log, Reporter delegate);
public void run(File[] sources, DependencyChanges cpChanges, AnalysisCallback callback, Logger log, Reporter delegate, CompileProgress progress);
}

View File

@ -6,5 +6,5 @@ import xsbti.Reporter;
public interface CachedCompilerProvider
{
ScalaInstance scalaInstance();
CachedCompiler newCachedCompiler(String[] arguments, Logger log, Reporter reporter, boolean resident);
CachedCompiler newCachedCompiler(String[] arguments, Output output, Logger log, Reporter reporter, boolean resident);
}

View File

@ -0,0 +1,7 @@
package xsbti.compile;
public interface CompileProgress {
void startUnit(String phase, String unitPath);
boolean advance(int current, int total);
}

View File

@ -5,6 +5,6 @@ import xsbti.Reporter;
public interface GlobalsCache
{
public CachedCompiler apply(String[] args, boolean forceNew, CachedCompilerProvider provider, Logger log, Reporter reporter);
public CachedCompiler apply(String[] args, Output output, boolean forceNew, CachedCompilerProvider provider, Logger log, Reporter reporter);
public void clear();
}

View File

@ -11,5 +11,5 @@ public interface JavaCompiler
/** Compiles Java sources using the provided classpath, output directory, and additional options.
* If supported, the number of reported errors should be limited to `maximumErrors`.
* Output should be sent to the provided logger.*/
void compile(File[] sources, File[] classpath, File outputDirectory, String[] options, int maximumErrors, Logger log);
void compile(File[] sources, File[] classpath, Output output, String[] options, int maximumErrors, Logger log);
}

View File

@ -0,0 +1,20 @@
package xsbti.compile;
import java.io.File;
public interface MultipleOutput extends Output {
interface OutputGroup {
/** The directory where source files are stored for this group.
* Source directories should uniquely identify the group for a source file. */
File sourceDirectory();
/** The directory where class files should be generated.
* Incremental compilation will manage the class files in this directory.
* In particular, outdated class files will be deleted before compilation.
* It is important that this directory is exclusively used for one set of sources. */
File outputDirectory();
}
OutputGroup[] outputGroups();
}

View File

@ -13,11 +13,8 @@ public interface Options
* This should include Scala and Java sources, which are identified by their extension. */
File[] sources();
/** The directory where class files should be generated.
* Incremental compilation will manage the class files in this directory.
* In particular, outdated class files will be deleted before compilation.
* It is important that this directory is exclusively used for one set of sources. */
File classesDirectory();
/** Output for the compilation. */
Output output();
/** The options to pass to the Scala compiler other than the sources and classpath to use. */
String[] options();

View File

@ -0,0 +1,9 @@
package xsbti.compile;
import java.io.File;
/** Abstract interface denoting the output of the compilation. Inheritors are SingleOutput with a global output directory and
* MultipleOutput that specifies the output directory per source file.
*/
public interface Output
{
}

View File

@ -23,4 +23,7 @@ public interface Setup<Analysis>
File cacheFile();
GlobalsCache cache();
/** If returned, the progress that should be used to report scala compilation to. */
Maybe<CompileProgress> progress();
}

View File

@ -0,0 +1,12 @@
package xsbti.compile;
import java.io.File;
public interface SingleOutput extends Output {
/** The directory where class files should be generated.
* Incremental compilation will manage the class files in this directory.
* In particular, outdated class files will be deleted before compilation.
* It is important that this directory is exclusively used for one set of sources. */
File outputDirectory();
}