mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove RCT prefix from names of generated Java classes
Summary: This diff removes the 'RCT' prefix (if it's present) from the names of the generated Java classes. The motivation is that we don't want to have any Java files having this prefix in the RN Android codebase. Reviewed By: JoshuaGross Differential Revision: D17123804 fbshipit-source-id: 31905d3141e0f58ea47cdbdb0cf77d2d105de9a9
This commit is contained in:
1 parent
38089753ef
commit
26a8d2e03a
13 files changed
+39
-20
No files matched your search
@@ -16,6 +16,14 @@ function upperCaseFirst(inString: string): string {
|
||||
return inString[0].toUpperCase() + inString.slice(1);
|
||||
}
|
||||
|
||||
function getInterfaceJavaClassName(componentName: string): string {
|
||||
return `${componentName.replace(/^RCT/, '')}ManagerInterface`;
|
||||
}
|
||||
|
||||
function getDelegateJavaClassName(componentName: string): string {
|
||||
return `${componentName.replace(/^RCT/, '')}ManagerDelegate`;
|
||||
}
|
||||
|
||||
function toSafeJavaString(
|
||||
input: string,
|
||||
shouldUpperCaseFirst?: boolean,
|
||||
@@ -87,6 +95,8 @@ function getImports(component: ComponentShape): Set<string> {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getInterfaceJavaClassName,
|
||||
getDelegateJavaClassName,
|
||||
toSafeJavaString,
|
||||
getImports,
|
||||
};
|
||||
Reference in new issue
Block a user