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

Release 1.56.0 #3664

Merged
merged 182 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
d1a4f45
Update gutenberg reference
cameronvoell Apr 29, 2021
bf0c748
Update package-lock
cameronvoell Apr 29, 2021
ac8d3ca
Update gutenberg ref
cameronvoell May 7, 2021
c1ae681
Updated gutenberg ref
cameronvoell May 13, 2021
9578b2a
Updating gutenberg ref
cameronvoell May 14, 2021
861aa05
Merge branch 'develop' into try/upgrade-0-64
cameronvoell May 14, 2021
70d14c4
Updated hermes executable to hermesc for building bundle
cameronvoell May 17, 2021
42c9c67
Updated bundle
cameronvoell May 17, 2021
0030252
Update gutenberg ref
ceyhun May 18, 2021
13ab76b
Add changes to package-lock.json after running npm install
ceyhun May 18, 2021
3958c64
Disabled npm cache on CI
ceyhun May 18, 2021
607fefe
Update gutenberg ref
ceyhun May 19, 2021
4517c6d
Add @react-native to transformIgnorePatterns in jest config
ceyhun May 19, 2021
faa7f30
Update gutenberg ref
ceyhun May 19, 2021
d9f119a
Update gutenberg ref
ceyhun May 19, 2021
4730f3f
updated gutenberg ref
cameronvoell May 20, 2021
6114b71
Upgrade react-native related devDependencies
ceyhun May 20, 2021
18570dc
Update gutenberg ref
ceyhun May 20, 2021
d59562e
Fix check correctness diff error
ceyhun May 20, 2021
a6605d3
Update gutenberg ref
ceyhun May 20, 2021
a4dfb5f
Update gutenberg ref
cameronvoell May 20, 2021
7e1f7d9
Updated bundle files
cameronvoell May 20, 2021
523f824
Updated gutenberg ref
cameronvoell May 20, 2021
101ace3
Updated gutenberg ref
cameronvoell May 20, 2021
b48127d
Updated gutenberg ref
cameronvoell May 20, 2021
e053a9b
Adding cache-version file for re-running circle-ci
cameronvoell May 20, 2021
bbc0ca5
Update gutenberg ref
cameronvoell May 20, 2021
622a327
Updated gutenberg ref
cameronvoell May 20, 2021
5922353
Updated ref, removed react-native-mirror s3 from bridge gradle
cameronvoell May 21, 2021
dcab4a8
updated bundle
cameronvoell May 21, 2021
affb5ff
Update podspecs by running generate-podspecs.sh script
ceyhun May 21, 2021
d9e8a95
Updating gutenberg ref
cameronvoell May 21, 2021
191e88a
Merge branch 'develop' into try/upgrade-0-64
cameronvoell May 21, 2021
1ae1978
Update bundle
cameronvoell May 21, 2021
eac4768
Update gutenberg ref
ceyhun May 25, 2021
9ad755f
Revert "Disabled npm cache on CI"
ceyhun May 25, 2021
d6422ff
Modify generate-podspecs.sh script to run FBReactNativeSpec codegen a…
ceyhun May 31, 2021
900921c
Update gutenberg ref
ceyhun May 31, 2021
310ff4c
Update package-lock.json
ceyhun Jun 1, 2021
3ebb08a
Update package-lock.json
ceyhun Jun 1, 2021
49563f4
Add workaround for FBReactNativeSpec podspec in generate-poscpecs.sh …
ceyhun Jun 1, 2021
0267a7e
Update commit hash of FBReactNativeSpec
ceyhun Jun 1, 2021
4d5c216
Fix typo
ceyhun Jun 1, 2021
75d3ff9
Update commit hash of FBReactNativeSpec
ceyhun Jun 1, 2021
590b352
Add missing external podspecs to generate-podspecs.sh script
ceyhun Jun 1, 2021
6646ca0
Re-generate third-party-podspecs, remove react-native-linear-gradient…
ceyhun Jun 1, 2021
504cae3
Update commit hash of FBReactNativeSpec
ceyhun Jun 1, 2021
c092aba
Add exception for react-native-slider fork
ceyhun Jun 1, 2021
dffe6f9
Remove tag from react-native-slider podspec
ceyhun Jun 1, 2021
5bbfc23
Fix react-native-slider git source
ceyhun Jun 1, 2021
c2652ed
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 2, 2021
3fea75d
Update gutenberg ref
ceyhun Jun 2, 2021
ab02d3a
Update bundles
ceyhun Jun 2, 2021
50bf41a
Update gutenberg reference
AmandaRiu Jun 5, 2021
10950c3
Update release notes with fix for Gboard enter detection
AmandaRiu Jun 5, 2021
6eef209
Update gutenberg ref
ceyhun Jun 7, 2021
e368d21
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 7, 2021
a4d4202
Update jetpack ref
ceyhun Jun 7, 2021
0827c62
Update bundles
ceyhun Jun 7, 2021
ee5c7e2
Update gutenberg ref
cameronvoell Jun 7, 2021
200a819
Update gutenberg ref
ceyhun Jun 8, 2021
7fa9049
Re-run generate-podspecs.sh to update BVLinearGradient podspec
ceyhun Jun 8, 2021
25d37af
Update gutenberg ref
ceyhun Jun 8, 2021
280a4fa
Update bundles
ceyhun Jun 8, 2021
583b8fa
Shallow clone project for CI tasks
dcalhoun Jun 9, 2021
70ba56a
Update Gutenberg ref
fluiddot Jun 11, 2021
097a3eb
Merge pull request #3601 from wordpress-mobile/update/ci-clones-shall…
dcalhoun Jun 11, 2021
a7de9a0
Updates gutenberg reference
Jun 11, 2021
aa95fe5
Merge pull request #3611 from wordpress-mobile/merge_release_1.55.0_t…
Jun 11, 2021
6af247c
Update Gutenberg submodule ref
guarani Jun 11, 2021
7228a0e
Bump Gutenberg to latest trunk
enejb Jun 11, 2021
7eede01
Merge pull request #3602 from wordpress-mobile/rnmobile/fix/tablet-de…
enejb Jun 11, 2021
8816c17
Merge branch 'develop' into fix/inspector
guarani Jun 14, 2021
375ac02
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 14, 2021
a10fd2d
Update gutenberg ref
ceyhun Jun 14, 2021
daff1a2
Changes to package-lock.json after running npm install
ceyhun Jun 14, 2021
6e58521
Update bundles
ceyhun Jun 14, 2021
23fc662
Run ./bin/generate-podspecs.sh
ceyhun Jun 14, 2021
6fc386c
Update gutenberg ref to merge commit
guarani Jun 15, 2021
ed0e3ff
Merge pull request #3612 from wordpress-mobile/fix/inspector
guarani Jun 15, 2021
aba593f
Update Gutenberg ref
fluiddot Jun 16, 2021
8de898b
Add a few improvements and checks to generate-podspecs.sh
ceyhun Jun 16, 2021
c883138
Add a warning field at the bottom of all podspecs
ceyhun Jun 16, 2021
955f424
Add a warning when the tag or commit field is missing in a podspec
ceyhun Jun 16, 2021
2442b0c
Patch react-native-blur.podspec adding the missing tag
ceyhun Jun 16, 2021
6f87419
Better wording
ceyhun Jun 16, 2021
76d3138
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 16, 2021
443615b
Update bundles
ceyhun Jun 16, 2021
74637e3
Update FBReactNativeSpec ref
ceyhun Jun 16, 2021
cf03c94
Indent patch messages
ceyhun Jun 16, 2021
084cf3d
Patch react-native-blur.podspec again as 3.6.0 tag is missing
ceyhun Jun 16, 2021
e195cb4
CI fetches commit reference directly
dcalhoun Jun 16, 2021
cbcb184
Update gutenberg reference
AmandaRiu Jun 16, 2021
3375c48
Merge branch 'develop' into rnmobile/fix-gboard-enter-detection
AmandaRiu Jun 16, 2021
9757afc
Merge pull request #3624 from wordpress-mobile/fix/ci-shallow-git-clo…
dcalhoun Jun 16, 2021
72cbd38
Update gutenberg ref
dcalhoun Jun 3, 2021
e270303
Update gutenberg ref
dcalhoun Jun 16, 2021
6f517e5
Update gutenberg ref
dcalhoun Jun 16, 2021
f9c415d
Update gutenberg ref
ceyhun Jun 16, 2021
bab0ab4
Merge branch 'develop' into try/upgrade-0-64
ceyhun Jun 16, 2021
1a4c7e6
Update bundles
ceyhun Jun 16, 2021
00dadb9
Generate build
dcalhoun Jun 16, 2021
1130aa6
Merge pull request #3430 from wordpress-mobile/try/upgrade-0-64
ceyhun Jun 16, 2021
eb688a5
Merge branch 'develop' into rnmobile/fix-gboard-enter-detection
AmandaRiu Jun 16, 2021
06eee7b
Moved item to the unreleased section of release notes
AmandaRiu Jun 16, 2021
3c2dcdd
Merge pull request #3590 from wordpress-mobile/rnmobile/fix-gboard-en…
AmandaRiu Jun 16, 2021
11b446c
Merge branch 'develop' into add/reusable-block-convert-bottom-sheet
fluiddot Jun 17, 2021
1f82cde
Update Gutenberg ref with merge commit
fluiddot Jun 17, 2021
f9f1f4f
Merge pull request #3621 from wordpress-mobile/add/reusable-block-con…
fluiddot Jun 17, 2021
76e3544
Bump Gutenberg hash
hypest Jun 17, 2021
52c2e1e
Update Gutenberg hash
hypest Jun 17, 2021
d518501
Bump Gutenberg hash
hypest Jun 17, 2021
3c424f3
Update Gutenberg hash
hypest Jun 17, 2021
e0d6503
Update Gutenberg hash
hypest Jun 17, 2021
164d46c
Temporary Metro patch until RN upgrades Metro
hypest Jun 17, 2021
1b29eb4
Bump Gutenberg hash
hypest Jun 17, 2021
5a678ad
Bump Gutenberg to the merged hash
hypest Jun 17, 2021
11c7f70
Merge pull request #3630 from wordpress-mobile/gb/upgrade-react-nativ…
hypest Jun 17, 2021
a29524a
Update Gutenberg ref
fluiddot Jun 18, 2021
af01841
Merge branch 'develop' into merge_release_1.55.1_to_develop
fluiddot Jun 18, 2021
0518ec0
Update release notes
fluiddot Jun 21, 2021
b2bf19d
Merge pull request #3637 from wordpress-mobile/merge_release_1.55.1_t…
fluiddot Jun 21, 2021
fc0ae3f
Fix incorrect block insertion point after blurring post title
dcalhoun Jun 18, 2021
12cac37
Update gutenberg ref
dcalhoun Jun 21, 2021
4728d67
Merge pull request #3640 from wordpress-mobile/fix/incorrect-block-in…
dcalhoun Jun 21, 2021
f9cde2a
Bump Gutenberg
Jun 21, 2021
f9ccbf7
Update RELEASE-NOTES.txt
Jun 21, 2021
c07f818
Update Gutenberg hash which contains fix to Android artifact publishing
oguzkocer Jun 21, 2021
6cfd861
Merge pull request #3643 from wordpress-mobile/fix-404-android-artifa…
oguzkocer Jun 21, 2021
c749de4
Bump Gutenberg
Jun 21, 2021
810b788
Add: Grid block, from block-experiments repo
enejb Mar 24, 2021
6344452
Bump block-expeiments
enejb Mar 24, 2021
c99d1c0
Update the no_output_timeout to 15min
enejb Apr 23, 2021
fa6d2b4
Revert the longer timeout.
enejb Apr 23, 2021
485ce7a
Add block-experiments to eslintignore
enejb Apr 23, 2021
1ebf03f
Remove comment.
enejb Apr 23, 2021
8438a77
Fix prettier
enejb Apr 23, 2021
9cad90c
Bump block-experiements
enejb Apr 23, 2021
54a43e0
All Layout Grid controls
enejb May 1, 2021
e1b4630
Bump block experiment fixes
enejb May 13, 2021
4f9339b
Fix up the block setup code
enejb May 20, 2021
8d85083
Fix the availability
enejb May 20, 2021
3bb47b1
Update bundle
enejb Jun 17, 2021
e7ed89c
Simplify the layout grid block registration.
enejb Jun 17, 2021
edaefd0
Update the bundle js files
enejb Jun 21, 2021
226e2c4
Fix minor prettier issue.
enejb Jun 21, 2021
5c2376c
Bump map since it changed
enejb Jun 21, 2021
72b5b21
Merge pull request #3513 from wordpress-mobile/add/experiamental-layo…
enejb Jun 21, 2021
e3b2cfc
bump the latest version of Gutenberg
enejb Jun 21, 2021
c0c931b
Update the bundle
enejb Jun 21, 2021
ab3b46d
Merge pull request #3646 from wordpress-mobile/update/gutenberg-to-la…
enejb Jun 22, 2021
bbac299
Update gutenberg ref
dcalhoun Jun 22, 2021
60cf0a2
Merge branch 'develop' of github.com:wordpress-mobile/gutenberg-mobil…
dcalhoun Jun 22, 2021
1332b6f
Generate bundle
dcalhoun Jun 22, 2021
4d0250b
Merge pull request #3625 from wordpress-mobile/update/editor-session-…
dcalhoun Jun 22, 2021
bcf49e4
Bump Gutenberg
Jun 23, 2021
0477ef7
Update Gutenberg ref
fluiddot Jun 23, 2021
59fe033
Merge branch 'develop' of github.com:wordpress-mobile/gutenberg-mobil…
dcalhoun Jun 23, 2021
655bb27
Update gutenberg ref
dcalhoun Jun 23, 2021
4f4c623
Install latest packages
dcalhoun Jun 23, 2021
c63aeb8
Install latest packages
dcalhoun Jun 23, 2021
5ba6364
Remove duplicative release note
dcalhoun Jun 23, 2021
9bf5319
Merge pull request #3655 from wordpress-mobile/merge_release_1.55.2_t…
dcalhoun Jun 23, 2021
080afb9
Bump Gutenberg
Jun 24, 2021
7589aea
Merge branch 'develop' into update/badge-component-styling
Jun 24, 2021
78ad982
Update extra node modules resolver
fluiddot Jun 24, 2021
0837df7
Remove email-validator dependency
fluiddot Jun 24, 2021
20062a0
Remove yarn.lock file
fluiddot Jun 24, 2021
e33a4b1
Remove yarn dependency
fluiddot Jun 24, 2021
2d317c0
Clarify comment in extra node modules resolver
fluiddot Jun 24, 2021
8b5e3aa
Merge pull request #3660 from wordpress-mobile/update/remove-yarn
fluiddot Jun 24, 2021
a924de0
Merge pull request #3659 from wordpress-mobile/fix/metro-extra-module…
fluiddot Jun 24, 2021
03a3ab4
Update Gutenberg ref with merge commit
fluiddot Jun 24, 2021
4acf8a4
Merge branch 'develop' into add/add-reusable-block-integration-tests
fluiddot Jun 24, 2021
9c31570
Merge pull request #3654 from wordpress-mobile/add/add-reusable-block…
fluiddot Jun 24, 2021
20fe138
Bump Gutenberg
Jun 24, 2021
1c87086
Merge branch 'develop' into update/badge-component-styling
Jun 24, 2021
9b4bf9e
Merge pull request #3642 from wordpress-mobile/update/badge-component…
SiobhyB Jun 24, 2021
3b95986
Release script: Update gb mobile version to 1.56.0
Jun 25, 2021
4812eec
Release script: Update gutenberg ref
Jun 25, 2021
917f504
Release script: Update bundle for: 1.56.0
Jun 25, 2021
a85ea86
Update Release notes
Jun 25, 2021
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
2 changes: 2 additions & 0 deletions .circleci/cache-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# To invalidate the cache, generate a new UUID using `uuidgen` on the command line then paste it here
BD31B30E-7154-402F-AF62-80C50D4BE2CB
74 changes: 68 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,73 @@ commands:
paths:
- ~/.npm
- i18n-cache/data
checkout-shallow:
steps:
- run:
name: Checkout (Shallow)
command: |
#!/bin/sh
set -e

