Skip to content

Commit 416615c

Browse files
authored
Extract build phase to copy Gutenberg resources in script (#20719)
2 parents f972840 + e345b84 commit 416615c

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PODS_ROOT/Gutenberg/bundle/ios
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/main.jsbundle
2+
$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/assets/
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -eux
2+
3+
# Update the matching .outputs.xcfilelist when changing this
4+
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
5+
6+
if [[ "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
7+
IP=$(ipconfig getifaddr en0)
8+
if [ -z "$IP" ]; then
9+
IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\ -f2 | awk 'NR==1{print $1}')
10+
fi
11+
12+
echo "$IP" > "$DEST/ip.txt"
13+
fi
14+
15+
# Update the matching .inputs.xcfilelist when changing this
16+
PODS_BUNDLE_ROOT="$PODS_ROOT/Gutenberg/bundle/ios"
17+
18+
BUNDLE_FILE="$DEST/main.jsbundle"
19+
cp "$PODS_BUNDLE_ROOT/App.js" "$BUNDLE_FILE"
20+
21+
BUNDLE_ASSETS="$DEST/assets/"
22+
cp -r "$PODS_BUNDLE_ROOT/assets/" "$BUNDLE_ASSETS"

WordPress/WordPress.xcodeproj/project.pbxproj

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20460,13 +20460,18 @@
2046020460
files = (
2046120461
);
2046220462
inputPaths = (
20463+
$SRCROOT/../Scripts/BuildPhases/CopyGutenbergJS.inputs.xcfilelist,
2046320464
);
2046420465
name = "Copy Gutenberg JS";
20466+
outputFileListPaths = (
20467+
$SRCROOT/../Scripts/BuildPhases/CopyGutenbergJS.outputs.xcfilelist,
20468+
);
2046520469
outputPaths = (
20470+
"",
2046620471
);
2046720472
runOnlyForDeploymentPostprocessing = 0;
2046820473
shellPath = /bin/sh;
20469-
shellScript = "# Print commands before executing them (useful for troubleshooting)\nset -x\nDEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\n\nif [[ \"$CONFIGURATION\" = *Debug* && ! \"$PLATFORM_NAME\" == *simulator ]]; then\nIP=$(ipconfig getifaddr en0)\nif [ -z \"$IP\" ]; then\nIP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\\ -f2 | awk 'NR==1{print $1}')\nfi\n\necho \"$IP\" > \"$DEST/ip.txt\"\nfi\n\nBUNDLE_FILE=\"$DEST/main.jsbundle\"\ncp ${PODS_ROOT}/Gutenberg/bundle/ios/App.js \"${BUNDLE_FILE}\"\n\nBUNDLE_ASSETS=\"$DEST/assets/\"\ncp -r ${PODS_ROOT}/Gutenberg/bundle/ios/assets/ \"${BUNDLE_ASSETS}\"\n";
20474+
shellScript = "\"$SRCROOT/../Scripts/BuildPhases/CopyGutenbergJS.sh\"\n";
2047020475
};
2047120476
EA14533C29AD874C001F3143 /* Set Up Simulator */ = {
2047220477
isa = PBXShellScriptBuildPhase;
@@ -20673,14 +20678,20 @@
2067320678
buildActionMask = 2147483647;
2067420679
files = (
2067520680
);
20681+
inputFileListPaths = (
20682+
$SRCROOT/../Scripts/BuildPhases/CopyGutenbergJS.inputs.xcfilelist,
20683+
);
2067620684
inputPaths = (
2067720685
);
2067820686
name = "Copy Gutenberg JS";
20687+
outputFileListPaths = (
20688+
$SRCROOT/../Scripts/BuildPhases/CopyGutenbergJS.outputs.xcfilelist,
20689+
);
2067920690
outputPaths = (
2068020691
);
2068120692
runOnlyForDeploymentPostprocessing = 0;
2068220693
shellPath = /bin/sh;
20683-
shellScript = "# Print commands before executing them (useful for troubleshooting)\nset -x\nDEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH\n\nif [[ \"$CONFIGURATION\" = *Debug* && ! \"$PLATFORM_NAME\" == *simulator ]]; then\nIP=$(ipconfig getifaddr en0)\nif [ -z \"$IP\" ]; then\nIP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\\ -f2 | awk 'NR==1{print $1}')\nfi\n\necho \"$IP\" > \"$DEST/ip.txt\"\nfi\n\nBUNDLE_FILE=\"$DEST/main.jsbundle\"\ncp ${PODS_ROOT}/Gutenberg/bundle/ios/App.js \"${BUNDLE_FILE}\"\n\nBUNDLE_ASSETS=\"$DEST/assets/\"\ncp -r ${PODS_ROOT}/Gutenberg/bundle/ios/assets/ \"${BUNDLE_ASSETS}\"\n";
20694+
shellScript = "\"$SRCROOT/../Scripts/BuildPhases/CopyGutenbergJS.sh\"\n";
2068420695
};
2068520696
FFA8E2301F94E3EF0002170F /* ShellScript */ = {
2068620697
isa = PBXShellScriptBuildPhase;

0 commit comments

Comments
 (0)