-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: don't add a XCode prebuild action to invoke codegen anymore #679
Conversation
So if I understand correctly, you'll need to run
What's the reason for this? Is it not possible to fix it? At the very least, is there any way to ensure that user knows that they need to run |
It cannot find
The user actually always needed to call
The build is going to fail if the user tries to build their example app with outdated codegen scaffold code. |
Why do we need either of those? Can't we just check |
I just checked and it's a great idea, however, I had lots of difficulties just trying to get it working on my machine: First I tried to call bob directly from And also, looks like with XCode 16, we need to patch the file further to get the React Native vars: diff --git a/example/ios/BuraktestExample.xcodeproj/xcshareddata/xcschemes/BuraktestExample.xcscheme b/example/ios/BuraktestExample.xcodeproj/xcshareddata/xcschemes/BuraktestExample.xcscheme
index 02d793e..b54af5f 100644
--- a/example/ios/BuraktestExample.xcodeproj/xcshareddata/xcschemes/BuraktestExample.xcscheme
+++ b/example/ios/BuraktestExample.xcodeproj/xcshareddata/xcschemes/BuraktestExample.xcscheme
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
- version = "1.3">
+ version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@@ -11,6 +11,15 @@
<ActionContent
title = "Invoke Codegen"
scriptText = "WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh" cd "$WORKSPACE_PATH/../../../" && /bin/sh -c "$WITH_ENVIRONMENT './node_modules/.bin/bob build --target codegen'" ">
+ <EnvironmentBuildable>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
+ BuildableName = "BuraktestExample.app"
+ BlueprintName = "BuraktestExample"
+ ReferencedContainer = "container:BuraktestExample.xcodeproj">
+ </BuildableReference>
+ </EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions> I think we can get this working with additional work, but this might be broken in the future as it relies on the XCode version, and the React Native version. So I'm not sure if it's worth the effort to update and maintain this script. The main problem here is, that XCode gives you a clear env to run your scripts against. It isn't supposed to read your shell's environment and inject it into the script's running environment. And for that reason it gets pretty tricky to run any logic within XCode actions. |
How does React Native find node to build the JS bundle, launch the dev server etc. when building with XCode? What's different in our implementation? |
React Native uses a shell script to call various scripts. they inject the |
44836fe
to
624a60c
Compare
Can't we use this |
Can we add the script in |
5840521
to
076ec98
Compare
076ec98
to
2ade5ef
Compare
We tried to automate the process using https://github.com/CocoaPods/Xcodeproj, however, it's taking too much time to get everything right for all of the users. We're sunsetting this feature for now and we can return to this in the future. |
Summary
We used to add an xcode prebuild script to invoke codegen each time the user built their example application. However, with the latest setup, the action just causes the build to fail immediately. This PR removes that script. With this removal, the user has to install pods each time they change their codegen specs.
Test plan
crnl
and make sure it supports the new architecture