Skip to content

Commit

Permalink
Move WordPressComRESTAPIInterfacing.h to WordPressKit folder
Browse files Browse the repository at this point in the history
The SPM-compatible folder structure was giving me trouble when trying to
validate the `podspec`.

At first, I thought it was simply because
`WordPressComRESTAPIInterfacing.h` was not in a path known to CocoaPods.
But even after updating the `podspec` to:

```diff
@@ -18,9 +18,10 @@ Pod::Spec.new do |s|
   s.swift_version = '5.0'

   s.source        = { git: 'https://github.com/wordpress-mobile/WordPressKit-iOS.git', tag: s.version.to_s }
-  s.source_files  = 'WordPressKit/**/*.{h,m,swift}'
+
+  s.source_files  = 'WordPressKit/**/*.{h,m,swift}', 'Sources/**/*.{h,m,swift}'
+  s.public_header_files = 'Sources/**/include/*.h', 'WordPressKit/**/.h', 'WordPressKit/WordPressKit.h'
   s.private_header_files = 'WordPressKit/Private/*.h'
-  s.header_dir = 'WordPressKit'

   s.dependency 'NSObject-SafeExpectations', '~> 0.0.4'
   s.dependency 'wpxmlrpc', '~> 0.10'
```

I still got errors:

```
- ERROR | xcodebuild:  /var/folders/dq/cdqxvx3s5ps75564rpmb_dc00000gn/T/CocoaPods-Lint-20240321-63072-nntpgw-WordPressKit/DerivedData/App/Build/Products/Release-iphonesimulator/WordPressKit/WordPressKit.framework/Headers/WordPressKit.h:10:9: error: 'WordPressKit/ServiceRemoteWordPressComREST.h' file not found
```

In the proof of concept from
#738, the SPM
folder structure is compatible with CocoaPods. As such, I decided to
defer moving the files to when I can do it in one go.
  • Loading branch information
mokagio committed Mar 21, 2024
1 parent dafe452 commit 779ec14
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions WordPressKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1552,30 +1552,6 @@
path = Plans;
sourceTree = "<group>";
};
3FFCC0532BABC75F0051D229 /* Sources */ = {
isa = PBXGroup;
children = (
3FFCC0542BABC7680051D229 /* APIInterface */,
);
path = Sources;
sourceTree = "<group>";
};
3FFCC0542BABC7680051D229 /* APIInterface */ = {
isa = PBXGroup;
children = (
3FFCC0562BABC7D20051D229 /* include */,
);
path = APIInterface;
sourceTree = "<group>";
};
3FFCC0562BABC7D20051D229 /* include */ = {
isa = PBXGroup;
children = (
3FFCC0552BABC78B0051D229 /* WordPressComRESTAPIInterfacing.h */,
);
path = include;
sourceTree = "<group>";
};
404057C3221B30140060250C /* Time Interval */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1954,7 +1930,6 @@
9368C7711EC5EF1B0092CE8E = {
isa = PBXGroup;
children = (
3FFCC0532BABC75F0051D229 /* Sources */,
FFE247CD20CB1245002DF3A2 /* LICENSE */,
FFE247CC20CB118A002DF3A2 /* README.md */,
0C3A2A412A2E7BA500FD91D6 /* CHANGELOG.md */,
Expand Down Expand Up @@ -2542,6 +2517,7 @@
93BD27731EE7388E002BB00B /* WordPressAPI */ = {
isa = PBXGroup;
children = (
3FFCC0552BABC78B0051D229 /* WordPressComRESTAPIInterfacing.h */,
4A05E7952B2FCB6400C25E3B /* NonceRetrieval.swift */,
4A05E7992B2FDC3200C25E3B /* WordPressOrgRestApi.swift */,
93BD27741EE73944002BB00B /* HTTPAuthenticationAlertController.swift */,
Expand Down

0 comments on commit 779ec14

Please sign in to comment.