Skip to content

Commit b809776

Browse files
coadofacebook-github-bot
authored andcommitted
Set more predefined macros in the doxygen config. (facebook#55900)
Summary: Doxygen incorrectly parses macros like `NS_DESIGNATED_INITIALIZER`, `RCT_EXTERN`, `RCT_DEPRECATED`, `RCT_EXTERN_MODULE`, `API_AVAILABLE`. Setting them them as predefined empty string solves the issue. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D94534964
1 parent 5707804 commit b809776

File tree

5 files changed

+92
-3
lines changed

5 files changed

+92
-3
lines changed

packages/react-native/.doxygen.config.template

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2443,7 +2443,21 @@ INCLUDE_FILE_PATTERNS =
24432443
# recursively expanded use the := operator instead of the = operator.
24442444
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
24452445

2446-
PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" __deprecated_msg(x)="" ${PREDEFINED}
2446+
PREDEFINED = FOLLY_PACK_PUSH="" \
2447+
FOLLY_PACK_POP="" \
2448+
FOLLY_PACK_ATTR="" \
2449+
__attribute__(x)="" \
2450+
__deprecated_msg(x)="" \
2451+
NS_REQUIRES_SUPER="" \
2452+
NS_UNAVAILABLE="" \
2453+
CF_RETURNS_NOT_RETAINED="" \
2454+
NS_DESIGNATED_INITIALIZER="" \
2455+
NS_DESIGNATED_INITIALIZER="" \
2456+
RCT_EXTERN="" \
2457+
RCT_DEPRECATED="" \
2458+
RCT_EXTERN_MODULE="" \
2459+
API_AVAILABLE(x)="" \
2460+
${PREDEFINED}
24472461

24482462
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
24492463
# tag can be used to specify a list of macro names that should be expanded. The

scripts/cxx-api/manual_test/.doxygen.config.template

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,20 @@ INCLUDE_FILE_PATTERNS =
24422442
# recursively expanded use the := operator instead of the = operator.
24432443
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
24442444

2445-
PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" __deprecated_msg(x)="" ${PREDEFINED}
2445+
PREDEFINED = FOLLY_PACK_PUSH="" \
2446+
FOLLY_PACK_POP="" \
2447+
FOLLY_PACK_ATTR="" \
2448+
__attribute__(x)="" \
2449+
__deprecated_msg(x)="" \
2450+
NS_REQUIRES_SUPER="" \
2451+
NS_UNAVAILABLE="" \
2452+
CF_RETURNS_NOT_RETAINED="" \
2453+
NS_DESIGNATED_INITIALIZER="" \
2454+
RCT_EXTERN="" \
2455+
RCT_DEPRECATED="" \
2456+
RCT_EXTERN_MODULE="" \
2457+
API_AVAILABLE(x)="" \
2458+
${PREDEFINED}
24462459

24472460
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
24482461
# tag can be used to specify a list of macro names that should be expanded. The

scripts/cxx-api/tests/snapshots/.doxygen.config.template

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,19 @@ INCLUDE_FILE_PATTERNS =
24422442
# recursively expanded use the := operator instead of the = operator.
24432443
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
24442444

2445-
PREDEFINED = FOLLY_PACK_PUSH="" FOLLY_PACK_POP="" FOLLY_PACK_ATTR="" __attribute__(x)="" __deprecated_msg(x)=""
2445+
PREDEFINED = FOLLY_PACK_PUSH="" \
2446+
FOLLY_PACK_POP="" \
2447+
FOLLY_PACK_ATTR="" \
2448+
__attribute__(x)="" \
2449+
__deprecated_msg(x)="" \
2450+
NS_REQUIRES_SUPER="" \
2451+
NS_UNAVAILABLE="" \
2452+
CF_RETURNS_NOT_RETAINED="" \
2453+
NS_DESIGNATED_INITIALIZER="" \
2454+
RCT_EXTERN="" \
2455+
RCT_DEPRECATED="" \
2456+
RCT_EXTERN_MODULE="" \
2457+
API_AVAILABLE(x)=""
24462458

24472459
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
24482460
# tag can be used to specify a list of macro names that should be expanded. The
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
interface RCTTestMacros {
2+
public @property (strong, readonly) dispatch_queue_t methodQueue;
3+
public @property (weak, readonly) id bridge;
4+
public virtual instancetype initWithDelegate:options:(id delegate, NSDictionary * options);
5+
public virtual instancetype initWithName:(NSString * name);
6+
public virtual static UIUserInterfaceStyle userInterfaceStyle();
7+
public virtual void deprecatedMethod();
8+
}
9+
10+
protocol RCTTestProtocol {
11+
public @property (assign, readonly) NSString * name;
12+
public virtual void normalMethod();
13+
public virtual void requiredMethod();
14+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
@interface RCTTestMacros
9+
10+
- (instancetype)initWithName:(NSString *)name NS_DESIGNATED_INITIALIZER;
11+
12+
- (instancetype)initWithDelegate:(id)delegate options:(NSDictionary *)options NS_DESIGNATED_INITIALIZER;
13+
14+
@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue RCT_DEPRECATED;
15+
16+
@property (nonatomic, weak, readonly) id bridge RCT_DEPRECATED;
17+
18+
- (void)deprecatedMethod RCT_DEPRECATED;
19+
20+
+ (UIUserInterfaceStyle)userInterfaceStyle API_AVAILABLE(ios(12));
21+
22+
@end
23+
24+
RCT_EXTERN void RCTExternFunction(const char *input, NSString **output);
25+
26+
RCT_EXTERN NSString *RCTParseType(const char **input);
27+
28+
@protocol RCTTestProtocol
29+
30+
- (void)normalMethod;
31+
32+
- (void)requiredMethod NS_DESIGNATED_INITIALIZER;
33+
34+
@property (nonatomic, readonly) NSString *name RCT_DEPRECATED;
35+
36+
@end

0 commit comments

Comments
 (0)