Skip to content

Commit

Permalink
add viewManager param to @ReactModuleList
Browse files Browse the repository at this point in the history
Reviewed By: achen1

Differential Revision: D4338871

fbshipit-source-id: 4ac175e0a9049d5fb08c9d01f630a3e17124e08e
  • Loading branch information
aaronechiu authored and facebook-github-bot committed Dec 16, 2016
1 parent 71f32fb commit c27cc9c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@
* require special integration with other framework parts (e.g. with the list of packages to load
* view managers from).
*/
@ReactModuleList({
AndroidInfoModule.class,
AnimationsDebugModule.class,
DeviceEventManagerModule.class,
ExceptionsManagerModule.class,
HeadlessJsTaskSupportModule.class,
SourceCodeModule.class,
Timing.class,
UIManagerModule.class,
// Debug only
DebugComponentOwnershipModule.class,
JSCHeapCapture.class,
JSCSamplingProfiler.class,
})
@ReactModuleList(
javaModules = {
AndroidInfoModule.class,
AnimationsDebugModule.class,
DeviceEventManagerModule.class,
ExceptionsManagerModule.class,
HeadlessJsTaskSupportModule.class,
SourceCodeModule.class,
Timing.class,
UIManagerModule.class,
// Debug only
DebugComponentOwnershipModule.class,
JSCHeapCapture.class,
JSCSamplingProfiler.class,
}
)
/* package */ class CoreModulesPackage extends LazyReactPackage {

private final ReactInstanceManager mReactInstanceManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@
public @interface ReactModuleList {

/**
* The native modules in this list should be annotated with {@link ReactModule}.
* @return List of native modules.
* The Java modules in this list should be annotated with {@link ReactModule}.
* @return List of Java modules in the package.
*/
Class<? extends NativeModule>[] value();
Class<? extends NativeModule>[] javaModules();

/**
* The View Managers in this list should be annotated with {@link ReactModule}.
* @return List of view manager in the package.
*/
Class<? extends NativeModule>[] viewManagers() default {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
ReactModuleList reactModuleList = typeElement.getAnnotation(ReactModuleList.class);
List<String> nativeModules = new ArrayList<>();
try {
reactModuleList.value(); // throws MirroredTypesException
reactModuleList.javaModules(); // throws MirroredTypesException
} catch (MirroredTypesException mirroredTypesException) {
List<? extends TypeMirror> typeMirrors = mirroredTypesException.getTypeMirrors();
for (TypeMirror typeMirror : typeMirrors) {
Expand Down

0 comments on commit c27cc9c

Please sign in to comment.