Skip to content

Commit 737b784

Browse files
fkgozalifacebook-github-bot
authored andcommitted
TM iOS: removed CoreModulesAppleHeader BUCK workaround
Summary: We should be able to just use `header_path_prefix` and normal `glob(["**/*.h"])` patterns, and that should be compatible with the build system. This also allows `RCTPlatform.mm` to import `"RCTPlatform.h"` directly without any namespace. Reviewed By: RSNara Differential Revision: D16096779 fbshipit-source-id: b17b79baf958f1e9a63085a928b64663cb29bbbb
1 parent c92cc11 commit 737b784

File tree

2 files changed

+5
-51
lines changed

2 files changed

+5
-51
lines changed

React/CoreModules/BUCK

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "OBJC_ARC_PREPROCESSOR_FLAGS", "get_debug_preprocessor_flags", "get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED")
2-
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_apple_library", "rn_debug_flags", "subdir_glob")
2+
load("@fbsource//tools/build_defs/oss:rn_defs.bzl", "rn_apple_library", "rn_debug_flags")
33
load(
44
"@fbsource//xplat/configurations/buck/apple/plugins/sad_xplat_hosted_configurations:react_module_registration.bzl",
55
"react_module_plugin_providers",
@@ -13,7 +13,7 @@ rn_apple_library(
1313
"**/*.mm",
1414
],
1515
),
16-
headers = ["CoreModulesPlugins.h"],
16+
exported_headers = glob(["**/*.h"]),
1717
compiler_flags = [
1818
"-Wno-error=unguarded-availability-new",
1919
"-Wno-unknown-warning-option",
@@ -30,6 +30,7 @@ rn_apple_library(
3030
"Foundation",
3131
"UIKit",
3232
],
33+
header_path_prefix = "React",
3334
lang_compiler_flags = get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED(),
3435
link_whole = True,
3536
platform_preprocessor_flags = [(
@@ -47,53 +48,5 @@ rn_apple_library(
4748
exported_deps = [
4849
"fbsource//xplat/js/react-native-github:ReactInternalApple",
4950
"fbsource//xplat/js/react-native-github/Libraries/FBReactNativeSpec:FBReactNativeSpecApple",
50-
":CoreModulesAppleHeader",
51-
],
52-
)
53-
54-
# Workaround: define exported headers target separately so that the header
55-
# namespace can be specified correctly.
56-
rn_apple_library(
57-
name = "CoreModulesAppleHeader",
58-
srcs = [],
59-
header_namespace = "",
60-
exported_headers = subdir_glob(
61-
[
62-
(
63-
"",
64-
"*.h",
65-
),
66-
],
67-
exclude = ["CoreModulesPlugins.h"],
68-
prefix = "React",
69-
),
70-
compiler_flags = [
71-
"-Wno-error=unguarded-availability-new",
72-
"-Wno-unknown-warning-option",
73-
],
74-
contacts = ["oncall+react_native@xmail.facebook.com"],
75-
exported_linker_flags = [
76-
"-weak_framework",
77-
"UserNotifications",
78-
"-weak_framework",
79-
"WebKit",
80-
],
81-
exported_preprocessor_flags = rn_debug_flags(),
82-
frameworks = [
83-
"Foundation",
84-
"UIKit",
85-
],
86-
lang_compiler_flags = get_fbobjc_enable_exception_lang_compiler_flags_DEPRECATED(),
87-
link_whole = True,
88-
platform_preprocessor_flags = [(
89-
"linux",
90-
["-D PIC_MODIFIER=@PLT"],
91-
)],
92-
preprocessor_flags = OBJC_ARC_PREPROCESSOR_FLAGS + get_debug_preprocessor_flags() + rn_debug_flags() + [
93-
"-DRN_DISABLE_OSS_PLUGIN_HEADER",
94-
],
95-
visibility = ["PUBLIC"],
96-
exported_deps = [
97-
"fbsource//xplat/js/react-native-github:ReactInternalApple",
9851
],
9952
)

React/CoreModules/RCTPlatform.mm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
#import "RCTPlatform.h"
9+
810
#import <UIKit/UIKit.h>
911

1012
#import <FBReactNativeSpec/FBReactNativeSpec.h>
11-
#import <React/RCTPlatform.h>
1213
#import <React/RCTUtils.h>
1314
#import <React/RCTVersion.h>
1415

0 commit comments

Comments
 (0)