Class RobolectricProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.robolectric.annotation.processing.RobolectricProcessor
- All Implemented Interfaces:
javax.annotation.processing.Processor
@SupportedOptions({"org.robolectric.annotation.processing.shadowPackage","org.robolectric.annotation.processing.shouldInstrumentPackage"})
@SupportedAnnotationTypes("org.robolectric.annotation.*")
public class RobolectricProcessor
extends javax.annotation.processing.AbstractProcessor
Annotation processor entry point for Robolectric annotations.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description RobolectricProcessor()Default constructor.RobolectricProcessor(Map<String,String> options)Constructor to use for testing passing options in. -
Method Summary
Modifier and Type Method Description protected StringgetSdksFile(Map<String,String> options, String sdksFileParam)Extendable to support Bazel environments, where the sdks file is generated as a build artifact.javax.lang.model.SourceVersiongetSupportedSourceVersion()voidinit(javax.annotation.processing.ProcessingEnvironment environment)booleanprocess(Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)
-
Constructor Details
-
RobolectricProcessor
public RobolectricProcessor()Default constructor. -
RobolectricProcessor
Constructor to use for testing passing options in. Only necessary until compile-testing supports passing options in.- Parameters:
options- simulated options that would ordinarily be passed in theProcessingEnvironment.
-
-
Method Details
-
init
public void init(javax.annotation.processing.ProcessingEnvironment environment)- Specified by:
initin interfacejavax.annotation.processing.Processor- Overrides:
initin classjavax.annotation.processing.AbstractProcessor
-
process
public boolean process(Set<? extends javax.lang.model.element.TypeElement> annotations, javax.annotation.processing.RoundEnvironment roundEnv)- Specified by:
processin interfacejavax.annotation.processing.Processor- Specified by:
processin classjavax.annotation.processing.AbstractProcessor
-
getSdksFile
Extendable to support Bazel environments, where the sdks file is generated as a build artifact. -
getSupportedSourceVersion
public javax.lang.model.SourceVersion getSupportedSourceVersion()- Specified by:
getSupportedSourceVersionin interfacejavax.annotation.processing.Processor- Overrides:
getSupportedSourceVersionin classjavax.annotation.processing.AbstractProcessor
-