Skip to content

Commit 651c4c1

Browse files
Andrei Shikovfacebook-github-bot
authored andcommitted
Add kotlin stdlib as a dependency for Java targets depending on Kotlin (#33535)
Summary: Pull Request resolved: #33535 Hack to support Kotlin functions in Buck compilation: adds Kotlin stdlib as a dependency to make sure upstream targets include Kotlin jvm internal classes. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D35284430 fbshipit-source-id: 0d29ad30386514c8df5376d0a6809d3105f0cd0f
1 parent 8650220 commit 651c4c1

File tree

3 files changed

+11
-7
lines changed
  • ReactAndroid/src/main/java/com/facebook/react

3 files changed

+11
-7
lines changed

ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ rn_android_library(
2727
react_native_dep("third-party/android/androidx:annotation"),
2828
react_native_dep("third-party/java/infer-annotations:infer-annotations"),
2929
react_native_target("java/com/facebook/react/common:common"),
30+
react_native_dep("third-party/java/jsr-305:jsr-305"),
3031
# dependencies used for systraces
3132
react_native_dep("java/com/facebook/systrace:systrace"),
3233
react_native_target("java/com/facebook/react/bridge:bridge"),
3334
],
34-
exported_deps = [],
3535
)

ReactAndroid/src/main/java/com/facebook/react/fabric/BUCK

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
load("//tools/build_defs/oss:rn_defs.bzl", "YOGA_TARGET", "react_native_dep", "react_native_target", "rn_android_library")
1+
load("//tools/build_defs/oss:rn_defs.bzl", "IS_OSS_BUILD", "YOGA_TARGET", "react_native_android_toplevel_dep", "react_native_dep", "react_native_target", "rn_android_library")
2+
3+
# TODO(T115916830): Remove when Kotlin files are used in this module
4+
KOTLIN_STDLIB_DEPS = [react_native_android_toplevel_dep("third-party/kotlin:kotlin-stdlib")] if IS_OSS_BUILD else []
25

36
rn_android_library(
47
name = "fabric",
@@ -47,7 +50,5 @@ rn_android_library(
4750
react_native_target("java/com/facebook/react/views/view:view"),
4851
react_native_target("java/com/facebook/react/views/text:text"),
4952
react_native_target("java/com/facebook/react/touch:touch"),
50-
],
51-
exported_deps = [
52-
],
53+
] + KOTLIN_STDLIB_DEPS,
5354
)

ReactAndroid/src/main/java/com/facebook/react/views/text/BUCK

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
load("//tools/build_defs/oss:rn_defs.bzl", "YOGA_TARGET", "react_native_dep", "react_native_target", "rn_android_library")
1+
load("//tools/build_defs/oss:rn_defs.bzl", "IS_OSS_BUILD", "YOGA_TARGET", "react_native_android_toplevel_dep", "react_native_dep", "react_native_target", "rn_android_library")
2+
3+
# TODO(T115916830): Remove when Kotlin files are used in this module
4+
KOTLIN_STDLIB_DEPS = [react_native_android_toplevel_dep("third-party/kotlin:kotlin-stdlib")] if IS_OSS_BUILD else []
25

36
rn_android_library(
47
name = "text",
@@ -35,5 +38,5 @@ rn_android_library(
3538
react_native_target("java/com/facebook/react/uimanager/annotations:annotations"),
3639
react_native_target("java/com/facebook/react/views/view:view"),
3740
react_native_target("res:uimanager"),
38-
],
41+
] + KOTLIN_STDLIB_DEPS,
3942
)

0 commit comments

Comments
 (0)