Enable Kotlin build in OSS (#33160)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33160

Enables Kotlin build in RNAndroid, while adjusting the package structure to help with path/package inconsistency.

Moves `react/uimanager/interfaces` files into `react/uimanager` to make sure package name matches with file location and updates Buck configuration to still include it as a separate target.

Changelog: [Android][Changed] - Moved `com/react/facebook/uimanager/interfaces` files into `com/react/facebook/uimanager` to enable Kotlin build

Reviewed By: cortinico

Differential Revision: D34381179

fbshipit-source-id: 252588d9c7f62b8019bdfcce66197628d63e63a1
This commit is contained in:
Andrei Shikov
2022-02-22 10:22:52 -08:00
committed by Facebook GitHub Bot
parent 733f228506
commit b1a779392d
10 changed files with 33 additions and 24 deletions
@@ -1,5 +1,34 @@
load("//tools/build_defs/oss:rn_defs.bzl", "YOGA_TARGET", "react_native_dep", "react_native_target", "rn_android_library")
INTERFACES_FILES = [
"BaseViewManagerDelegate.java",
"BaseViewManagerInterface.java",
"ViewManagerDelegate.java",
"ViewProps.java",
"Spacing.java",
"FloatUtil.java",
]
rn_android_library(
name = "interfaces",
srcs = glob(INTERFACES_FILES),
autoglob = False,
is_androidx = True,
labels = ["supermodule:xplat/default/public.react_native.infra"],
provided_deps = [
react_native_dep("third-party/android/androidx:annotation"),
],
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
deps = [
YOGA_TARGET,
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react/bridge:bridge"),
],
)
rn_android_library(
name = "uimanager",
srcs = glob(
@@ -11,7 +40,7 @@ rn_android_library(
],
exclude = [
"DisplayMetricsHolder.java",
],
] + INTERFACES_FILES,
),
autoglob = False,
exported_provided_deps = [
@@ -53,9 +82,9 @@ rn_android_library(
],
exported_deps = [
":DisplayMetrics",
":interfaces",
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react/uimanager/common:common"),
react_native_target("java/com/facebook/react/uimanager/interfaces:interfaces"),
],
)
@@ -1,21 +0,0 @@
load("//tools/build_defs/oss:rn_defs.bzl", "YOGA_TARGET", "react_native_dep", "react_native_target", "rn_android_library")
rn_android_library(
name = "interfaces",
srcs = glob(["*.java"]),
autoglob = False,
is_androidx = True,
labels = ["supermodule:xplat/default/public.react_native.infra"],
provided_deps = [
react_native_dep("third-party/android/androidx:annotation"),
],
required_for_source_only_abi = True,
visibility = [
"PUBLIC",
],
deps = [
YOGA_TARGET,
react_native_dep("third-party/java/jsr-305:jsr-305"),
react_native_target("java/com/facebook/react/bridge:bridge"),
],
)