mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix Travis podspec CI for Cxx bridge
Summary: Fixed the test script to properly setup our third-party deps and tweaked the third-party specs a bit so they work correctly. This currently works for projects using static libraries, but fails when using dynamic libraries (`--use-libraries`) cc mhorowitz alloy Closes https://github.com/facebook/react-native/pull/14100 Differential Revision: D5380728 Pulled By: javache fbshipit-source-id: e78b6bd4466ebf2bf30b7e361eff10ec14b36a55
This commit is contained in:
committed by
James Ide
parent
0877f2c4de
commit
cc4fadac5f
@@ -15,7 +15,7 @@ cd "$ROOT"
|
||||
|
||||
SCHEME="RNTester"
|
||||
SDK="iphonesimulator"
|
||||
DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.1"
|
||||
DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.3.1"
|
||||
|
||||
# If there is a "test" argument, pass it to the test script.
|
||||
# If there's a "test" argument, pass it to the test script.
|
||||
. ./scripts/objc-test.sh $1
|
||||
|
||||
@@ -15,7 +15,7 @@ cd "$ROOT"
|
||||
|
||||
SCHEME="RNTester-tvOS"
|
||||
SDK="appletvsimulator"
|
||||
DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p,OS=10.1"
|
||||
DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p,OS=10.2"
|
||||
|
||||
# If there's a "test" argument, pass it to the test script.
|
||||
. ./scripts/objc-test.sh $1
|
||||
|
||||
+19
-10
@@ -3,7 +3,6 @@ set -ex
|
||||
|
||||
SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
ROOT=$(dirname $SCRIPTS)
|
||||
YOGA_ROOT="$ROOT/ReactCommon/yoga"
|
||||
|
||||
# Specify `SPEC_REPO` as an env variable if you want to push to a specific spec repo.
|
||||
# Defaults to `react-test`, which is meant to be a dummy repo used to test that the specs fully lint.
|
||||
@@ -14,17 +13,17 @@ SPEC_REPO_DIR="$HOME/.cocoapods/repos/$SPEC_REPO"
|
||||
if ! [ -d "$SPEC_REPO_DIR" ]; then
|
||||
mkdir -p "$SPEC_REPO_DIR"
|
||||
cd "$SPEC_REPO_DIR"
|
||||
echo "testing" > .gitkeep
|
||||
touch .gitkeep
|
||||
git init
|
||||
git add .gitkeep
|
||||
git add .
|
||||
git commit -m "init"
|
||||
git remote add origin "https://example.com/$SPEC_REPO.git"
|
||||
fi
|
||||
|
||||
cd "$SPEC_REPO_DIR"
|
||||
SPEC_REPO_REMOTE=$(git remote get-url origin)
|
||||
SPEC_REPOS="$(git remote get-url origin),https://github.com/CocoaPods/Specs.git"
|
||||
|
||||
POD_LINT_OPT="--verbose --allow-warnings --fail-fast --private --swift-version=3.0 --sources=$SPEC_REPO_REMOTE"
|
||||
POD_LINT_OPT="--verbose --allow-warnings --fail-fast --private --swift-version=3.0 --sources=$SPEC_REPOS"
|
||||
|
||||
# Get the version from a podspec.
|
||||
version() {
|
||||
@@ -33,8 +32,12 @@ version() {
|
||||
|
||||
# Lint both framework and static library builds.
|
||||
lint() {
|
||||
pod lib lint $POD_LINT_OPT
|
||||
pod lib lint $POD_LINT_OPT --use-libraries
|
||||
local SUBSPEC=$1
|
||||
if [ "${SUBSPEC:-}" ]; then
|
||||
local SUBSPEC_OPT="--subspec=$SUBSPEC"
|
||||
fi
|
||||
pod lib lint $SUBSPEC_OPT $POD_LINT_OPT
|
||||
pod lib lint $SUBSPEC_OPT $POD_LINT_OPT --use-libraries
|
||||
}
|
||||
|
||||
# Push the spec in arg `$1`, which is expected to be in the cwd, to the `SPEC_REPO` in JSON format.
|
||||
@@ -52,11 +55,17 @@ push() {
|
||||
process() {
|
||||
cd $1
|
||||
if [ -z "$SKIP_LINT" ]; then
|
||||
lint
|
||||
lint $2
|
||||
fi
|
||||
local SPEC_NAME=(*.podspec)
|
||||
push $SPEC_NAME
|
||||
}
|
||||
|
||||
process $YOGA_ROOT
|
||||
process $ROOT
|
||||
# Make third-party deps accessible
|
||||
cd "$ROOT/third-party-podspecs"
|
||||
push Folly.podspec
|
||||
push DoubleConversion.podspec
|
||||
push GLog.podspec
|
||||
|
||||
process "$ROOT/ReactCommon/yoga"
|
||||
process "$ROOT" _ignore_me_subspec_for_linting_
|
||||
|
||||
Reference in New Issue
Block a user