Skip to content

Commit

Permalink
xplat/js/react-native-github: Starlark compat
Browse files Browse the repository at this point in the history
Summary:
There's no `set` in Starlark.

Changelog: [Internal]

Reviewed By: aniketmathur

Differential Revision: D26665530

fbshipit-source-id: 1e67571b6a02601997d3f11a9d9c6776b8e1ff3b
  • Loading branch information
stepancheg authored and facebook-github-bot committed Feb 25, 2021
1 parent f8261bb commit 7b814b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/build_defs/oss/rn_defs.bzl
Expand Up @@ -126,6 +126,9 @@ def react_native_xplat_dep(path):
def rn_extra_build_flags():
return []

def _unique(li):
return list({x: () for x in li})

# React property preprocessor
def rn_android_library(name, deps = [], plugins = [], *args, **kwargs):
_ = kwargs.pop("autoglob", False)
Expand All @@ -139,7 +142,7 @@ def rn_android_library(name, deps = [], plugins = [], *args, **kwargs):
),
]

plugins = list(set(plugins + react_property_plugins))
plugins = _unique(plugins + react_property_plugins)

if react_native_target(
"java/com/facebook/react/module/annotations:annotations",
Expand All @@ -150,7 +153,7 @@ def rn_android_library(name, deps = [], plugins = [], *args, **kwargs):
),
]

plugins = list(set(plugins + react_module_plugins))
plugins = _unique(plugins + react_module_plugins)

native.android_library(name = name, deps = deps, plugins = plugins, *args, **kwargs)

Expand Down

0 comments on commit 7b814b4

Please sign in to comment.