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:
Oleksandr Melnykov authored and Facebook Github Bot committed 2019-08-30 10:03:27 -07:00
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,
};