Compiler instances for testing Dagger.
| 28 | |
| 29 | /** {@link Compiler} instances for testing Dagger. */ |
| 30 | final class Compilers { |
| 31 | private static final String GUAVA = "guava"; |
| 32 | |
| 33 | static final ImmutableList<String> CLASS_PATH_WITHOUT_GUAVA_OPTION = |
| 34 | ImmutableList.of( |
| 35 | "-classpath", |
| 36 | Splitter.on(PATH_SEPARATOR.value()) |
| 37 | .splitToList(JAVA_CLASS_PATH.value()) |
| 38 | .stream() |
| 39 | .filter(jar -> !jar.contains(GUAVA)) |
| 40 | .collect(joining(PATH_SEPARATOR.value()))); |
| 41 | |
| 42 | /** Returns a compiler that runs the Dagger processor. */ |
| 43 | static Compiler daggerCompiler() { |
| 44 | return javac().withProcessors(new ComponentProcessor(), new AutoAnnotationProcessor()); |
| 45 | } |
| 46 | } |