Files
react-native/Libraries/BUCK
T
Ramanpreet NaraandFacebook GitHub Bot 4c734d1e8d Support custom android_package_name in module codegen
Summary:
## Changes
All `rn_library(codegen_modules = True)` must now also specify native_module_android_package_name, like so:

```
rn_library(
  name = "FBAuth"
  codegen_modules = True,
  native_module_spec_name = "Foo",
  native_module_android_package_name = "com.facebook.fbreact.specs",
)
```

This will generate the FBAuth Java spec files under the appropriate directory: "com/facebook/fbreact/specs". It will also make the code-generated specs have the appropriate package name: "com.facebook.fbreact.specs".

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25723176

fbshipit-source-id: 6efec1cbee43d70110c0ef23e2422e08609b61d4
2020-12-29 13:04:36 -08:00

45 lines
1.3 KiB
Python

# 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.
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load(
"//tools/build_defs/oss:rn_codegen_defs.bzl",
"rn_codegen_components",
"rn_codegen_modules",
)
load(
"//tools/build_defs/oss:rn_defs.bzl",
"react_native_root_target",
)
fb_native.genrule(
name = "react_native_codegen_schema",
srcs = glob(
[
"**/*.js",
],
exclude = [
"**/__tests__/**/*",
],
),
cmd = "$(exe {}) $OUT $SRCS".format(react_native_root_target("packages/react-native-codegen:write_to_json")),
out = "schema.json",
labels = ["codegen_rule"],
)
rn_codegen_modules(
name = "FBReactNativeSpec",
android_package_name = "com.facebook.fbreact.specs",
library_labels = ["supermodule:xplat/default/public.react_native.infra"],
native_module_spec_name = "FBReactNativeSpec",
schema_target = ":react_native_codegen_schema",
)
rn_codegen_components(
name = "FBReactNativeComponentSpec",
library_labels = ["supermodule:xplat/default/public.react_native.infra"],
schema_target = ":react_native_codegen_schema",
)