• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.robolectric.annotation;
2 
3 import java.lang.annotation.Documented;
4 import java.lang.annotation.ElementType;
5 import java.lang.annotation.Retention;
6 import java.lang.annotation.RetentionPolicy;
7 import java.lang.annotation.Target;
8 
9 /**
10  * A {@link org.robolectric.pluginapi.config.Configurer} annotation for controlling Robolectric's
11  * android resource implementation.
12  *
13  * <p>Currently Robolectric will default to {@link ResourcesMode.Mode#BINARY} , but this can be
14  * overridden by applying a @ResourcesMode(NewMode) annotation to a test package, test class, or
15  * test method, or via the 'robolectric.resourcesMode' system property.
16  *
17  * @see org.robolectric.plugins.ResourceModeConfigurer
18  */
19 @Documented
20 @Retention(RetentionPolicy.RUNTIME)
21 @Target({ElementType.PACKAGE, ElementType.TYPE, ElementType.METHOD})
22 public @interface ResourcesMode {
23 
24   enum Mode {
25     /**
26      * Default: Reads binary resource data (arsc) using a Java implementation, manually
27      * transliterated from native code
28      */
29     BINARY,
30     /**
31      * Experimental: use AOSP native code to read resource data. Currently only functioning on
32      * android V and linux
33      */
34     NATIVE,
35   }
36 
37   /** Set the Resources mode. */
value()38   ResourcesMode.Mode value();
39 }
40