Add buck rule to generate Java library

Summary: Adds buck rule for generated code

Reviewed By: mdvacca, makovkastar

Differential Revision: D16338763

fbshipit-source-id: 6b238b3993cc110f009ad541cfa924d0d06d2fcb
This commit is contained in:
Rick Hanlon
2019-07-19 15:04:06 -07:00
committed by Facebook Github Bot
parent 9a546f5e9e
commit 1783780a92
6 changed files with 67 additions and 25 deletions
@@ -16,14 +16,14 @@ function upperCaseFirst(inString: string): string {
return inString[0].toUpperCase() + inString.slice(1);
}
export function toSafeJavaString(input: string): string {
function toSafeJavaString(input: string): string {
return input
.split('-')
.map(upperCaseFirst)
.join('');
}
export function getImports(component: ComponentShape): Set<string> {
function getImports(component: ComponentShape): Set<string> {
const imports: Set<string> = new Set();
component.extendsProps.forEach(extendProps => {
@@ -75,3 +75,8 @@ export function getImports(component: ComponentShape): Set<string> {
return imports;
}
module.exports = {
toSafeJavaString,
getImports,
};