From cb87c3f4100c1f1dde2ad2b4ada522abe8d38547 Mon Sep 17 00:00:00 2001 From: empyrical Date: Thu, 13 Sep 2018 07:41:49 -0700 Subject: [PATCH] Fix failing Android CI (#21083) Summary: This PR does 2 things: * Have Facebook internal dependencies only be added if `IS_OSS_BUILD` is `True`. This syntax is used in other BUCK files in the codebase. * `ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK` * `ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK` * Add a missing Android dependency to this BUCK file: * `ReactAndroid/src/main/java/com/facebook/react/BUCK` As a result, `test_android` is passing again. Pull Request resolved: https://github.com/facebook/react-native/pull/21083 Differential Revision: D9809808 Pulled By: hramos fbshipit-source-id: c840ea2892006a88fe13de1b1324746d030ebaf2 --- .../java/com/facebook/react/testing/rule/BUCK | 10 ++++++---- .../java/com/facebook/react/tests/core/BUCK | 8 +++++--- ReactAndroid/src/main/java/com/facebook/react/BUCK | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK index d5f0977f9..e1c7eed29 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK @@ -1,6 +1,7 @@ # BUILD FILE SYNTAX: SKYLARK load( "//tools/build_defs/oss:rn_defs.bzl", + "IS_OSS_BUILD", "react_native_dep", "react_native_integration_tests_target", "react_native_target", @@ -13,9 +14,7 @@ rn_android_library( visibility = [ "PUBLIC", ], - deps = [ - react_native_dep("java/com/facebook/testing/instrumentation:instrumentation"), - react_native_dep("java/com/facebook/testing/instrumentation/base:base"), + deps = ([ react_native_dep("third-party/java/espresso:espresso"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/java/junit:junit"), @@ -31,5 +30,8 @@ rn_android_library( react_native_target("java/com/facebook/react/modules/core:core"), react_native_target("java/com/facebook/react/shell:shell"), react_native_target("java/com/facebook/react/uimanager:uimanager"), - ], + ]) + ([ + react_native_dep("java/com/facebook/testing/instrumentation:instrumentation"), + react_native_dep("java/com/facebook/testing/instrumentation/base:base"), + ]) if not IS_OSS_BUILD else [], ) diff --git a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK index 7c586a69a..5f87d7e94 100644 --- a/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK +++ b/ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK @@ -1,6 +1,7 @@ # BUILD FILE SYNTAX: SKYLARK load( "//tools/build_defs/oss:rn_defs.bzl", + "IS_OSS_BUILD", "react_native_dep", "react_native_integration_tests_target", "react_native_target", @@ -10,8 +11,7 @@ load( rn_android_library( name = "core", srcs = glob(["*.java"]), - deps = [ - react_native_dep("java/com/facebook/fbreact/testing:testing"), + deps = ([ react_native_dep("third-party/java/espresso:espresso"), react_native_dep("third-party/java/fest:fest"), react_native_dep("third-party/java/junit:junit"), @@ -22,5 +22,7 @@ rn_android_library( react_native_target("java/com/facebook/react/bridge:bridge"), react_native_target("java/com/facebook/react/shell:shell"), react_native_target("java/com/facebook/react/uimanager:uimanager"), - ], + ]) + ([ + react_native_dep("java/com/facebook/fbreact/testing:testing"), + ]) if not IS_OSS_BUILD else [], ) diff --git a/ReactAndroid/src/main/java/com/facebook/react/BUCK b/ReactAndroid/src/main/java/com/facebook/react/BUCK index 63c0a870c..426fd4f5d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/BUCK @@ -5,6 +5,7 @@ rn_android_library( srcs = glob(["*.java"]), provided_deps = [ react_native_dep("third-party/android/support/v4:lib-support-v4"), + react_native_dep("third-party/android/support-annotations:android-support-annotations"), ], visibility = [ "PUBLIC",