mirror of
https://github.com/sbt/sbt.git
synced 2026-09-06 09:37:02 +02:00
Support debug output for macros
It's sometimes useful to get the output of the macro-generated code. This adds a mechanism to allow plugins.sbt to pass in scalacOptions, which we can later check from the macro. 1. -Xmacro-settings:sbt:Vprint prints out the code. 2. Adding -Xmacro-settings:sbt:print-tree-structure prints out the tree structure.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package xsbti;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/** A global in-memory storage to pass information. */
|
||||
public class Attic {
|
||||
private static List<String> _items = new ArrayList<String>();
|
||||
|
||||
/**
|
||||
* This is used to collect scalacOptions of metabuild. This works around the fact that
|
||||
* CompilationInfo.XmacroSettings is experimental.
|
||||
*/
|
||||
public static void appendItems(Collection<String> values) {
|
||||
_items.addAll(values);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used to return scalacOptions of metabuild. This works around the fact that
|
||||
* CompilationInfo.XmacroSettings is experimental.
|
||||
*/
|
||||
public static Collection<String> getItems() {
|
||||
return _items;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user