Skip to content

Commit a202424

Browse files
committed
docs: add comments to example app codegen files
1 parent d0b1ad2 commit a202424

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/create-react-native-library/src/utils/patchExampleAppCodegen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import path from 'path';
22
import fs from 'fs-extra';
33

4+
// This is added to the example app's build.gradle file to invoke codegen before every build
45
const GRADLE_INVOKE_CODEGEN_TASK = `
56
def isNewArchitectureEnabled() {
67
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
@@ -15,6 +16,7 @@ if (isNewArchitectureEnabled()) {
1516
preBuild.dependsOn invokeLibraryCodegen
1617
}`;
1718

19+
// This is added to the example app's xcscheme file to invoke codegen before every build
1820
const XCODE_INVOKE_CODEGEN_ACTION = `
1921
<PreActions>
2022
<ExecutionAction
@@ -26,6 +28,8 @@ const XCODE_INVOKE_CODEGEN_ACTION = `
2628
</ExecutionAction>
2729
</PreActions>`;
2830

31+
// You need to have the files before calling pod install otherwise they won't be registered in your pod.
32+
// So we add a pre_install hook to the podfile that invokes codegen
2933
const PODSPEC_INVOKE_CODEGEN_SCRIPT = `
3034
pre_install do |installer|
3135
system("cd ../../ && npx bob build --target codegen")

0 commit comments

Comments
 (0)