Skip to content
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

Build rn-codegen in a temporary directory #30292

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/react-native-codegen/scripts/oss/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,18 @@ THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOUR
set -e
set -u

pushd "$THIS_DIR/../.." >/dev/null
TMP_DIR=$(mktemp -d)
CODEGEN_DIR="$THIS_DIR/../.."

rm -rf "$CODEGEN_DIR/lib" "$CODEGEN_DIR/node_modules"

cp -R "$CODEGEN_DIR/." "$TMP_DIR"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to make sure this is compatible with MacOS or Linux (circle CI etc), let's use rsync if we can

https://github.com/facebook/react-native/blob/master/packages/react-native-codegen/DEFS.bzl#L80


pushd "$TMP_DIR" >/dev/null

yarn install 2> >(grep -v '^warning' 1>&2)
yarn run build
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yarn install already builds the package so avoid building it twice.


popd >/dev/null

mv "$TMP_DIR/lib" "$TMP_DIR/node_modules" "$CODEGEN_DIR"
rm -rf "$TMP_DIR"