-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstallAPI] Add --extra* and --exclude* cli options for header input (…
…#86522) InstallAPI takes a json list of headers that is typically generated from a build system like Xcode based on a project's attributes. Sometimes, maintainers may want to alter this for tapi input. Using e.g. `--extra-public-headers`, users can manipulate what headers will be used for TBD file generation.
- Loading branch information
1 parent
3e3f0c3
commit 2d40f17
Showing
23 changed files
with
3,930 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extern int extraGlobalAPI1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extern int extraGlobalAPI2; |
103 changes: 103 additions & 0 deletions
103
clang/test/InstallAPI/Inputs/Simple/Simple.framework/Headers/Basic.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
// Basic class with no super class | ||
@interface Basic1 | ||
@end | ||
|
||
@interface Basic2 : NSObject | ||
@end | ||
|
||
@interface Basic3 : NSObject | ||
@property BOOL property1; | ||
@property(readonly) BOOL property2; | ||
@property(getter=isProperty3) BOOL property3; | ||
@property BOOL dynamicProp; | ||
@end | ||
|
||
@interface Basic4 : NSObject { | ||
@public | ||
BOOL ivar1; | ||
@protected | ||
BOOL ivar2; | ||
@package | ||
BOOL ivar3; | ||
@private | ||
BOOL ivar4; | ||
} | ||
@end | ||
|
||
__attribute__((visibility("hidden"))) @interface Basic4_1 : NSObject { | ||
@public | ||
BOOL ivar1; | ||
@protected | ||
BOOL ivar2; | ||
@package | ||
BOOL ivar3; | ||
@private | ||
BOOL ivar4; | ||
} | ||
@end | ||
|
||
@interface Basic4_2 : NSObject { | ||
@private | ||
BOOL ivar4; | ||
@package | ||
BOOL ivar3; | ||
@protected | ||
BOOL ivar2; | ||
@public | ||
BOOL ivar1; | ||
} | ||
@end | ||
|
||
@interface Basic5 : NSObject | ||
+ (void)aClassMethod; | ||
- (void)anInstanceMethod; | ||
@end | ||
|
||
@interface Basic6 : NSObject | ||
@end | ||
|
||
@interface Basic6 () { | ||
@public | ||
BOOL ivar1; | ||
} | ||
@property BOOL property1; | ||
- (void)anInstanceMethodFromAnExtension; | ||
@end | ||
|
||
@interface Basic6 (Foo) | ||
@property BOOL property2; | ||
- (void)anInstanceMethodFromACategory; | ||
@end | ||
|
||
__attribute__((visibility("hidden"))) | ||
@interface Basic7 : NSObject | ||
@end | ||
|
||
@interface Basic7 () | ||
- (void) anInstanceMethodFromAnHiddenExtension; | ||
@end | ||
|
||
@interface Basic8 : NSObject | ||
+ (void)useSameName; | ||
@end | ||
|
||
// Classes and protocols can have the same name. For now they would only clash | ||
// in the selector map if the protocl starts with '_'. | ||
@protocol _A | ||
- (void)aMethod; | ||
@end | ||
|
||
@interface A : NSObject | ||
- (void)aMethod NS_AVAILABLE(10_11, 9_0); | ||
- (void)bMethod NS_UNAVAILABLE; | ||
@end | ||
|
||
@interface Basic9 : NSObject | ||
@property(readonly) BOOL aProperty NS_AVAILABLE(10_10, 8_0); | ||
@end | ||
|
||
@interface Basic9 (deprecated) | ||
@property(readwrite) BOOL aProperty NS_DEPRECATED_MAC(10_8, 10_10); | ||
@end |
19 changes: 19 additions & 0 deletions
19
clang/test/InstallAPI/Inputs/Simple/Simple.framework/Headers/External.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
// Sub-class an external defined ObjC Class. | ||
@interface ExternalManagedObject : NSManagedObject | ||
- (void)foo; | ||
@end | ||
|
||
// Add category to external defined ObjC Class. | ||
@interface NSManagedObject (Simple) | ||
- (int)supportsSimple; | ||
@end | ||
|
||
// CoreData Accessors are dynamically generated and have no implementation. | ||
@interface ExternalManagedObject (CoreDataGeneratedAccessors) | ||
- (void)addChildObject:(ExternalManagedObject *)value; | ||
- (void)removeChildObject:(ExternalManagedObject *)value; | ||
- (void)addChild:(NSSet *)values; | ||
- (void)removeChild:(NSSet *)values; | ||
@end |
45 changes: 45 additions & 0 deletions
45
clang/test/InstallAPI/Inputs/Simple/Simple.framework/Headers/Simple.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#import <Foundation/Foundation.h> | ||
|
||
// Useless forward declaration. This is used for testing. | ||
@class FooBar; | ||
@protocol FooProtocol; | ||
|
||
@protocol ForwardProcotol; | ||
|
||
// Test public global. | ||
extern int publicGlobalVariable; | ||
|
||
// Test weak public global. | ||
extern int weakPublicGlobalVariable __attribute__((weak)); | ||
|
||
// Test public ObjC class | ||
@interface Simple : NSObject | ||
@end | ||
|
||
__attribute__((objc_exception)) | ||
@interface Base : NSObject | ||
@end | ||
|
||
@interface SubClass : Base | ||
@end | ||
|
||
@protocol BaseProtocol | ||
- (void) baseMethod; | ||
@end | ||
|
||
NS_AVAILABLE(10_11, 9_0) | ||
@protocol FooProtocol <BaseProtocol> | ||
- (void) protocolMethod; | ||
@end | ||
|
||
@protocol BarProtocol | ||
- (void) barMethod; | ||
@end | ||
|
||
@interface FooClass <FooProtocol, BarProtocol> | ||
@end | ||
|
||
// Create an empty category conforms to a forward declared protocol. | ||
// <rdar://problem/35605892> | ||
@interface FooClass (Test) <ForwardProcotol> | ||
@end |
1 change: 1 addition & 0 deletions
1
clang/test/InstallAPI/Inputs/Simple/Simple.framework/Headers/SimpleAPI.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extern int otherFrameworkAPI; |
5 changes: 5 additions & 0 deletions
5
clang/test/InstallAPI/Inputs/Simple/Simple.framework/PrivateHeaders/SimplePrivate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Test private global variable. | ||
extern int privateGlobalVariable; | ||
|
||
// Test weak private global. | ||
extern int weakPrivateGlobalVariable __attribute__((weak)); |
2 changes: 2 additions & 0 deletions
2
clang/test/InstallAPI/Inputs/Simple/Simple.framework/PrivateHeaders/SimplePrivateSPI.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Test private global variable. | ||
extern int otherFrameworkSPI; |
Oops, something went wrong.