# Workaround old docker images with incorrect $HOME
# check https://github.com/docker/docker/issues/2968 for details
if [ "${HOME}" = "/" ]
then
export HOME=$(getent passwd $(id -un) | cut -d: -f6)
fi

SSH_CONFIG_DIR="$HOME/.ssh"
echo "Using SSH Config Dir '$SSH_CONFIG_DIR'"
git --version

mkdir -p "$SSH_CONFIG_DIR"
chmod 0700 "$SSH_CONFIG_DIR"

printf "%s" 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
' >> "$SSH_CONFIG_DIR/known_hosts"
chmod 0600 "$SSH_CONFIG_DIR/known_hosts"

export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile='$SSH_CONFIG_DIR/known_hosts'"

# use git+ssh instead of https
git config --global url."ssh://git@github.com".insteadOf "https://github.com" || true
git config --global gc.auto 0 || true

if [ -e "$HOME/project/.git" ] ; then
echo 'Fetching into existing repository'
existing_repo='true'
cd "$HOME/project"
git remote set-url origin "$CIRCLE_REPOSITORY_URL" || true
else
echo 'Cloning git repository'
existing_repo='false'
mkdir -p "$HOME/project"
cd "$HOME/project"
git clone --depth 1 --no-checkout "$CIRCLE_REPOSITORY_URL" .
fi

