Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f3793d

Browse files
authored
Fix SPM integration issues (#456)
fix(spm): add missing public header fix(spm): change include folder structure fix(npm): remove umbrella header from include
1 parent ae3026d commit 9f3793d

304 files changed

Lines changed: 366 additions & 36 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pubnub.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
22
name: objective-c
33
scm: github.com/pubnub/objective-c
4-
version: "5.4.0"
4+
version: "5.4.1"
55
schema: 1
66
changelog:
7+
- date: 2024-04-30
8+
version: v5.4.1
9+
changes:
10+
- type: bug
11+
text: "Match `include` folder content to the `import` in source code."
712
- date: 2024-04-16
813
version: v5.4.0
914
changes:
@@ -1339,7 +1344,7 @@ sdks:
13391344
- distribution-type: source
13401345
distribution-repository: GitHub release
13411346
package-name: PubNub.framework
1342-
location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.4.0.zip
1347+
location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.4.1.zip
13431348
supported-platforms:
13441349
supported-operating-systems:
13451350
macOS:
@@ -1400,7 +1405,7 @@ sdks:
14001405
- distribution-type: library
14011406
distribution-repository: GitHub release
14021407
package-name: PubNub.ios.xcframework.tar.gz
1403-
location: https://github.com/pubnub/objective-c/releases/download/v5.4.0/PubNub.ios.xcframework.tar.gz
1408+
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.ios.xcframework.tar.gz
14041409
supported-platforms:
14051410
supported-operating-systems:
14061411
iOS:
@@ -1419,7 +1424,7 @@ sdks:
14191424
- distribution-type: library
14201425
distribution-repository: GitHub release
14211426
package-name: PubNub.macos.framework.tar.gz
1422-
location: https://github.com/pubnub/objective-c/releases/download/v5.4.0/PubNub.macos.framework.tar.gz
1427+
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.macos.framework.tar.gz
14231428
supported-platforms:
14241429
supported-operating-systems:
14251430
macOS:
@@ -1435,7 +1440,7 @@ sdks:
14351440
- distribution-type: library
14361441
distribution-repository: GitHub release
14371442
package-name: PubNub.tvos.xcframework.tar.gz
1438-
location: https://github.com/pubnub/objective-c/releases/download/v5.4.0/PubNub.tvos.xcframework.tar.gz
1443+
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.tvos.xcframework.tar.gz
14391444
supported-platforms:
14401445
supported-operating-systems:
14411446
tvOS:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v5.4.1
2+
April 30 2024
3+
4+
#### Fixed
5+
- Match `include` folder content to the `import` in source code.
6+
17
## v5.4.0
28
April 16 2024
39

Framework/PubNub Framework.xcodeproj/project.pbxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,11 @@
18321832
A5105B59238F027D00CB693D /* PNDate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5105B4F238F027D00CB693D /* PNDate.m */; };
18331833
A5105B5A238F027D00CB693D /* PNDate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5105B4F238F027D00CB693D /* PNDate.m */; };
18341834
A5105B5C238F027D00CB693D /* PNDate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5105B4F238F027D00CB693D /* PNDate.m */; };
1835+
A51B49E02BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
1836+
A51B49E12BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
1837+
A51B49E22BDA7807008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
1838+
A51B49E32BDA7808008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
1839+
A51B49E42BDA7809008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
18351840
A523692924A2270200656C19 /* PNAES+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A523692824A2270200656C19 /* PNAES+Private.h */; };
18361841
A523692A24A2270200656C19 /* PNAES+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A523692824A2270200656C19 /* PNAES+Private.h */; };
18371842
A523692B24A2270200656C19 /* PNAES+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A523692824A2270200656C19 /* PNAES+Private.h */; };
@@ -4382,6 +4387,7 @@
43824387
A56865B9230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
43834388
A57A30DA238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
43844389
7951954326BD44E9001E308C /* PubNub+PAM.h in Headers */,
4390+
A51B49E02BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
43854391
7915825C1BD709C60084FC70 /* PNChannelGroupsResult.h in Headers */,
43864392
79E20D151C8AEC3A001BC9CC /* PNEnvelopeInformation.h in Headers */,
43874393
A55CA69D2397389100B24E02 /* PNKeychain+Private.h in Headers */,
@@ -4675,6 +4681,7 @@
46754681
A56865BB230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
46764682
A57A30DC238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
46774683
7951954526BD44E9001E308C /* PubNub+PAM.h in Headers */,
4684+
A51B49E22BDA7807008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
46784685
791583071BD709D10084FC70 /* PNEventsListener.h in Headers */,
46794686
791583051BD709D10084FC70 /* PNChannelGroupsResult.h in Headers */,
46804687
A55CA69F2397389100B24E02 /* PNKeychain+Private.h in Headers */,
@@ -5055,6 +5062,7 @@
50555062
A57A30F6238DDCA300DE8C68 /* PNAPNSNotificationPayload+Private.h in Headers */,
50565063
798842741C18F1FB003E8948 /* PNStatus+Private.h in Headers */,
50575064
798842321C18F0AC003E8948 /* PubNub+Subscribe.h in Headers */,
5065+
A51B49E42BDA7809008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
50585066
A57A30DF238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
50595067
797ABBA624C4148C0008CA1E /* PNBasePublishRequest.h in Headers */,
50605068
7988422C1C18F088003E8948 /* PubNub+Presence.h in Headers */,
@@ -5260,6 +5268,7 @@
52605268
A56865BA230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
52615269
A57A30DB238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
52625270
7951954426BD44E9001E308C /* PubNub+PAM.h in Headers */,
5271+
A51B49E12BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
52635272
79A8BC741C58F93900015BDE /* PNEventsListener.h in Headers */,
52645273
79A8BC721C58F93900015BDE /* PNChannelGroupsResult.h in Headers */,
52655274
A55CA69E2397389100B24E02 /* PNKeychain+Private.h in Headers */,
@@ -5553,6 +5562,7 @@
55535562
A56865BC230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
55545563
A57A30DD238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
55555564
7951954626BD44E9001E308C /* PubNub+PAM.h in Headers */,
5565+
A51B49E32BDA7808008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
55565566
79CBB1661BD03DE4001FC34D /* PNEventsListener.h in Headers */,
55575567
79CBB1261BD03DE4001FC34D /* PNChannelGroupsResult.h in Headers */,
55585568
A55CA6A02397389100B24E02 /* PNKeychain+Private.h in Headers */,

