Skip to content

Commit

Permalink
Enable Kotlin build in OSS (#33160)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
Andrei Shikov authored and facebook-github-bot committed Feb 22, 2022
1 parent 733f228 commit b1a7793
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 24 deletions.
1 change: 1 addition & 0 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
plugins {
id("com.android.library")
id("com.facebook.react")
id("org.jetbrains.kotlin.android")
id("maven-publish")
id("de.undercouch.download")
}
Expand Down
33 changes: 31 additions & 2 deletions ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -11,7 +40,7 @@ rn_android_library(
],
exclude = [
"DisplayMetricsHolder.java",
],
] + INTERFACES_FILES,
),
autoglob = False,
exported_provided_deps = [
Expand Down Expand Up @@ -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"),
],
)

Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react-native-codegen/DEFS.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def rn_codegen_components(
deps = [
react_native_dep("third-party/android/androidx:annotation"),
react_native_target("java/com/facebook/react/bridge:bridge"),
react_native_target("java/com/facebook/react/uimanager/interfaces:interfaces"),
react_native_target("java/com/facebook/react/uimanager:interfaces"),
],
)

Expand Down

0 comments on commit b1a7793

Please sign in to comment.