echo 'Fetching from remote repository'
if [ -n "$CIRCLE_TAG" ]; then
git fetch --depth 1 --force --tags origin "refs/tags/$CIRCLE_TAG"
else
git fetch --depth 1 --force origin "$CIRCLE_SHA1"
fi

if [ -n "$CIRCLE_TAG" ]; then
echo 'Checking out tag'
git checkout --force "$CIRCLE_TAG"
git reset --hard "$CIRCLE_SHA1"
else
echo 'Checking out branch'
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
git --no-pager log --no-color -n 1 --format='HEAD is now at %h %s'
fi
checkout-submodules:
steps:
- run:
name: Checkout Submodules
command: git submodule update --init --recursive
command: git submodule update --init --recursive --depth 1
add-jest-reporter-dir:
steps:
- run:
Expand Down Expand Up @@ -70,7 +132,7 @@ jobs:
machine:
image: << pipeline.parameters.linux-machine-image >>
steps:
- checkout
- checkout-shallow
- checkout-submodules
- run:
name: Install newer nvm
Expand Down Expand Up @@ -114,7 +176,7 @@ jobs:
machine:
image: << pipeline.parameters.linux-machine-image >>
steps:
- checkout
- checkout-shallow
- checkout-submodules
- run: node -v
- npm-install
Expand Down Expand Up @@ -162,7 +224,7 @@ jobs:
docker:
- image: << pipeline.parameters.android-docker-image >>
steps:
- checkout
- checkout-shallow
- checkout-submodules
- npm-install
- run:
Expand All @@ -180,7 +242,7 @@ jobs:
macos:
xcode: "12.0.0"
steps:
- checkout
- checkout-shallow
- checkout-submodules
- npm-install
- add-jest-reporter-dir
Expand Down Expand Up @@ -292,7 +354,7 @@ jobs:
else
echo "Build initiated from a tag: proceeding..."
fi
- checkout
- checkout-shallow
- checkout-submodules
- run:
# Setting up Android before fetching the Node dependencies because
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
; ignore the submodules
gutenberg
block-experiments
bundle
jetpack
bin

