Class RobolectricProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.robolectric.annotation.processing.RobolectricProcessor
- All Implemented Interfaces:
Processor
@SupportedOptions({"org.robolectric.annotation.processing.shadowPackage","org.robolectric.annotation.processing.shouldInstrumentPackage"}) @SupportedAnnotationTypes("org.robolectric.annotation.*") public class RobolectricProcessor extends 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 String
getSdksFile(Map<String,String> options, String sdksFileParam)
Extendable to support Bazel environments, where the sdks file is generated as a build artifact.SourceVersion
getSupportedSourceVersion()
void
init(ProcessingEnvironment environment)
boolean
process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
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
- Specified by:
init
in interfaceProcessor
- Overrides:
init
in classAbstractProcessor
-
process
- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
-
getSdksFile
Extendable to support Bazel environments, where the sdks file is generated as a build artifact. -
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersion
in interfaceProcessor
- Overrides:
getSupportedSourceVersion
in classAbstractProcessor
-