Skip to content

Commit cbb1715

Browse files
committed
Prefer forward declarations for WordPressData types in ObjC headers
Just trying to understand why Keystone fails to build for testing. Using forward declarations keeps the headers and the compilation leaner.
1 parent acb8b33 commit cbb1715

14 files changed

+20
-61
lines changed

WordPress/Classes/Services/AccountService.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
#import <Foundation/Foundation.h>
22
#import <CoreData/CoreData.h>
3-
// For some reason, and only in some files, the modular import does not work.
4-
// Just to be on the safe side, _all_ imports use the angle brackets style.
5-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
6-
// @import WordPressData;
7-
#import <WordPressData/WordPressData.h>
83

94
NS_ASSUME_NONNULL_BEGIN
105

116
@class WPAccount;
127
@class RemoteUser;
8+
@protocol CoreDataStack;
139

1410
extern NSNotificationName const WPAccountEmailAndDefaultBlogUpdatedNotification;
1511

WordPress/Classes/Services/BlogService.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
#import <Foundation/Foundation.h>
2-
// For some reason, and only in some files, the modular import does not work.
3-
// Just to be on the safe side, _all_ imports use the angle brackets style.
4-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
5-
// @import WordPressData;
6-
#import <WordPressData/WordPressData.h>
72

83
NS_ASSUME_NONNULL_BEGIN
94

105
extern NSString *const WordPressMinimumVersion;
116
extern NSString *const WPBlogUpdatedNotification;
127
extern NSString *const WPBlogSettingsUpdatedNotification;
138

9+
@class Blog;
1410
@class WPAccount;
1511
@class SiteInfo;
12+
@protocol CoreDataStack;
1613

1714
@interface BlogService : NSObject
1815

WordPress/Classes/Services/CommentService.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#import <Foundation/Foundation.h>
22
#import <WordPressKit/WordPressKit.h>
3-
// For some reason, and only in some files, the modular import does not work.
4-
// Just to be on the safe side, _all_ imports use the angle brackets style.
5-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
6-
// @import WordPressData;
7-
#import <WordPressData/WordPressData.h>
83

94
NS_ASSUME_NONNULL_BEGIN
105

@@ -16,6 +11,7 @@ extern NSUInteger const WPTopLevelHierarchicalCommentsPerPage;
1611
@class BasePost;
1712
@class RemoteUser;
1813
@class CommentServiceRemoteFactory;
14+
@protocol CoreDataStack;
1915

2016
@interface CommentService : NSObject
2117

WordPress/Classes/Services/MediaService.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
@class Media;
1010
@class RemoteVideoPressVideo;
11-
@class Blog;
12-
@class AbstractPost;
1311
@protocol ExportableAsset;
1412

1513
extern NSErrorDomain _Nonnull const MediaServiceErrorDomain;

WordPress/Classes/Services/MenusService.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
NS_ASSUME_NONNULL_BEGIN
99

10-
@class Blog;
11-
@class Menu;
12-
@class MenuLocation;
13-
@class MenuItem;
14-
1510
typedef void(^MenusServiceSuccessBlock)(void);
1611
typedef void(^MenusServiceCreateOrUpdateMenuRequestSuccessBlock)(void);
1712
typedef void(^MenusServiceMenusRequestSuccessBlock)(NSArray<Menu *> * _Nullable menus);

WordPress/Classes/Services/PostCategoryService.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
@import CoreData;
12
#import <Foundation/Foundation.h>
2-
// For some reason, and only in some files, the modular import does not work.
3-
// Just to be on the safe side, _all_ imports use the angle brackets style.
4-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
5-
// @import WordPressData;
6-
#import <WordPressData/WordPressData.h>
73

84
NS_ASSUME_NONNULL_BEGIN
95

106
@class Blog;
117
@class PostCategory;
8+
@protocol CoreDataStack;
129

1310
typedef NS_ENUM(NSInteger, PostCategoryServiceErrors) {
1411
PostCategoryServiceErrorsBlogNotFound

WordPress/Classes/Services/PostTagService.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
NS_ASSUME_NONNULL_BEGIN
88

9-
@class Blog;
10-
@class PostTag;
11-
129
@interface PostTagService : LocalCoreDataService
1310

1411
/**

WordPress/Classes/Services/Reader Post/ReaderPostService.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1+
@import CoreData;
12
#import <Foundation/Foundation.h>
2-
// For some reason, and only in some files, the modular import does not work.
3-
// Just to be on the safe side, _all_ imports use the angle brackets style.
4-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
5-
// @import WordPressData;
6-
#import <WordPressData/WordPressData.h>
73

84
#pragma clang diagnostic push
95
#pragma clang diagnostic ignored "-Wnullability-completeness"
106

117
@class ReaderPost;
128
@class ReaderAbstractTopic;
139
@class WordPressComRestApi;
10+
@protocol CoreDataStack;
1411

1512
extern NSString * const ReaderPostServiceErrorDomain;
1613
extern NSString * const ReaderPostServiceToggleSiteFollowingState;

WordPress/Classes/Services/ReaderSiteService.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#import <Foundation/Foundation.h>
2-
// For some reason, and only in some files, the modular import does not work.
3-
// Just to be on the safe side, _all_ imports use the angle brackets style.
4-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
5-
// @import WordPressData;
6-
#import <WordPressData/WordPressData.h>
2+
3+
@protocol CoreDataStack;
74

85
NS_ASSUME_NONNULL_BEGIN
96

WordPress/Classes/Services/ReaderTopicService.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1+
@import CoreData;
12
#import <Foundation/Foundation.h>
2-
// For some reason, and only in some files, the modular import does not work.
3-
// Just to be on the safe side, _all_ imports use the angle brackets style.
4-
// We shall try to go back to the modular style on Keystone successfully builds for testing.
5-
// @import WordPressData;
6-
#import <WordPressData/WordPressData.h>
73

84
NS_ASSUME_NONNULL_BEGIN
95

@@ -13,6 +9,7 @@ extern NSString * const ReaderTopicFreshlyPressedPathCommponent;
139
@class ReaderTagTopic;
1410
@class ReaderSiteTopic;
1511
@class ReaderSearchTopic;
12+
@protocol CoreDataStack;
1613

1714
@interface ReaderTopicService : NSObject
1815

0 commit comments

Comments
 (0)