@@ -16,18 +16,6 @@ if (isNewArchitectureEnabled()) {
1616 preBuild.dependsOn invokeLibraryCodegen
1717}` ;
1818
19- // This is added to the example app's xcscheme file to invoke codegen before every build
20- const XCODE_INVOKE_CODEGEN_ACTION = `
21- <PreActions>
22- <ExecutionAction
23- ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
24- <ActionContent
25- title = "Invoke Codegen"
26- scriptText = "cd "$WORKSPACE_PATH/../../../" && npx bob build --target codegen ">
27- </ActionContent>
28- </ExecutionAction>
29- </PreActions>` ;
30-
3119// You need to have the files before calling pod install otherwise they won't be registered in your pod.
3220// So we add a pre_install hook to the podfile that invokes codegen
3321const PODSPEC_INVOKE_CODEGEN_SCRIPT = `
@@ -40,26 +28,14 @@ const PODSPEC_INVOKE_CODEGEN_SCRIPT = `
4028 * Codegen isn't invoked for libraries with `includesGeneratedCode` set to `true`.
4129 * This patches the example app to invoke library codegen on every app build.
4230 */
43- export async function addCodegenBuildScript (
44- libraryPath : string ,
45- projectName : string
46- ) {
31+ export async function addCodegenBuildScript ( libraryPath : string ) {
4732 const appBuildGradlePath = path . join (
4833 libraryPath ,
4934 'example' ,
5035 'android' ,
5136 'app' ,
5237 'build.gradle'
5338 ) ;
54- const exampleAppBuildSchemePath = path . join (
55- libraryPath ,
56- 'example' ,
57- 'ios' ,
58- `${ projectName } Example.xcodeproj` ,
59- 'xcshareddata' ,
60- 'xcschemes' ,
61- `${ projectName } Example.xcscheme`
62- ) ;
6339 const podfilePath = path . join ( libraryPath , 'example' , 'ios' , 'Podfile' ) ;
6440
6541 // Add a gradle task that runs before every build
@@ -68,25 +44,6 @@ export async function addCodegenBuildScript(
6844
6945 await fs . writeFile ( appBuildGradlePath , appBuildGradle ) ;
7046
71- // Add an XCode prebuild action.
72- const exampleAppBuildScheme = ( await fs . readFile ( exampleAppBuildSchemePath ) )
73- . toString ( )
74- . split ( '\n' ) ;
75- // Used XCode and inspected the result to determine where it inserts the actions
76- const actionTargetLineIndex = exampleAppBuildScheme . findIndex ( ( line ) =>
77- line . includes ( '<BuildActionEntries>' )
78- ) ;
79- exampleAppBuildScheme . splice (
80- actionTargetLineIndex ,
81- 0 ,
82- XCODE_INVOKE_CODEGEN_ACTION
83- ) ;
84-
85- await fs . writeFile (
86- exampleAppBuildSchemePath ,
87- exampleAppBuildScheme . join ( '\n' )
88- ) ;
89-
9047 // Add a preinstall action to the podfile that invokes codegen
9148 const podfile = ( await fs . readFile ( podfilePath ) ) . toString ( ) . split ( '\n' ) ;
9249 const podfilePostInstallIndex = podfile . findIndex ( ( line ) =>
0 commit comments