Framework/PubNub/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>PubNub</string>
99
<key>CFBundleGetInfoString</key>
10-
<string>5.4.0</string>
10+
<string>5.4.1</string>
1111
<key>CFBundleIdentifier</key>
1212
<string>com.pubnub.pubnub-objc</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.4.0</string>
20+
<string>5.4.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>5.4.0</string>
24+
<string>5.4.1</string>
2525
<key>NSHumanReadableCopyright</key>
2626
<string>© 2010 - 2020 PubNub, Inc.</string>
2727
<key>NSPrincipalClass</key>

Framework/PubNub/PubNub-iOS-Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>PubNub</string>
99
<key>CFBundleGetInfoString</key>
10-
<string>5.4.0</string>
10+
<string>5.4.1</string>
1111
<key>CFBundleIdentifier</key>
1212
<string>com.pubnub.pubnub-objc</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.4.0</string>
20+
<string>5.4.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>5.4.0</string>
24+
<string>5.4.1</string>
2525
<key>NSHumanReadableCopyright</key>
2626
<string>© 2010 - 2020 PubNub, Inc.</string>
2727
<key>NSPrincipalClass</key>

Framework/PubNub/PubNub-tvOS-Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>PubNub</string>
99
<key>CFBundleGetInfoString</key>
10-
<string>5.4.0</string>
10+
<string>5.4.1</string>
1111
<key>CFBundleIdentifier</key>
1212
<string>com.pubnub.pubnub-objc</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.4.0</string>
20+
<string>5.4.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>5.4.0</string>
24+
<string>5.4.1</string>
2525
<key>NSHumanReadableCopyright</key>
2626
<string>© 2010 - 2020 PubNub, Inc.</string>
2727
<key>NSPrincipalClass</key>

Framework/PubNub/PubNub-watchOS-Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>PubNub</string>
99
<key>CFBundleGetInfoString</key>
10-
<string>5.4.0</string>
10+
<string>5.4.1</string>
1111
<key>CFBundleIdentifier</key>
1212
<string>com.pubnub.pubnub-objc</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
@@ -17,11 +17,11 @@
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>5.4.0</string>
20+
<string>5.4.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>5.4.0</string>
24+
<string>5.4.1</string>
2525
<key>NSHumanReadableCopyright</key>
2626
<string>© 2010 - 2020 PubNub, Inc.</string>
2727
<key>NSPrincipalClass</key>

Framework/scripts/export_for_spm.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -e
55
WORKING_DIRECTORY="$(pwd)"
66
SOURCES_FOLDER="$1"
77
[[ "$2" == public-only ]] && PUBLIC_ONLY=1 || PUBLIC_ONLY=0
8+
PRIVATE_HEADERS=()
89
PUBLIC_HEADERS=()
910
ALL_HEADERS=()
1011
FILES=()
@@ -61,32 +62,35 @@ gather_imported_headers_in_file() {
6162
}
6263

6364

