diff --git a/.circleci/config.yml b/.circleci/config.yml index 12a44b30a..2cfbaf4f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -152,6 +152,11 @@ aliases: command: yarn flow check when: always + - &run-license-checks + name: Check license + command: ./scripts/circleci/check_license.sh + when: always + - &build-android-app name: Build Android App command: | @@ -275,7 +280,7 @@ jobs: # Runs JavaScript lint and flow checks. # Currently will fail a PR if lint/flow raises issues. - js_checks: + analyze: <<: *js_defaults steps: - attach_workspace: @@ -283,6 +288,7 @@ jobs: - run: *run-lint-checks - run: *run-flow-checks + - run: *run-license-checks - store_test_results: path: ~/react-native/reports/junit @@ -576,8 +582,8 @@ workflows: - checkout_code: filters: *filter-ignore-gh-pages - # Run lint and flow checks - - js_checks: + # Run lint, flow, and other checks + - analyze: filters: *filter-ignore-gh-pages requires: - checkout_code diff --git a/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h b/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h index 8f3281789..99e9bd111 100644 --- a/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h +++ b/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h @@ -1,10 +1,8 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ #import "RCTAnimatedNode.h" diff --git a/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m b/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m index e77b773e0..42150285d 100644 --- a/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m +++ b/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m @@ -1,10 +1,8 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ #import "RCTTrackingAnimatedNode.h" diff --git a/ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java b/ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java index db312d235..a339780df 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java @@ -1,10 +1,8 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ package com.facebook.react.animated; diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java index 004d26138..d41338ccd 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java @@ -1,10 +1,8 @@ /** * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ package com.facebook.react.views.text; diff --git a/ReactCommon/yoga/yoga/YGLayout.cpp b/ReactCommon/yoga/yoga/YGLayout.cpp index 208a6fe3f..4d798476a 100644 --- a/ReactCommon/yoga/yoga/YGLayout.cpp +++ b/ReactCommon/yoga/yoga/YGLayout.cpp @@ -1,11 +1,10 @@ /** * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ + #include "YGLayout.h" #include "Utils.h" diff --git a/ReactCommon/yoga/yoga/YGLayout.h b/ReactCommon/yoga/yoga/YGLayout.h index 125a6d0b0..cfe559f64 100644 --- a/ReactCommon/yoga/yoga/YGLayout.h +++ b/ReactCommon/yoga/yoga/YGLayout.h @@ -1,11 +1,10 @@ /** * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ + #pragma once #include "Yoga-internal.h" diff --git a/ReactCommon/yoga/yoga/YGStyle.cpp b/ReactCommon/yoga/yoga/YGStyle.cpp index 56b5a1e69..f3bc16fe1 100644 --- a/ReactCommon/yoga/yoga/YGStyle.cpp +++ b/ReactCommon/yoga/yoga/YGStyle.cpp @@ -1,11 +1,10 @@ /** * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ + #include "YGStyle.h" const YGValue kYGValueUndefined = {YGUndefined, YGUnitUndefined}; diff --git a/ReactCommon/yoga/yoga/YGStyle.h b/ReactCommon/yoga/yoga/YGStyle.h index a95b4a297..74b9d6e0b 100644 --- a/ReactCommon/yoga/yoga/YGStyle.h +++ b/ReactCommon/yoga/yoga/YGStyle.h @@ -1,11 +1,10 @@ /** * Copyright (c) 2014-present, Facebook, Inc. - * All rights reserved. * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. */ + #pragma once #include "Yoga-internal.h" #include "Yoga.h" diff --git a/scripts/circleci/check_license.sh b/scripts/circleci/check_license.sh new file mode 100755 index 000000000..68b41d6ac --- /dev/null +++ b/scripts/circleci/check_license.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Make sure we don't introduce accidental references to PATENTS. +EXPECTED='scripts/circleci/check_license.sh' +ACTUAL=$(git grep -l PATENTS) + +if [ "$EXPECTED" != "$ACTUAL" ]; then + echo "PATENTS crept into some new files?" + diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true + exit 1 +fi