Skip to content

Commit

Permalink
Fix SPM integration issues (#456)
Browse files Browse the repository at this point in the history
fix(spm): add missing public header

fix(spm): change include folder structure

fix(npm): remove umbrella header from include
  • Loading branch information
parfeon authored Apr 30, 2024
1 parent ae3026d commit 9f3793d
Show file tree
Hide file tree
Showing 304 changed files with 366 additions and 36 deletions.
15 changes: 10 additions & 5 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
---
name: objective-c
scm: github.com/pubnub/objective-c
version: "5.4.0"
version: "5.4.1"
schema: 1
changelog:
- date: 2024-04-30
version: v5.4.1
changes:
- type: bug
text: "Match `include` folder content to the `import` in source code."
- date: 2024-04-16
version: v5.4.0
changes:
Expand Down Expand Up @@ -1339,7 +1344,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: PubNub.framework
location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.4.0.zip
location: https://github.com/pubnub/objective-c/archive/refs/tags/v5.4.1.zip
supported-platforms:
supported-operating-systems:
macOS:
Expand Down Expand Up @@ -1400,7 +1405,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: PubNub.ios.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.0/PubNub.ios.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.ios.xcframework.tar.gz
supported-platforms:
supported-operating-systems:
iOS:
Expand All @@ -1419,7 +1424,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: PubNub.macos.framework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.0/PubNub.macos.framework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.macos.framework.tar.gz
supported-platforms:
supported-operating-systems:
macOS:
Expand All @@ -1435,7 +1440,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: PubNub.tvos.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.0/PubNub.tvos.xcframework.tar.gz
location: https://github.com/pubnub/objective-c/releases/download/v5.4.1/PubNub.tvos.xcframework.tar.gz
supported-platforms:
supported-operating-systems:
tvOS:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v5.4.1
April 30 2024

#### Fixed
- Match `include` folder content to the `import` in source code.

## v5.4.0
April 16 2024

Expand Down
10 changes: 10 additions & 0 deletions Framework/PubNub Framework.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,11 @@
A5105B59238F027D00CB693D /* PNDate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5105B4F238F027D00CB693D /* PNDate.m */; };
A5105B5A238F027D00CB693D /* PNDate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5105B4F238F027D00CB693D /* PNDate.m */; };
A5105B5C238F027D00CB693D /* PNDate.m in Sources */ = {isa = PBXBuildFile; fileRef = A5105B4F238F027D00CB693D /* PNDate.m */; };
A51B49E02BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
A51B49E12BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
A51B49E22BDA7807008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
A51B49E32BDA7808008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
A51B49E42BDA7809008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E3B9FF2B2F669200D3AA18 /* PNRequestRetryConfiguration+Private.h */; };
A523692924A2270200656C19 /* PNAES+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A523692824A2270200656C19 /* PNAES+Private.h */; };
A523692A24A2270200656C19 /* PNAES+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A523692824A2270200656C19 /* PNAES+Private.h */; };
A523692B24A2270200656C19 /* PNAES+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A523692824A2270200656C19 /* PNAES+Private.h */; };
Expand Down Expand Up @@ -4382,6 +4387,7 @@
A56865B9230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
A57A30DA238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
7951954326BD44E9001E308C /* PubNub+PAM.h in Headers */,
A51B49E02BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
7915825C1BD709C60084FC70 /* PNChannelGroupsResult.h in Headers */,
79E20D151C8AEC3A001BC9CC /* PNEnvelopeInformation.h in Headers */,
A55CA69D2397389100B24E02 /* PNKeychain+Private.h in Headers */,
Expand Down Expand Up @@ -4675,6 +4681,7 @@
A56865BB230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
A57A30DC238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
7951954526BD44E9001E308C /* PubNub+PAM.h in Headers */,
A51B49E22BDA7807008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
791583071BD709D10084FC70 /* PNEventsListener.h in Headers */,
791583051BD709D10084FC70 /* PNChannelGroupsResult.h in Headers */,
A55CA69F2397389100B24E02 /* PNKeychain+Private.h in Headers */,
Expand Down Expand Up @@ -5055,6 +5062,7 @@
A57A30F6238DDCA300DE8C68 /* PNAPNSNotificationPayload+Private.h in Headers */,
798842741C18F1FB003E8948 /* PNStatus+Private.h in Headers */,
798842321C18F0AC003E8948 /* PubNub+Subscribe.h in Headers */,
A51B49E42BDA7809008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
A57A30DF238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
797ABBA624C4148C0008CA1E /* PNBasePublishRequest.h in Headers */,
7988422C1C18F088003E8948 /* PubNub+Presence.h in Headers */,
Expand Down Expand Up @@ -5260,6 +5268,7 @@
A56865BA230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
A57A30DB238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
7951954426BD44E9001E308C /* PubNub+PAM.h in Headers */,
A51B49E12BDA7806008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
79A8BC741C58F93900015BDE /* PNEventsListener.h in Headers */,
79A8BC721C58F93900015BDE /* PNChannelGroupsResult.h in Headers */,
A55CA69E2397389100B24E02 /* PNKeychain+Private.h in Headers */,
Expand Down Expand Up @@ -5553,6 +5562,7 @@
A56865BC230173030014E17C /* PNChannelMetadataChangeParser.h in Headers */,
A57A30DD238DC87400DE8C68 /* PNAPNSNotificationTarget.h in Headers */,
7951954626BD44E9001E308C /* PubNub+PAM.h in Headers */,
A51B49E32BDA7808008C3370 /* PNRequestRetryConfiguration+Private.h in Headers */,
79CBB1661BD03DE4001FC34D /* PNEventsListener.h in Headers */,
79CBB1261BD03DE4001FC34D /* PNChannelGroupsResult.h in Headers */,
A55CA6A02397389100B24E02 /* PNKeychain+Private.h in Headers */,
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/PubNub-iOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/PubNub-tvOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
6 changes: 3 additions & 3 deletions Framework/PubNub/PubNub-watchOS-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>PubNub</string>
<key>CFBundleGetInfoString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleIdentifier</key>
<string>com.pubnub.pubnub-objc</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand All @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5.4.0</string>
<string>5.4.1</string>
<key>NSHumanReadableCopyright</key>
<string>© 2010 - 2020 PubNub, Inc.</string>
<key>NSPrincipalClass</key>
Expand Down
31 changes: 26 additions & 5 deletions Framework/scripts/export_for_spm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -e
WORKING_DIRECTORY="$(pwd)"
SOURCES_FOLDER="$1"
[[ "$2" == public-only ]] && PUBLIC_ONLY=1 || PUBLIC_ONLY=0
PRIVATE_HEADERS=()
PUBLIC_HEADERS=()
ALL_HEADERS=()
FILES=()
Expand Down Expand Up @@ -61,32 +62,35 @@ gather_imported_headers_in_file() {
}



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

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


