Add annotation processor to create static ReactModule infos

Reviewed By: lexs

Differential Revision: D3781016

fbshipit-source-id: 8169e8b55fc044df2230fd01e912c4e96a044f98
This commit is contained in:
Aaron Chiu
2016-09-01 19:23:52 -07:00
committed by Facebook Github Bot 6
parent c06c1e1786
commit 605a0a62dc
11 changed files with 277 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
include_defs('//ReactAndroid/DEFS')
android_library(
name = 'model',
srcs = glob(['**/*.java']),
deps = [
react_native_dep('third-party/java/jsr-305:jsr-305'),
],
visibility=[
'PUBLIC'
]
)
project_config(
src_target = ':model',
)

View File

@@ -0,0 +1,25 @@
// Copyright 2004-present Facebook. All Rights Reserved.
package com.facebook.react.module.model;
/**
* Data holder class holding native module specifications.
*/
public class ReactModuleInfo {
public final String mName;
public final boolean mCanOverrideExistingModule;
public final boolean mSupportsWebWorkers;
public final boolean mNeedsEagerInit;
public ReactModuleInfo(
String name,
boolean canOverrideExistingModule,
boolean supportsWebWorkers,
boolean needsEagerInit) {
mName = name;
mCanOverrideExistingModule = canOverrideExistingModule;
mSupportsWebWorkers = supportsWebWorkers;
mNeedsEagerInit = needsEagerInit;
}
}