diff --git a/React.podspec b/React.podspec index 946d461b20c92a..ea03984db1ab4c 100644 --- a/React.podspec +++ b/React.podspec @@ -1,4 +1,9 @@ # coding: utf-8 +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + require "json" package = JSON.parse(File.read(File.join(__dir__, "package.json"))) diff --git a/gradlew.bat b/gradlew.bat index e95643d6a2ca62..1934213b6ddee5 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,8 @@ +:: Copyright (c) 2015-present, Facebook, Inc. +:: +:: This source code is licensed under the MIT license found in the +:: LICENSE file in the root directory of this source tree. + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem diff --git a/react.gradle b/react.gradle index d71b5c14d37f0a..bb6709a1958f35 100644 --- a/react.gradle +++ b/react.gradle @@ -1,3 +1,8 @@ +// Copyright (c) 2015-present, Facebook, Inc. + +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree. + import org.apache.tools.ant.taskdefs.condition.Os def config = project.hasProperty("react") ? project.react : []; diff --git a/runXcodeTests.sh b/runXcodeTests.sh index 9b9b00b99ae487..84d069a4d54acf 100755 --- a/runXcodeTests.sh +++ b/runXcodeTests.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # This script should be run from the react-native root THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) diff --git a/scripts/android-setup.sh b/scripts/android-setup.sh index cb437943023b9a..a7364794dee3e5 100644 --- a/scripts/android-setup.sh +++ b/scripts/android-setup.sh @@ -1,3 +1,9 @@ +#!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # inspired by https://github.com/Originate/guide/blob/master/android/guide/Continuous%20Integration.md # shellcheck disable=SC1091 diff --git a/scripts/circleci/analyze_code.sh b/scripts/circleci/analyze_code.sh index 971f6cb156a777..047c82741fcb3d 100755 --- a/scripts/circleci/analyze_code.sh +++ b/scripts/circleci/analyze_code.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow --silent -- check --json) | node scripts/circleci/code-analysis-bot.js diff --git a/scripts/circleci/apt-get-android-deps.sh b/scripts/circleci/apt-get-android-deps.sh index 79fabd2026d67e..dcb228f31ab1d9 100755 --- a/scripts/circleci/apt-get-android-deps.sh +++ b/scripts/circleci/apt-get-android-deps.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. set -e diff --git a/scripts/circleci/buck_fetch.sh b/scripts/circleci/buck_fetch.sh index df9ce34304da67..00f77c1f2d47e2 100755 --- a/scripts/circleci/buck_fetch.sh +++ b/scripts/circleci/buck_fetch.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. set -ex diff --git a/scripts/circleci/check_cache.sh b/scripts/circleci/check_cache.sh index 5cd3b68251eef1..dff4b7b3eccfde 100755 --- a/scripts/circleci/check_cache.sh +++ b/scripts/circleci/check_cache.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. set -e diff --git a/scripts/circleci/check_license.sh b/scripts/circleci/check_license.sh index 68b41d6ac441b6..4e0fe07050d87b 100755 --- a/scripts/circleci/check_license.sh +++ b/scripts/circleci/check_license.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. set -e diff --git a/scripts/circleci/exec_author_check.sh b/scripts/circleci/exec_author_check.sh index 99e4e581e8194f..45132daf293fd9 100755 --- a/scripts/circleci/exec_author_check.sh +++ b/scripts/circleci/exec_author_check.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # This is meant to be used to keep failing tests from # running for regular contributors, while still letting # them run on PRs submitted by core contributors. diff --git a/scripts/circleci/exec_swallow_error.sh b/scripts/circleci/exec_swallow_error.sh index 1c2470c7121354..e3997e445ecaaf 100755 --- a/scripts/circleci/exec_swallow_error.sh +++ b/scripts/circleci/exec_swallow_error.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. # execute command "$@" diff --git a/scripts/circleci/gradle_download_deps.sh b/scripts/circleci/gradle_download_deps.sh index 1e093de55a0b7f..47c7285d8dd96d 100755 --- a/scripts/circleci/gradle_download_deps.sh +++ b/scripts/circleci/gradle_download_deps.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. set -e -./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders \ No newline at end of file +./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders diff --git a/scripts/ios-configure-glog.sh b/scripts/ios-configure-glog.sh index 3840fc4ebc719c..f3a10122a4accf 100755 --- a/scripts/ios-configure-glog.sh +++ b/scripts/ios-configure-glog.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + set -e PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}" @@ -10,7 +15,7 @@ if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then CURRENT_ARCH="x86_64" - else + else CURRENT_ARCH="armv7" fi fi diff --git a/scripts/ios-install-third-party.sh b/scripts/ios-install-third-party.sh index c53292659fc9e6..1847dc99524a14 100755 --- a/scripts/ios-install-third-party.sh +++ b/scripts/ios-install-third-party.sh @@ -1,4 +1,8 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. cachedir="$HOME/.rncache" mkdir -p "$cachedir" diff --git a/scripts/launchPackager.command b/scripts/launchPackager.command index f8146dcf91a4dc..d55d3e6920e149 100755 --- a/scripts/launchPackager.command +++ b/scripts/launchPackager.command @@ -1,5 +1,4 @@ #!/bin/bash - # Copyright (c) 2015-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the diff --git a/scripts/objc-test-ios.sh b/scripts/objc-test-ios.sh index d466f877540add..ae547eb8dff95e 100755 --- a/scripts/objc-test-ios.sh +++ b/scripts/objc-test-ios.sh @@ -1,6 +1,9 @@ #!/bin/bash -set -ex - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Script used to run iOS tests. # If not arguments are passed to the script, it will only compile # the RNTester. @@ -8,6 +11,8 @@ set -ex # also run the RNTester integration test (needs JS and packager): # ./objc-test-ios.sh test +set -ex + SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT=$(dirname "$SCRIPTS") diff --git a/scripts/objc-test-tvos.sh b/scripts/objc-test-tvos.sh index 98016598df0ff4..006de08cdbb4b7 100755 --- a/scripts/objc-test-tvos.sh +++ b/scripts/objc-test-tvos.sh @@ -1,6 +1,9 @@ #!/bin/bash -set -ex - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Script used to run tvOS tests. # If not arguments are passed to the script, it will only compile # the RNTester. @@ -8,6 +11,8 @@ set -ex # also run the RNTester integration test (needs JS and packager): # ./objc-test-tvos.sh test +set -ex + SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT=$(dirname "$SCRIPTS") diff --git a/scripts/objc-test.sh b/scripts/objc-test.sh index ed670cc2a2a5f2..31c53a337088c7 100755 --- a/scripts/objc-test.sh +++ b/scripts/objc-test.sh @@ -1,6 +1,9 @@ #!/bin/bash -set -ex - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Script used to run iOS and tvOS tests. # Environment variables are used to configure what test to run. # If not arguments are passed to the script, it will only compile @@ -9,6 +12,8 @@ set -ex # also run the RNTester integration test (needs JS and packager). # ./objc-test.sh test +set -ex + SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ROOT=$(dirname $SCRIPTS) diff --git a/scripts/packager.sh b/scripts/packager.sh index 1d33bf557e8fb3..1c1e7233836724 100755 --- a/scripts/packager.sh +++ b/scripts/packager.sh @@ -1,5 +1,4 @@ #!/bin/bash - # Copyright (c) 2015-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the diff --git a/scripts/process-podspecs.sh b/scripts/process-podspecs.sh index 6c66f1d87ea921..40a2a926e59f86 100755 --- a/scripts/process-podspecs.sh +++ b/scripts/process-podspecs.sh @@ -1,4 +1,9 @@ #!/bin/bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + set -ex SCRIPTS=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index b5402f6e78da17..797994fd7f2ef6 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -3,7 +3,7 @@ # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. - +# # Bundle React Native app's code and image assets. # This script is supposed to be invoked as part of Xcode build process # and relies on environment variables (including PWD) set by Xcode diff --git a/scripts/run-android-emulator.sh b/scripts/run-android-emulator.sh index d2c6390d952381..7929b6a79feabb 100755 --- a/scripts/run-android-emulator.sh +++ b/scripts/run-android-emulator.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Runs an Android emulator locally. # If there already is a running emulator, this just uses that. # The only reason to use this config is that it represents a known-good diff --git a/scripts/run-android-local-integration-tests.sh b/scripts/run-android-local-integration-tests.sh index a85d02be37cfa2..97accd42023f25 100755 --- a/scripts/run-android-local-integration-tests.sh +++ b/scripts/run-android-local-integration-tests.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Runs all Android integration tests locally. # See http://facebook.github.io/react-native/docs/testing.html diff --git a/scripts/run-android-local-unit-tests.sh b/scripts/run-android-local-unit-tests.sh index 31daf6aef2e215..09b31546d5fd77 100755 --- a/scripts/run-android-local-unit-tests.sh +++ b/scripts/run-android-local-unit-tests.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Runs all Android unit tests locally. # See http://facebook.github.io/react-native/docs/testing.html diff --git a/scripts/run-instrumentation-tests-via-adb-shell.sh b/scripts/run-instrumentation-tests-via-adb-shell.sh index 5a9a976a97da4e..5b8fe6a4181dee 100755 --- a/scripts/run-instrumentation-tests-via-adb-shell.sh +++ b/scripts/run-instrumentation-tests-via-adb-shell.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # Python script to run instrumentation tests, copied from https://github.com/circleci/circle-dummy-android # Example: ./scripts/run-android-instrumentation-tests.sh com.facebook.react.tests com.facebook.react.tests.ReactPickerTestCase # @@ -24,7 +28,7 @@ test_class = None if len(sys.argv) > 2: test_class = sys.argv[2] - + def update(): # prevent CircleCI from killing the process for inactivity while not done: @@ -38,10 +42,10 @@ t.start() def run(): sp.Popen(['adb', 'wait-for-device']).communicate() if (test_class != None): - p = sp.Popen('adb shell am instrument -w -e class %s %s/android.support.test.runner.AndroidJUnitRunner' + p = sp.Popen('adb shell am instrument -w -e class %s %s/android.support.test.runner.AndroidJUnitRunner' % (test_class, test_app), shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE) else : - p = sp.Popen('adb shell am instrument -w %s/android.support.test.runner.AndroidJUnitRunner' + p = sp.Popen('adb shell am instrument -w %s/android.support.test.runner.AndroidJUnitRunner' % (test_app), shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE) return p.communicate() diff --git a/scripts/sync-css-layout.sh b/scripts/sync-css-layout.sh index 6c2f2f3c01f2a4..ebfc9579df777b 100755 --- a/scripts/sync-css-layout.sh +++ b/scripts/sync-css-layout.sh @@ -1,4 +1,9 @@ #!/usr/bin/env bash +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + function usage { echo "usage: sync-css-layout.sh "; diff --git a/scripts/validate-android-device-env.sh b/scripts/validate-android-device-env.sh index 35e7d87d321cda..812c25639ddd14 100755 --- a/scripts/validate-android-device-env.sh +++ b/scripts/validate-android-device-env.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # This script validates that the Android environment is set up to run # tests on a device or emulator (as opposed to a plain Java environment). diff --git a/scripts/validate-android-sdk.sh b/scripts/validate-android-sdk.sh index 64ab285fd7c9e2..1f85a410426a4d 100755 --- a/scripts/validate-android-sdk.sh +++ b/scripts/validate-android-sdk.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # This script validates that the Android SDK is installed correctly. # This means setting ANDROID_HOME and adding its subdirectories to PATH. # If the Android SDK is not installed correctly, this script exits @@ -48,4 +52,4 @@ if [ -z `which adb` ]; then echo "See https://facebook.github.io/react-native/docs/getting-started.html for instructions." exit 1 fi - + diff --git a/scripts/validate-android-test-env.sh b/scripts/validate-android-test-env.sh index a4b97c6d0f0d4e..eef4d91f8f9bc7 100755 --- a/scripts/validate-android-test-env.sh +++ b/scripts/validate-android-test-env.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # This script validates that Android is set up correctly for the # testing environment. # @@ -107,7 +111,7 @@ if [ -n "$(which csrutil)" ]; then exit 1 fi fi - + if [ -z "$JAVA_HOME" ]; then echo "Error: \$JAVA_HOME is not configured." echo "Try adding export JAVA_HOME=\$(/usr/libexec/java_home) to your .bashrc or equivalent." diff --git a/scripts/validate-ios-test-env.sh b/scripts/validate-ios-test-env.sh index fbf7fbe65fbefd..8e17ac58373a14 100755 --- a/scripts/validate-ios-test-env.sh +++ b/scripts/validate-ios-test-env.sh @@ -1,5 +1,9 @@ #!/bin/bash - +# Copyright (c) 2015-present, Facebook, Inc. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. +# # This script validates that iOS is set up correctly for the # testing environment. # @@ -22,14 +26,14 @@ NODE_VERSION="$(command node --version | sed 's/[-/a-zA-Z]//g' |sed 's/.\{2\}$// if (( $(echo "${NODE_VERSION} <= 6.0" | bc -l) )); then echo "Node ${NODE_VERSION} detected. This version of Node is not supported." - echo "See https://nodejs.org/en/download/ for instructions." + echo "See https://facebook.github.io/react-native/docs/getting-started.html for instructions." exit 1 fi # Check that Xcode is installed. if [ -z "$(which xcodebuild)" ]; then echo "Could not find Xcode build tools. Please check your Xcode install." - echo "See http://facebook.github.io/react-native/docs/getting-started.html for instructions." + echo "See https://facebook.github.io/react-native/docs/getting-started.html for instructions." exit 1 fi @@ -39,6 +43,6 @@ XCODE_VERSION="$(command xcodebuild -version | sed '$ d' | sed 's/[-/a-zA-Z]//g' if (version_gt $MIN_XCODE_VERSION $XCODE_VERSION) && [ "$XCODE_VERSION" != "$MIN_XCODE_VERSION" ]; then echo "Xcode ${XCODE_VERSION} detected. React Native requires ${MIN_XCODE_VERSION} or newer." echo "Older versions of Xcode may cause cryptic build errors." - echo "See http://facebook.github.io/react-native/docs/getting-started.html for instructions." + echo "See https://facebook.github.io/react-native/docs/getting-started.html for instructions." exit 1 fi