# Create required folders structure.
! [[ -d "$WORKING_DIRECTORY/Sources" ]] && mkdir -p "$WORKING_DIRECTORY/Sources"
! [[ -d "$1/include" ]] && mkdir -p "$1/include"
! [[ -d "$1/include" ]] && mkdir -p "$1/include/PubNub"


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


# Create symbolic links for public headers
cd "$1/include"
! [[ -e "PubNub.h" ]] && ln -s "../PubNub.h"
cd "$1/include/PubNub"

if [[ $PUBLIC_ONLY == 1 ]]; then
for HEADER_PATH in "${PUBLIC_HEADERS[@]}"; do
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
! [[ -e "$FILENAME" ]] && ln -s "../../$HEADER_PATH"
done
else
for HEADER_PATH in "${ALL_HEADERS[@]}"; do
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
! [[ -e "$FILENAME" ]] && ln -s "../../$HEADER_PATH" "$FILENAME"
done
fi

[[ -e "PubNub.h" ]] && rm "PubNub.h"

cd "../"

if [[ $PUBLIC_ONLY == 1 ]]; then
for HEADER_PATH in "${PUBLIC_HEADERS[@]}"; do
Expand All @@ -109,4 +128,6 @@ else
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
! [[ -e "$FILENAME" ]] && ln -s "../$HEADER_PATH" "$FILENAME"
done
fi
fi

[[ -e "PubNub.h" ]] && rm "PubNub.h"
13 changes: 5 additions & 8 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.3
//
// Package.swift
//
Expand Down Expand Up @@ -42,21 +42,18 @@ let package = Package(
.watchOS(.v4)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "PubNub",
targets: ["PubNub"]
)
],
dependencies: [
// Dependencies declare other packages that this package depends on.
],
dependencies: [],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "PubNub",
dependencies: []
dependencies: [],
path: "Sources/PubNub",
resources: [.copy("PrivacyInfo.xcprivacy")]
)
],
swiftLanguageVersions: [.v5]
Expand Down
2 changes: 1 addition & 1 deletion PubNub.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion PubNub/Misc/PNConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#pragma mark General information constants

// Stores client library version number
static NSString * const kPNLibraryVersion = @"5.4.0";
static NSString * const kPNLibraryVersion = @"5.4.1";

// Stores information about SDK codebase
static NSString * const kPNCommit = @"fd5c7ed678527fce07eaf7eb162935caf1bfd303";
Expand Down
5 changes: 4 additions & 1 deletion PubNub/Network/PNReachability.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
#import "PNReachability.h"
#import "PubNub+CorePrivate.h"
#import "PNConfiguration.h"
#import "PNTimeResult.h"
#import "PNStructures.h"
#import "PubNub+Time.h"
#import "PubNub+Core.h"
#import "PNLogMacro.h"
#import "PubNub.h"


NS_ASSUME_NONNULL_BEGIN
Expand Down
1 change: 1 addition & 0 deletions PubNub/include/PNRequestRetryConfiguration+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNRequestRetryConfiguration.h
1 change: 0 additions & 1 deletion PubNub/include/PubNub.h

This file was deleted.

1 change: 1 addition & 0 deletions PubNub/include/PubNub/NSArray+PNMap.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/NSDateFormatter+PNCacheable.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/NSInputStream+PNCrypto.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/NSInputStream+PNURL.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAES+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAES.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAESCBCCryptor+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAESCBCCryptor.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAPICallBuilder+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAPICallBuilder.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub/PNAPNSAPICallBuilder.h
Loading

0 comments on commit 9f3793d

Please sign in to comment.