4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
path = jetpack
url = ../../Automattic/jetpack.git
shallow = true
[submodule "block-experiments"]
path = block-experiments
url = ../../Automattic/block-experiments.git
shallow = true
8 changes: 8 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
Unreleased
------

1.56.0
------
* [*] Tablet view fixes for inserter button. https://github.com/wordpress-mobile/gutenberg-mobile/pull/3602
* [**] Fixed an issue where pressing enter inside a text-based block was not creating a new block when using Gboard [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3590]
* [*] Tweaks to the badge component's styling, including change of background color and reduced padding. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3642]
* [***] New block: Layout grid. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3513]

1.55.2
------
* [**] Fix incorrect block insertion point after blurring the post title field. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3640]

1.55.1
------
* [*] Fix: RNMobile borderRadius value setting. [https://github.com/WordPress/gutenberg/pull/32717]
* [*] Improve unsupported block message for reusable block. [https://github.com/wordpress-mobile/gutenberg-mobile/pull/3621]

1.55.0
Expand Down
104 changes: 96 additions & 8 deletions bin/generate-podspecs.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,93 @@
#!/bin/sh
#!/bin/bash

# Exit if any command fails
set -e

function warn_missing_tag_commit() {
RED="\033[0;31m"
NO_COLOR="\033[0m"
PODSPEC_HAS_TAG_OR_COMMIT=$(jq '.source | has("tag") or has("commit")' "$DEST/$pod.podspec.json")
if [[ $PODSPEC_HAS_TAG_OR_COMMIT == "false" ]]; then
printf "${RED}WARNING! $pod.podspec doesn't have a 'tag' or 'commit' field. Either modify this script to add a patch during the podspec generation or modify the original $pod.podspec in the source repo.${NO_COLOR}\n"
exit 1
fi
}

# Change to the expected directory.
cd "$( dirname $0 )"
cd "$( dirname "$0" )"
cd ..
WD=$(pwd)
echo "Working directory: $WD"

# Check for cocoapods & jq
command -v pod > /dev/null || ( echo Cocoapods is required to generate podspecs; exit 1 )
command -v jq > /dev/null || ( echo jq is required to generate podspecs; exit 1 )

WD=$(pwd)
read -r -p "If your node_modules folder isn't up-to-date please run 'npm install' first and re-run the script. Is your node_modules folder up-to-date? [y/N] " PROMPT_RESPONSE
if [[ $PROMPT_RESPONSE != "y" ]]; then
echo "Please run npm install first and re-run the script."
exit 1
fi

read -r -p "Enter the commit hash of previous commit. If this is the first-time running this script, enter 0, then commit generated files and re-rerun the script and this time use the previous commit hash: " COMMIT_HASH
if [[ -z "$COMMIT_HASH" ]]; then
echo "Commit hash cannot be empty."
exit 1
fi

DEST="${WD}/third-party-podspecs"
NODE_MODULES_DIR="gutenberg/node_modules"

# Generate the external (non-RN podspecs)
EXTERNAL_PODSPECS=$(find "$NODE_MODULES_DIR/react-native/third-party-podspecs" \
"$NODE_MODULES_DIR/react-native-svg" \
"$NODE_MODULES_DIR/@react-native-community/blur" \
"$NODE_MODULES_DIR/@react-native-community/masked-view" \
"$NODE_MODULES_DIR/@react-native-community/slider" \
"$NODE_MODULES_DIR/react-native-dark-mode" \
"$NODE_MODULES_DIR/react-native-gesture-handler" \
"$NODE_MODULES_DIR/react-native-get-random-values" \
"$NODE_MODULES_DIR/react-native-keyboard-aware-scroll-view" \
"$NODE_MODULES_DIR/react-native-linear-gradient" \
"$NODE_MODULES_DIR/react-native-reanimated" \
"$NODE_MODULES_DIR/react-native-safe-area" \
"$NODE_MODULES_DIR/react-native-dark-mode" \
"$NODE_MODULES_DIR/react-native-get-random-values" -type f -name "*.podspec" -print)
"$NODE_MODULES_DIR/react-native-safe-area-context" \
"$NODE_MODULES_DIR/react-native-screens" \
"$NODE_MODULES_DIR/react-native-svg" \
"$NODE_MODULES_DIR/react-native-video"\
-type f -name "*.podspec" -print)

for podspec in $EXTERNAL_PODSPECS
do
pod=$(basename "$podspec" .podspec)

echo "Generating podspec for $pod"
pod ipc spec $podspec > "$DEST/$pod.podspec.json"
pod ipc spec "$podspec" > "$DEST/$pod.podspec.json"

# react-native-slider is the only gutenberg-mobile fork where we don't use the native files from the original repo
if [[ "$pod" == "react-native-slider" ]]; then
echo " ==> Patching $pod podspec"
TMP_RNSliderSpec=$(mktemp)
jq '.source.git = "https://github.com/wordpress-mobile/react-native-slider.git" | .source.commit = "d263ff16cdd9fb7352b354342522ff030f220f42" | del(.source.tag)' "$DEST/$pod.podspec.json" > "$TMP_RNSliderSpec"
mv "$TMP_RNSliderSpec" "$DEST/$pod.podspec.json"
fi

# react-native-blur doesn't have a tag field in it's podspec
if [[ "$pod" == "react-native-blur" ]]; then
echo " ==> Patching $pod podspec"
TMP_RNBlurPodspec=$(mktemp)
# The npm version we're using is 3.6.0 because 3.6.1 still isn't on npm https://www.npmjs.com/package/@react-native-community/blur/v/3.6.1
# And there's no v3.6.0 tag in https://github.com/Kureev/react-native-blur so we depend on v3.6.1 in the podspec
jq '.source.tag = "v3.6.1" | .version = "3.6.1"' "$DEST/$pod.podspec.json" > "$TMP_RNBlurPodspec"
mv "$TMP_RNBlurPodspec" "$DEST/$pod.podspec.json"
fi

# Add warning to bottom
TMP_SPEC=$(mktemp)
jq '. + {"__WARNING!__": "This file is autogenerated by generate-podspecs.sh script. Do not modify manually. Re-run the script if necessary."}' "$DEST/$pod.podspec.json" > "$TMP_SPEC"
mv "$TMP_SPEC" "$DEST/$pod.podspec.json"

# As a last step check if podspec has a "tag" or "commit" field in "source"
warn_missing_tag_commit
done

# Generate the React Native podspecs
Expand All @@ -44,11 +103,40 @@ do
path=$(dirname "$podspec")

echo "Generating podspec for $pod with path $path"
pod ipc spec $podspec > "$TMP_DEST/$pod.podspec.json"
pod ipc spec "$podspec" > "$TMP_DEST/$pod.podspec.json"
cat "$TMP_DEST/$pod.podspec.json" | jq > "$DEST/$pod.podspec.json"

# Add a "prepare_command" entry to each podspec so that 'pod install' will fetch sources from the correct directory
# and retains the existing prepare_command if it exists
prepare_command="TMP_DIR=\$(mktemp -d); mv * \$TMP_DIR; cp -R \"\$TMP_DIR/${path}\"/* ."
cat "$TMP_DEST/$pod.podspec.json" | jq --arg CMD "$prepare_command" '.prepare_command = "\($CMD) && \(.prepare_command // true)"' > "$DEST/$pod.podspec.json"

# Add warning to bottom
TMP_SPEC=$(mktemp)
jq '. + {"__WARNING!__": "This file is autogenerated by generate-podspecs.sh script. Do not modify manually. Re-run the script if necessary."}' "$DEST/$pod.podspec.json" > "$TMP_SPEC"
mv "$TMP_SPEC" "$DEST/$pod.podspec.json"

# As a last step check if podspec has a "tag" or "commit" field in "source"
warn_missing_tag_commit

# FBReactNativeSpec needs special treatment because of react-native-codegen code generation
if [[ "$pod" == "FBReactNativeSpec" ]]; then
echo " ==> Patching $pod podspec"
# First move it to its own folder
mkdir -p "$DEST/FBReactNativeSpec"
mv "$DEST/FBReactNativeSpec.podspec.json" "$DEST/FBReactNativeSpec"

# Then we generate FBReactNativeSpec-generated.mm and FBReactNativeSpec.h files.
# They are normally generated during compile time using a Script Phase in FBReactNativeSpec added via the `use_react_native_codegen` function.
# This script is inside node_modules/react-native/scripts folder. Since we don't have the node_modules when compiling WPiOS,
# we're calling the script here manually to generate these files ahead of time.
CODEGEN_MODULES_OUTPUT_DIR=$DEST/FBReactNativeSpec ./scripts/generate-specs.sh

# Removing 'script_phases' that shouldn't be needed anymore.
# Removing 'prepare_command' that includes additional steps to create intermediate folders to keep generated files which won't be needed.
# Removing 'source.tag' as we'll use a commit hash from gutenberg-mobile instead.
TMP_FBReactNativeSpec=$(mktemp)
jq --arg COMMIT_HASH "$COMMIT_HASH" 'del(.script_phases) | del(.prepare_command) | del(.source.tag) | .source.git = "https://github.com/wordpress-mobile/gutenberg-mobile.git" | .source.commit = $COMMIT_HASH | .source.submodules = "true" | .source_files = "third-party-podspecs/FBReactNativeSpec/**/*.{c,h,m,mm,cpp}"' "$DEST/FBReactNativeSpec/FBReactNativeSpec.podspec.json" > "$TMP_FBReactNativeSpec"
mv "$TMP_FBReactNativeSpec" "$DEST/FBReactNativeSpec/FBReactNativeSpec.podspec.json"
fi
done
1 change: 1 addition & 0 deletions block-experiments
Submodule block-experiments added at 79b49e
Loading