From c81a252997c17264b1d7708320dfa2c930a893a0 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 28 Feb 2018 17:37:59 -0800 Subject: [PATCH 1/2] Check PATENTS does not creep into files --- .circleci/config.yml | 12 +++++++++--- scripts/circleci/check_license.sh | 13 +++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100755 scripts/circleci/check_license.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 12a44b30ae5856..2cfbaf4f6a3958 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/scripts/circleci/check_license.sh b/scripts/circleci/check_license.sh new file mode 100755 index 00000000000000..68b41d6ac441b6 --- /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 From cfd90c2915c659db267a04dbe2c91928e21b8ed6 Mon Sep 17 00:00:00 2001 From: Hector Ramos Date: Wed, 28 Feb 2018 17:48:22 -0800 Subject: [PATCH 2/2] Use new license --- .../NativeAnimation/Nodes/RCTTrackingAnimatedNode.h | 6 ++---- .../NativeAnimation/Nodes/RCTTrackingAnimatedNode.m | 6 ++---- .../facebook/react/animated/TrackingAnimatedNode.java | 6 ++---- .../react/views/text/CustomLetterSpacingSpan.java | 6 ++---- ReactCommon/yoga/yoga/YGLayout.cpp | 9 ++++----- ReactCommon/yoga/yoga/YGLayout.h | 9 ++++----- ReactCommon/yoga/yoga/YGStyle.cpp | 9 ++++----- ReactCommon/yoga/yoga/YGStyle.h | 9 ++++----- 8 files changed, 24 insertions(+), 36 deletions(-) diff --git a/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h b/Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h index 8f3281789ddbb0..99e9bd1112a60e 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 e77b773e040a12..42150285da4cd2 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 db312d23558078..a339780dfdb60f 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 004d26138694e5..d41338ccd93664 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 66348fc29c055c..c400279f738fb5 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. + * Copyright (c) 2015-present, Facebook, Inc. * - * 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" const std::array kYGDefaultDimensionValues = { diff --git a/ReactCommon/yoga/yoga/YGLayout.h b/ReactCommon/yoga/yoga/YGLayout.h index 125a6d0b03ed0a..3d5111205a0c25 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. + * Copyright (c) 2015-present, Facebook, Inc. * - * 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 a73cb3ce6dd6ad..bd040b6953ea01 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. + * Copyright (c) 2015-present, Facebook, Inc. * - * 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 a95b4a297e7667..37a320e91ebee2 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. + * Copyright (c) 2015-present, Facebook, Inc. * - * 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"