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
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.RobolectricProcessor(Map<String, String> options) Constructor to use for testing passing options in.RobolectricProcessor(Map<String, String> options, String overrideSdkLocation, int overrideSdkInt) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.SourceVersionvoidinit(ProcessingEnvironment environment) booleanprocess(Set<? extends javax.lang.model.element.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.
-
RobolectricProcessor
-
-
Method Details
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
process
public boolean process(Set<? extends javax.lang.model.element.TypeElement> annotations, RoundEnvironment roundEnv) - Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-
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 interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-