From 39428a996dcad6dca53c42356a65dc43d522d973 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Tue, 19 Feb 2013 00:16:51 -0800 Subject: [PATCH] Introduce incremental compiler options. Introduce a way to configure incremental compiler itself instead of underlying Java/Scala compiler. Specific list of changes in this commit: * Add a method to `xsbti.compile.Setup` that returns incremental compiler options as a `java.util.Map`. We considered statis interface instead of a `Map` but based on mailing list feedback we decided that it's not the best way to go because static interface is hard to evolve it by adding new options. * Since passing `java.util.Map` not very convenient we convert it immediately to `sbt.inc.IncOptions` * Add options argument to various methods/classes that implement incremental compilation so in the end options reach `sbt.inc.IncOptions` object * Add `incOptions` task that allows users to configure incremental compiler options in their build files. Default implementation of that tasks returns just `IncOptions.DEFAULT` * Both system property `xsbt.inc.debug` and `IncOptions.relationsDebug` trigger debugging of relations now. In the near future, we should deprecate use of `xsbt.inc.debug`. --- interface/src/main/java/xsbti/compile/Setup.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/interface/src/main/java/xsbti/compile/Setup.java b/interface/src/main/java/xsbti/compile/Setup.java index 9a2a6bf4c..edf250b8b 100644 --- a/interface/src/main/java/xsbti/compile/Setup.java +++ b/interface/src/main/java/xsbti/compile/Setup.java @@ -1,6 +1,8 @@ package xsbti.compile; import java.io.File; +import java.util.Map; + import xsbti.Maybe; import xsbti.Reporter; @@ -30,4 +32,16 @@ public interface Setup /** The reporter that should be used to report scala compilation to. */ Reporter reporter(); + + /** + * Returns incremental compiler options. + * + * @see sbt.inc.IncOptions for details + * + * You can get default options by calling sbt.inc.IncOptions.toStringMap(sbt.inc.IncOptions.Default). + * + * In the future, we'll extend API in xsbti to provide factory methods that would allow to obtain + * defaults values so one can depend on xsbti package only. + **/ + Map incrementalCompilerOptions(); }