Skip to content

Commit

Permalink
Fix OSS Buck parsing errors (facebook#31957)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#31957

Changelog: [Internal]

Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs.

Also adds license headers to some recently-added files that didn't have them.

Reviewed By: mdvacca

Differential Revision: D30114177

fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60
  • Loading branch information
motiz88 authored and facebook-github-bot committed Aug 5, 2021
1 parent 7ce0f40 commit b385484
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ReactAndroid/src/androidTest/js/BUCK
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@fbsource//tools/build_defs:js_glob.bzl", "js_glob")
load("@fbsource//tools/build_defs/oss:metro_defs.bzl", "rn_library")
load("//tools/build_defs:js_glob.bzl", "js_glob")
load("//tools/build_defs/oss:metro_defs.bzl", "rn_library")

# This file was generated by running
# js1 build buckfiles
Expand Down
5 changes: 5 additions & 0 deletions tools/build_defs/apple/config_utils_defs.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

STATIC_LIBRARY_APPLETVOS_CONFIG = {}

def fbobjc_configs(
Expand Down
5 changes: 5 additions & 0 deletions tools/build_defs/apple/fb_apple_asset_catalog.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def fb_apple_asset_catalog(sdks, **kwargs):
pass
5 changes: 5 additions & 0 deletions tools/build_defs/apple/fb_apple_bundle.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def fb_apple_bundle(name, sdk = None, **kwargs):
pass
5 changes: 5 additions & 0 deletions tools/build_defs/apple/fb_apple_test.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def fb_apple_test(**kwargs):
pass
5 changes: 5 additions & 0 deletions tools/build_defs/apple/fb_js_dep.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def rn_js_bundle_dep(bundle):
return bundle
5 changes: 5 additions & 0 deletions tools/build_defs/apple/flag_defs.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def get_base_appletvos_flags():
return []

Expand Down
2 changes: 0 additions & 2 deletions tools/build_defs/apple/plugin_defs.bzl

This file was deleted.

7 changes: 7 additions & 0 deletions tools/build_defs/apple/plugins/plugin_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def plugin(socket, **kwargs):
return None
5 changes: 5 additions & 0 deletions tools/build_defs/fb_xplat_platform_specific_rule.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def fb_xplat_platform_specific_rule(
name,
platform,
Expand Down
5 changes: 5 additions & 0 deletions tools/build_defs/fb_xplat_resource.bzl
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

def fb_xplat_resource(apple_sdks = None, platforms = None, **kwargs):
pass
40 changes: 40 additions & 0 deletions tools/build_defs/js_glob.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

"""Special globbing for js libraries, including and excluding certain files"""

js_glob_exts = (
"gif",
"html",
"jpeg",
"jpg",
"js",
"js.flow",
"json",
"mp4",
"png",
)

def js_glob(dirs, excludes = []):
globs = []
for glob_dir in dirs:
if glob_dir == ".":
globs.extend(["*.%s" % (ext) for ext in js_glob_exts])
elif glob_dir == "**/*":
globs.extend(["**/*.%s" % (ext) for ext in js_glob_exts])
else:
globs.extend(
["%s/**/*.%s" % (glob_dir, ext) for ext in js_glob_exts],
)
return native.glob(
globs,
exclude = [
"**/__tests__/**",
"**/__mocks__/**",
"**/__MOCKS__/**",
"**/__flowtests__/**",
"**/*.xcodeproj/**",
] + (excludes or []),
)
5 changes: 5 additions & 0 deletions tools/build_defs/oss/metro_defs.bzl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# metro-buck integration
def rn_library(**kwargs):
# Noop for now
Expand Down
3 changes: 2 additions & 1 deletion tools/build_defs/oss/rn_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def fb_apple_library(*args, **kwargs):
_ = kwargs.pop("inherited_buck_flags", [])
_ = kwargs.pop("plugins", [])
_ = kwargs.pop("complete_nullability", False)
_ = kwargs.pop("plugins_header", "")

native.apple_library(*args, **kwargs)

Expand All @@ -355,7 +356,7 @@ def fb_xplat_cxx_test(**_kwargs):
pass

# iOS Plugin support.
def react_module_plugin_providers():
def react_module_plugin_providers(*args, **kwargs):
# Noop for now
return []

Expand Down

0 comments on commit b385484

Please sign in to comment.