mirror of
https://github.com/sbt/sbt.git
synced 2026-09-04 16:54:29 +02:00
Changes required to use sbt as-is from Scala-IDE.
This commit is contained in:
committed by
Mark Harrah
parent
e23df839b7
commit
b5a29987e6
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package xsbti.compile;
|
||||
|
||||
public interface CompileProgress {
|
||||
void startUnit(String phase, String unitPath);
|
||||
|
||||
boolean advance(int current, int total);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
+9
@@ -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
|
||||
{
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
+12
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user