64-
6565
if [[ $PUBLIC_ONLY == 1 ]]; then
66+
regex=".*Private.h"
6667
# Retrieve list of potentially public headers.
6768
while IFS='' read -r HEADER_PATH; do
6869
RELATIVE_PATH="${HEADER_PATH#"$WORKING_DIRECTORY/$SOURCES_FOLDER/"}"
6970
FILENAME="$(echo "$RELATIVE_PATH" | rev | cut -d/ -f1 | rev)"
7071
FILES+=( "$FILENAME:$RELATIVE_PATH" )
7172
ALL_HEADERS+=("$RELATIVE_PATH")
73+
[[ "$RELATIVE_PATH" =~ $regex ]] && PRIVATE_HEADERS+=("$RELATIVE_PATH")
7274
done <<< "$(find "$WORKING_DIRECTORY/$SOURCES_FOLDER" -type f ! \( -name "*.m" -o -name ".DS_Store" -o -name "*Private.h" \))"
7375

7476
# Scan for public headers
7577
gather_imported_headers_in_file "$SOURCES_FOLDER/PubNub.h"
7678
else
79+
regex=".*Private.h"
7780
# Retrieve list of all headers.
7881
while IFS='' read -r HEADER_PATH; do
7982
RELATIVE_PATH="${HEADER_PATH#"$WORKING_DIRECTORY/$SOURCES_FOLDER/"}"
8083
FILENAME="$(echo "$RELATIVE_PATH" | rev | cut -d/ -f1 | rev)"
8184
FILES+=( "$FILENAME:$RELATIVE_PATH" )
8285
ALL_HEADERS+=("$RELATIVE_PATH")
86+
[[ "$RELATIVE_PATH" =~ $regex ]] && PRIVATE_HEADERS+=("$RELATIVE_PATH")
8387
done <<< "$(find "$WORKING_DIRECTORY/$SOURCES_FOLDER" -type f ! \( -name "*.m" -o -name ".DS_Store" \))"
8488
fi
8589

8690

8791
# Create required folders structure.
8892
! [[ -d "$WORKING_DIRECTORY/Sources" ]] && mkdir -p "$WORKING_DIRECTORY/Sources"
89-
! [[ -d "$1/include" ]] && mkdir -p "$1/include"
93+
! [[ -d "$1/include" ]] && mkdir -p "$1/include/PubNub"
9094

9195

9296
# Create symbolic link to Objective-C SDK source files.
@@ -96,8 +100,23 @@ popd
96100

97101

98102
# Create symbolic links for public headers
99-
cd "$1/include"
100-
! [[ -e "PubNub.h" ]] && ln -s "../PubNub.h"
103+
cd "$1/include/PubNub"
104+
105+
if [[ $PUBLIC_ONLY == 1 ]]; then
106+
for HEADER_PATH in "${PUBLIC_HEADERS[@]}"; do
107+
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
108+
! [[ -e "$FILENAME" ]] && ln -s "../../$HEADER_PATH"
109+
done
110+
else
111+
for HEADER_PATH in "${ALL_HEADERS[@]}"; do
112+
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
113+
! [[ -e "$FILENAME" ]] && ln -s "../../$HEADER_PATH" "$FILENAME"
114+
done
115+
fi
116+
117+
[[ -e "PubNub.h" ]] && rm "PubNub.h"
118+
119+
cd "../"
101120

102121
if [[ $PUBLIC_ONLY == 1 ]]; then
103122
for HEADER_PATH in "${PUBLIC_HEADERS[@]}"; do
@@ -109,4 +128,6 @@ else
109128
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
110129
! [[ -e "$FILENAME" ]] && ln -s "../$HEADER_PATH" "$FILENAME"
111130
done
112-
fi
131+
fi
132+
133+
[[ -e "PubNub.h" ]] && rm "PubNub.h"

Package.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.3
22
//
33
// Package.swift
44
//
@@ -42,21 +42,18 @@ let package = Package(
4242
.watchOS(.v4)
4343
],
4444
products: [
45-
// Products define the executables and libraries produced by a package, and make them visible to other packages.
4645
.library(
4746
name: "PubNub",
4847
targets: ["PubNub"]
4948
)
5049
],
51-
dependencies: [
52-
// Dependencies declare other packages that this package depends on.
53-
],
50+
dependencies: [],
5451
targets: [
55-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
56-
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
5752
.target(
5853
name: "PubNub",
59-
dependencies: []
54+
dependencies: [],
55+
path: "Sources/PubNub",
56+
resources: [.copy("PrivacyInfo.xcprivacy")]
6057
)
6158
],
6259
swiftLanguageVersions: [.v5]

PubNub.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
Pod::Spec.new do |spec|
1111
spec.name = 'PubNub'
12-
spec.version = '5.4.0'
12+
spec.version = '5.4.1'
1313
spec.summary = 'The PubNub Real-Time Network. Build real-time apps quickly and scale them globally.'
1414
spec.homepage = 'https://github.com/pubnub/objective-c'
1515

0 commit comments

Comments
 (0)