-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Gemfile, ruby-version (#32303)
Summary: Implement par of the discussion react-native-community/discussions-and-proposals#411, except the `.nvmrc` part, this includes: - Setting `.ruby-version` in the main project and also `template/` - Fixing the CocoaPods version with a project-level `Gemfile` and also `template/Gemfile` - Using all `pod` executions from `bundle exec pod`, using the determined version - Script to manage and update the ruby version ## Changelog [iOS] [Added] - Gemfile with CocoaPods 1.11 and ruby-version (2.7.4) Pull Request resolved: #32303 Test Plan: Build for iOS and run all CircleCI tests to see if nothing changed Reviewed By: RSNara Differential Revision: D31344686 Pulled By: fkgozali fbshipit-source-id: 25c63131ca9b16d3cf6341019548e0d63bdcaefe
- Loading branch information
1 parent
d8931e2
commit 57aa70c
Showing
18 changed files
with
335 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BUNDLE_PATH: "vendor/bundle" | ||
BUNDLE_FORCE_RUBY_PLATFORM: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.7.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version | ||
ruby '2.7.4' | ||
|
||
gem 'cocoapods', '~> 1.11', '>= 1.11.2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (3.0.4) | ||
rexml | ||
activesupport (6.1.4.1) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (>= 1.6, < 2) | ||
minitest (>= 5.1) | ||
tzinfo (~> 2.0) | ||
zeitwerk (~> 2.3) | ||
addressable (2.8.0) | ||
public_suffix (>= 2.0.2, < 5.0) | ||
algoliasearch (1.27.5) | ||
httpclient (~> 2.8, >= 2.8.3) | ||
json (>= 1.5.1) | ||
atomos (0.1.3) | ||
claide (1.0.3) | ||
cocoapods (1.11.2) | ||
addressable (~> 2.8) | ||
claide (>= 1.0.2, < 2.0) | ||
cocoapods-core (= 1.11.2) | ||
cocoapods-deintegrate (>= 1.0.3, < 2.0) | ||
cocoapods-downloader (>= 1.4.0, < 2.0) | ||
cocoapods-plugins (>= 1.0.0, < 2.0) | ||
cocoapods-search (>= 1.0.0, < 2.0) | ||
cocoapods-trunk (>= 1.4.0, < 2.0) | ||
cocoapods-try (>= 1.1.0, < 2.0) | ||
colored2 (~> 3.1) | ||
escape (~> 0.0.4) | ||
fourflusher (>= 2.3.0, < 3.0) | ||
gh_inspector (~> 1.0) | ||
molinillo (~> 0.8.0) | ||
nap (~> 1.0) | ||
ruby-macho (>= 1.0, < 3.0) | ||
xcodeproj (>= 1.21.0, < 2.0) | ||
cocoapods-core (1.11.2) | ||
activesupport (>= 5.0, < 7) | ||
addressable (~> 2.8) | ||
algoliasearch (~> 1.0) | ||
concurrent-ruby (~> 1.1) | ||
fuzzy_match (~> 2.0.4) | ||
nap (~> 1.0) | ||
netrc (~> 0.11) | ||
public_suffix (~> 4.0) | ||
typhoeus (~> 1.0) | ||
cocoapods-deintegrate (1.0.5) | ||
cocoapods-downloader (1.5.1) | ||
cocoapods-plugins (1.0.0) | ||
nap | ||
cocoapods-search (1.0.1) | ||
cocoapods-trunk (1.6.0) | ||
nap (>= 0.8, < 2.0) | ||
netrc (~> 0.11) | ||
cocoapods-try (1.2.0) | ||
colored2 (3.1.2) | ||
concurrent-ruby (1.1.9) | ||
escape (0.0.4) | ||
ethon (0.14.0) | ||
ffi (>= 1.15.0) | ||
ffi (1.15.4) | ||
fourflusher (2.3.1) | ||
fuzzy_match (2.0.4) | ||
gh_inspector (1.1.3) | ||
httpclient (2.8.3) | ||
i18n (1.8.10) | ||
concurrent-ruby (~> 1.0) | ||
json (2.5.1) | ||
minitest (5.14.4) | ||
molinillo (0.8.0) | ||
nanaimo (0.3.0) | ||
nap (1.1.0) | ||
netrc (0.11.0) | ||
public_suffix (4.0.6) | ||
rexml (3.2.5) | ||
ruby-macho (2.5.1) | ||
typhoeus (1.4.0) | ||
ethon (>= 0.9.0) | ||
tzinfo (2.0.4) | ||
concurrent-ruby (~> 1.0) | ||
xcodeproj (1.21.0) | ||
CFPropertyList (>= 2.3.3, < 4.0) | ||
atomos (~> 0.1.3) | ||
claide (>= 1.0.2, < 2.0) | ||
colored2 (~> 3.1) | ||
nanaimo (~> 0.3.0) | ||
rexml (~> 3.2.4) | ||
zeitwerk (2.4.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
cocoapods (~> 1.11, >= 1.11.2) | ||
|
||
RUBY VERSION | ||
ruby 2.7.4p191 | ||
|
||
BUNDLED WITH | ||
2.2.28 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -e | ||
|
||
if [ "$VERBOSE" = 1 ]; then | ||
set -x | ||
fi | ||
|
||
case $(sed --help 2>&1) in | ||
*GNU*) sed_i () { sed -i "$@"; };; | ||
*) sed_i () { sed -i '' "$@"; };; | ||
esac | ||
|
||
SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
ROOT="$(dirname "$SCRIPTS")" | ||
|
||
die() { | ||
echo "ERROR: $*" >&2 | ||
exit 1 | ||
} | ||
|
||
if [ $# -eq 1 ]; then | ||
VERSION=$1 | ||
else | ||
VERSION=$(ruby --version | cut -d' ' -f2 | cut -dp -f1) | ||
fi | ||
|
||
if [ -z "$VERSION" ]; then | ||
die "Please provide an installed/usable Ruby version" | ||
fi | ||
echo "Setting Ruby version to: $VERSION" | ||
|
||
cd "$ROOT" || die "Failed to change to $ROOT" | ||
|
||
# do this first, so rbenv/rvm will automatically pick the desired version | ||
echo "$VERSION" > .ruby-version | ||
|
||
# make sure we're using it | ||
CURRENT_VERSION=$(ruby --version | cut -d' ' -f2 | cut -dp -f1) | ||
if [ -z "$CURRENT_VERSION" ]; then | ||
# rbenv/rvm uses shims, the commands do exist, but do not return a version if misconfigured | ||
die "Missing usable ruby, check your installation" | ||
elif [ "$VERSION" != "$CURRENT_VERSION" ]; then | ||
die "Plese use the ruby version you are trying to set: $VERSION ('$CURRENT_VERSION' in use)" | ||
fi | ||
|
||
echo "$VERSION" > template/_ruby-version | ||
|
||
sed_i -e "s/^\(ruby '\)[^']*\('.*\)$/\1$VERSION\2/" Gemfile | ||
sed_i -e "s/^\(ruby '\)[^']*\('.*\)$/\1$VERSION\2/" template/Gemfile | ||
|
||
rm -f Gemfile.lock template/Gemfile.lock | ||
|
||
bundle lock | ||
(cd template && bundle lock) | ||
|
||
git add \ | ||
.ruby-version \ | ||
Gemfile \ | ||
template/_ruby-version \ | ||
template/Gemfile \ | ||
template/Gemfile.lock |
Oops, something went wrong.
57aa70c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I installed 0.67.0 and
_ruby-version
not renamed to.ruby-version
57aa70c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed here react-native-community/cli#1530