Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
parfeon committed Apr 25, 2024
1 parent e8cd868 commit 63fbd25
Show file tree
Hide file tree
Showing 39 changed files with 49 additions and 2 deletions.
13 changes: 11 additions & 2 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,25 +62,28 @@ 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

Expand Down Expand Up @@ -112,7 +116,7 @@ else
done
fi

# cd "../"
cd "../"

# if [[ $PUBLIC_ONLY == 1 ]]; then
# for HEADER_PATH in "${PUBLIC_HEADERS[@]}"; do
Expand All @@ -126,4 +130,9 @@ fi
# done
# fi

for HEADER_PATH in "${PRIVATE_HEADERS[@]}"; do
FILENAME="$(echo "$HEADER_PATH" | rev | cut -d/ -f1 | rev)"
! [[ -e "$FILENAME" ]] && ln -s "../$HEADER_PATH" "$FILENAME"
done

# [[ -e "PubNub.h" ]] && rm "PubNub.h"
1 change: 1 addition & 0 deletions PubNub/include/PNAES+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNAESCBCCryptor+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNAPICallBuilder+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNAPNSNotificationConfiguration+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNAPNSNotificationPayload+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNAPNSNotificationTarget+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNBaseMessageActionRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNBaseNotificationPayload+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNBaseObjectsMembershipRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNBaseObjectsRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNBasePublishRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNChannelMember+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNChannelMetadata+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNConfiguration+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNCryptorHeader+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNCryptorInputStream+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNDownloadFileRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNErrorStatus+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNFile+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNKeychain+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNMembership+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNMessageAction+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNOperationResult+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNPAMToken+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNRequestRetryConfiguration+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNSendFileRequest+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNSendFileStatus+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNServiceData+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNStatus+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNSubscribeStatus+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNUUIDMetadata+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PNXML+Private.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub+CorePrivate.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub+PAMPrivate.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub+PresencePrivate.h
1 change: 1 addition & 0 deletions PubNub/include/PubNub+SubscribePrivate.h

0 comments on commit 63fbd25

Please sign in to comment.