mirror of https://github.com/sbt/sbt.git
Setting up compiler support and several related additions to util/io
* Added the top-level interface project for communicating across scala versions within a jvm. * Added plugin project containing analysis compiler plugin * Added component compiler to build xsbt components against required version of Scala on the fly * Added interface to compiler that runs in the same version of Scala * Added frontend that compiles against a given version of Scala with or without analysis.
This commit is contained in:
parent
3c9cc8a944
commit
1864c12f74
|
|
@ -16,6 +16,7 @@ object CacheTest// extends Properties("Cache test")
|
||||||
val cTask = (createTask :: cached :: TNil) map { case (file :: len :: HNil) => println("File: " + file + " length: " + len); len :: file :: HNil }
|
val cTask = (createTask :: cached :: TNil) map { case (file :: len :: HNil) => println("File: " + file + " length: " + len); len :: file :: HNil }
|
||||||
val cachedC = Cache(cTask, new File("/tmp/c-cache"))
|
val cachedC = Cache(cTask, new File("/tmp/c-cache"))
|
||||||
|
|
||||||
TaskRunner(cachedC).left.foreach(_.foreach(f => f.exception.printStackTrace))
|
try { TaskRunner(cachedC) }
|
||||||
|
catch { case TasksFailed(failures) => failures.foreach(_.exception.printStackTrace) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/* sbt -- Simple Build Tool
|
||||||
|
* Copyright 2008, 2009 Mark Harrah
|
||||||
|
*/
|
||||||
|
package xsbti;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public interface AnalysisCallback
|
||||||
|
{
|
||||||
|
/** The names of classes that the analyzer should find subclasses of.*/
|
||||||
|
public String[] superclassNames();
|
||||||
|
/** Called when the the given superclass could not be found on the classpath by the compiler.*/
|
||||||
|
public void superclassNotFound(String superclassName);
|
||||||
|
/** Called before the source at the given location is processed. */
|
||||||
|
public void beginSource(File source);
|
||||||
|
/** Called when the a subclass of one of the classes given in <code>superclassNames</code> is
|
||||||
|
* discovered.*/
|
||||||
|
public void foundSubclass(File source, String subclassName, String superclassName, boolean isModule);
|
||||||
|
/** Called to indicate that the source file <code>source</code> depends on the source file
|
||||||
|
* <code>dependsOn</code>.*/
|
||||||
|
public void sourceDependency(File dependsOn, File source);
|
||||||
|
/** Called to indicate that the source file <code>source</code> depends on the jar
|
||||||
|
* <code>jar</code>.*/
|
||||||
|
public void jarDependency(File jar, File source);
|
||||||
|
/** Called to indicate that the source file <code>source</code> depends on the class file
|
||||||
|
* <code>clazz</code>.*/
|
||||||
|
public void classDependency(File clazz, File source);
|
||||||
|
/** Called to indicate that the source file <code>source</code> produces a class file at
|
||||||
|
* <code>module</code>.*/
|
||||||
|
public void generatedClass(File source, File module);
|
||||||
|
/** Called after the source at the given location has been processed. */
|
||||||
|
public void endSource(File sourcePath);
|
||||||
|
/** Called when a module with a public 'main' method with the right signature is found.*/
|
||||||
|
public void foundApplication(File source, String className);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
/* sbt -- Simple Build Tool
|
||||||
|
* Copyright 2009 Mark Harrah
|
||||||
|
*/
|
||||||
|
package xsbti;
|
||||||
|
|
||||||
|
/** Provides access to an AnalysisCallback. This is used by the plugin to
|
||||||
|
* get the callback to use. The scalac Global instance it is passed must
|
||||||
|
* implement this interface. */
|
||||||
|
public interface AnalysisCallbackContainer
|
||||||
|
{
|
||||||
|
public AnalysisCallback analysisCallback();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
/* sbt -- Simple Build Tool
|
||||||
|
* Copyright 2009 Mark Harrah
|
||||||
|
*/
|
||||||
|
package xsbti;
|
||||||
|
|
||||||
|
public interface F0<T>
|
||||||
|
{
|
||||||
|
public T apply();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
/* sbt -- Simple Build Tool
|
||||||
|
* Copyright 2009 Mark Harrah
|
||||||
|
*/
|
||||||
|
package xsbti;
|
||||||
|
|
||||||
|
public interface Logger
|
||||||
|
{
|
||||||
|
public void error(F0<String> msg);
|
||||||
|
public void warn(F0<String> msg);
|
||||||
|
public void info(F0<String> msg);
|
||||||
|
public void debug(F0<String> msg);
|
||||||
|
public void trace(F0<Throwable> exception);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue