1 package org.robolectric.annotation.processing; 2 3 import static com.google.testing.compile.JavaFileObjects.forResource; 4 import static org.robolectric.annotation.processing.RobolectricProcessor.JSON_DOCS_DIR; 5 import static org.robolectric.annotation.processing.RobolectricProcessor.PACKAGE_OPT; 6 import static org.robolectric.annotation.processing.RobolectricProcessor.SDK_CHECK_MODE; 7 8 import com.google.common.collect.ImmutableMap; 9 import com.google.common.io.Files; 10 import javax.tools.JavaFileObject; 11 12 public class Utils { 13 14 public static final ImmutableMap<String, String> DEFAULT_OPTS = 15 ImmutableMap.<String, String>builder() 16 .put(PACKAGE_OPT, "org.robolectric") 17 .put(JSON_DOCS_DIR, Files.createTempDir().toString()) 18 .put(SDK_CHECK_MODE, "OFF") 19 .build(); 20 21 public static final JavaFileObject SHADOW_PROVIDER_SOURCE = forResource("mock-source/org/robolectric/internal/ShadowProvider.java"); 22 public static final JavaFileObject SHADOW_EXTRACTOR_SOURCE = forResource("mock-source/org/robolectric/shadow/api/Shadow.java"); 23 toResourcePath(String clazzName)24 public static String toResourcePath(String clazzName) { 25 return clazzName.replace('.', '/') + ".java"; 26 } 27 } 28