From fc16d2b24cc7df158f05dbe0342b0cea2c1d4492 Mon Sep 17 00:00:00 2001 From: Anton Belousov Date: Tue, 6 Feb 2024 20:15:17 +0100 Subject: [PATCH 1/4] no message --- .gitignore | 1 + Package.swift | 41 +++++++++++++++++++ .../Internal/Delegate/SRDelegateController.h | 3 +- .../Internal/NSRunLoop+SRWebSocketPrivate.h | 4 +- .../NSURLRequest+SRWebSocketPrivate.h | 4 +- .../Security/SRPinningSecurityPolicy.h | 3 +- TestChat/TCViewController.m | 3 +- Tests/Operations/SRTWebSocketOperation.h | 3 +- Tests/SRAutobahnTests.m | 3 +- 9 files changed, 56 insertions(+), 9 deletions(-) create mode 100644 Package.swift diff --git a/.gitignore b/.gitignore index b07e3754f..9f0850be5 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ DerivedData extern/ *.pyc +.build \ No newline at end of file diff --git a/Package.swift b/Package.swift new file mode 100644 index 000000000..75d755e1b --- /dev/null +++ b/Package.swift @@ -0,0 +1,41 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "SocketRocket", + platforms: [ + .iOS(.v11), + .macOS(.v10_13), + .tvOS(.v11) + ], + products: [ + .library( + name: "SocketRocket", + targets: ["SocketRocket"]), + ], + targets: [ + .target( + name: "SocketRocket", + path: "SocketRocket", + exclude: ["Resources"], // Исключите ненужные файлы или директории + sources: [".", "Internal"], // Указание исходных файлов + publicHeadersPath: "include", // Все публичные заголовки должны быть перемещены в 'include' + cSettings: [ + .headerSearchPath("."), + .headerSearchPath("Internal"), + .headerSearchPath("Internal/Delegate"), + .headerSearchPath("Internal/IOConsumer"), + .headerSearchPath("Internal/Proxy"), + .headerSearchPath("Internal/RunLoop"), + .headerSearchPath("Internal/Security"), + .headerSearchPath("Internal/Utilities") + ], + linkerSettings: [ + .linkedFramework("CFNetwork", .when(platforms: [.iOS, .tvOS])), + .linkedFramework("Security"), + .linkedFramework("CoreServices", .when(platforms: [.macOS])), + .linkedLibrary("icucore") + ] + ) + ] +) diff --git a/SocketRocket/Internal/Delegate/SRDelegateController.h b/SocketRocket/Internal/Delegate/SRDelegateController.h index 43634a120..a1a3adb99 100644 --- a/SocketRocket/Internal/Delegate/SRDelegateController.h +++ b/SocketRocket/Internal/Delegate/SRDelegateController.h @@ -9,7 +9,8 @@ #import -#import +// #import +#import "SRWebSocket.h" NS_ASSUME_NONNULL_BEGIN diff --git a/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h b/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h index 098f7a818..df51baa36 100644 --- a/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h +++ b/SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h @@ -7,7 +7,7 @@ // of patent rights can be found in the PATENTS file in the same directory. // -#import - +// #import +#import "NSRunLoop+SRWebSocket.h" // Empty function that force links the object file for the category. extern void import_NSRunLoop_SRWebSocket(void); diff --git a/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h b/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h index b09dde420..290cd7749 100644 --- a/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h +++ b/SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h @@ -7,7 +7,7 @@ // of patent rights can be found in the PATENTS file in the same directory. // -#import - +// #import +#import "NSURLRequest+SRWebSocket.h" // Empty function that force links the object file for the category. extern void import_NSURLRequest_SRWebSocket(void); diff --git a/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h b/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h index 0d498b211..af7b06110 100644 --- a/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h +++ b/SocketRocket/Internal/Security/SRPinningSecurityPolicy.h @@ -9,7 +9,8 @@ #import -#import +// #import +#import "SRSecurityPolicy.h" NS_ASSUME_NONNULL_BEGIN diff --git a/TestChat/TCViewController.m b/TestChat/TCViewController.m index 1f79f7e55..3511b2d2c 100644 --- a/TestChat/TCViewController.m +++ b/TestChat/TCViewController.m @@ -9,7 +9,8 @@ #import "TCViewController.h" -#import +// #import +#import "SocketRocket.h" #import "TCChatCell.h" diff --git a/Tests/Operations/SRTWebSocketOperation.h b/Tests/Operations/SRTWebSocketOperation.h index c4d53c2c3..0d6fea3c0 100644 --- a/Tests/Operations/SRTWebSocketOperation.h +++ b/Tests/Operations/SRTWebSocketOperation.h @@ -9,7 +9,8 @@ // of patent rights can be found in the PATENTS file in the same directory. // -#import +// #import +#import "SRWebSocket.h" @interface SRTWebSocketOperation : NSOperation diff --git a/Tests/SRAutobahnTests.m b/Tests/SRAutobahnTests.m index cc9fc17f7..b6b3068f3 100644 --- a/Tests/SRAutobahnTests.m +++ b/Tests/SRAutobahnTests.m @@ -12,7 +12,8 @@ @import XCTest; @import ObjectiveC; -#import +// #import +#import "SRWebSocket.h" #import "SRTWebSocketOperation.h" #import "SRAutobahnOperation.h" From 373ef452e989dbd5cf878670fcade02712ff5069 Mon Sep 17 00:00:00 2001 From: Anton Belousov Date: Tue, 6 Feb 2024 22:56:10 +0100 Subject: [PATCH 2/4] fix --- Package.swift | 13 +++++----- create_symlinks.sh | 30 +++++++++++++++++++++++ include/NSRunLoop+SRWebSocket.h | 1 + include/NSRunLoop+SRWebSocketPrivate.h | 1 + include/NSURLRequest+SRWebSocket.h | 1 + include/NSURLRequest+SRWebSocketPrivate.h | 1 + include/SRAutobahnOperation.h | 1 + include/SRAutobahnUtilities.h | 1 + include/SRConstants.h | 1 + include/SRDelegateController.h | 1 + include/SRError.h | 1 + include/SRHTTPConnectMessage.h | 1 + include/SRHash.h | 1 + include/SRIOConsumer.h | 1 + include/SRIOConsumerPool.h | 1 + include/SRLog.h | 1 + include/SRMutex.h | 1 + include/SRPinningSecurityPolicy.h | 1 + include/SRProxyConnect.h | 1 + include/SRRandom.h | 1 + include/SRRunLoopThread.h | 1 + include/SRSIMDHelpers.h | 1 + include/SRSecurityPolicy.h | 1 + include/SRTWebSocketOperation.h | 1 + include/SRURLUtilities.h | 1 + include/SRWebSocket.h | 1 + include/SocketRocket.h | 1 + include/TCAppDelegate.h | 1 + include/TCChatCell.h | 1 + include/TCViewController.h | 1 + 30 files changed, 65 insertions(+), 6 deletions(-) create mode 100755 create_symlinks.sh create mode 120000 include/NSRunLoop+SRWebSocket.h create mode 120000 include/NSRunLoop+SRWebSocketPrivate.h create mode 120000 include/NSURLRequest+SRWebSocket.h create mode 120000 include/NSURLRequest+SRWebSocketPrivate.h create mode 120000 include/SRAutobahnOperation.h create mode 120000 include/SRAutobahnUtilities.h create mode 120000 include/SRConstants.h create mode 120000 include/SRDelegateController.h create mode 120000 include/SRError.h create mode 120000 include/SRHTTPConnectMessage.h create mode 120000 include/SRHash.h create mode 120000 include/SRIOConsumer.h create mode 120000 include/SRIOConsumerPool.h create mode 120000 include/SRLog.h create mode 120000 include/SRMutex.h create mode 120000 include/SRPinningSecurityPolicy.h create mode 120000 include/SRProxyConnect.h create mode 120000 include/SRRandom.h create mode 120000 include/SRRunLoopThread.h create mode 120000 include/SRSIMDHelpers.h create mode 120000 include/SRSecurityPolicy.h create mode 120000 include/SRTWebSocketOperation.h create mode 120000 include/SRURLUtilities.h create mode 120000 include/SRWebSocket.h create mode 120000 include/SocketRocket.h create mode 120000 include/TCAppDelegate.h create mode 120000 include/TCChatCell.h create mode 120000 include/TCViewController.h diff --git a/Package.swift b/Package.swift index 75d755e1b..9f01b9f14 100644 --- a/Package.swift +++ b/Package.swift @@ -3,15 +3,16 @@ import PackageDescription let package = Package( name: "SocketRocket", - platforms: [ - .iOS(.v11), - .macOS(.v10_13), - .tvOS(.v11) - ], + platforms: [.iOS(.v9)], products: [ .library( name: "SocketRocket", - targets: ["SocketRocket"]), + targets: ["SocketRocket"] + ), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), ], targets: [ .target( diff --git a/create_symlinks.sh b/create_symlinks.sh new file mode 100755 index 000000000..d17d6836a --- /dev/null +++ b/create_symlinks.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# Задайте начальную директорию для поиска .h файлов +SOURCE_DIR="." + +# Директория для создания символических ссылок +INCLUDE_DIR="${SOURCE_DIR}/include" + +# Создать директорию include, если она не существует +mkdir -p "$INCLUDE_DIR" + +# Функция для создания символических ссылок +create_symlinks() { + local src_dir=$1 + local include_dir=$2 + + # Найти все .h файлы в src_dir и поддиректориях + find "$src_dir" -type f -name "*.h" | while read -r header_file; do + # Получить базовое имя файла для создания ссылки + local base_name=$(basename "$header_file") + + # Создать символическую ссылку в include_dir + ln -s "$header_file" "$include_dir/$base_name" 2>/dev/null || echo "Symlink for $base_name already exists." + done +} + +# Вызов функции с заданными параметрами +create_symlinks "$SOURCE_DIR" "$INCLUDE_DIR" + +echo "Symlinks for header files are created in $INCLUDE_DIR" diff --git a/include/NSRunLoop+SRWebSocket.h b/include/NSRunLoop+SRWebSocket.h new file mode 120000 index 000000000..77abb2d80 --- /dev/null +++ b/include/NSRunLoop+SRWebSocket.h @@ -0,0 +1 @@ +./SocketRocket/NSRunLoop+SRWebSocket.h \ No newline at end of file diff --git a/include/NSRunLoop+SRWebSocketPrivate.h b/include/NSRunLoop+SRWebSocketPrivate.h new file mode 120000 index 000000000..44670d1d7 --- /dev/null +++ b/include/NSRunLoop+SRWebSocketPrivate.h @@ -0,0 +1 @@ +./SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h \ No newline at end of file diff --git a/include/NSURLRequest+SRWebSocket.h b/include/NSURLRequest+SRWebSocket.h new file mode 120000 index 000000000..11639402b --- /dev/null +++ b/include/NSURLRequest+SRWebSocket.h @@ -0,0 +1 @@ +./SocketRocket/NSURLRequest+SRWebSocket.h \ No newline at end of file diff --git a/include/NSURLRequest+SRWebSocketPrivate.h b/include/NSURLRequest+SRWebSocketPrivate.h new file mode 120000 index 000000000..ce9b2c450 --- /dev/null +++ b/include/NSURLRequest+SRWebSocketPrivate.h @@ -0,0 +1 @@ +./SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h \ No newline at end of file diff --git a/include/SRAutobahnOperation.h b/include/SRAutobahnOperation.h new file mode 120000 index 000000000..f579502b0 --- /dev/null +++ b/include/SRAutobahnOperation.h @@ -0,0 +1 @@ +./Tests/Operations/SRAutobahnOperation.h \ No newline at end of file diff --git a/include/SRAutobahnUtilities.h b/include/SRAutobahnUtilities.h new file mode 120000 index 000000000..900f689bc --- /dev/null +++ b/include/SRAutobahnUtilities.h @@ -0,0 +1 @@ +./Tests/Utilities/SRAutobahnUtilities.h \ No newline at end of file diff --git a/include/SRConstants.h b/include/SRConstants.h new file mode 120000 index 000000000..96ca8ce56 --- /dev/null +++ b/include/SRConstants.h @@ -0,0 +1 @@ +./SocketRocket/Internal/SRConstants.h \ No newline at end of file diff --git a/include/SRDelegateController.h b/include/SRDelegateController.h new file mode 120000 index 000000000..f1afd5dd0 --- /dev/null +++ b/include/SRDelegateController.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Delegate/SRDelegateController.h \ No newline at end of file diff --git a/include/SRError.h b/include/SRError.h new file mode 120000 index 000000000..21d78fc46 --- /dev/null +++ b/include/SRError.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRError.h \ No newline at end of file diff --git a/include/SRHTTPConnectMessage.h b/include/SRHTTPConnectMessage.h new file mode 120000 index 000000000..82e56c57d --- /dev/null +++ b/include/SRHTTPConnectMessage.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRHTTPConnectMessage.h \ No newline at end of file diff --git a/include/SRHash.h b/include/SRHash.h new file mode 120000 index 000000000..902c80506 --- /dev/null +++ b/include/SRHash.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRHash.h \ No newline at end of file diff --git a/include/SRIOConsumer.h b/include/SRIOConsumer.h new file mode 120000 index 000000000..e204f8587 --- /dev/null +++ b/include/SRIOConsumer.h @@ -0,0 +1 @@ +./SocketRocket/Internal/IOConsumer/SRIOConsumer.h \ No newline at end of file diff --git a/include/SRIOConsumerPool.h b/include/SRIOConsumerPool.h new file mode 120000 index 000000000..a1aa81231 --- /dev/null +++ b/include/SRIOConsumerPool.h @@ -0,0 +1 @@ +./SocketRocket/Internal/IOConsumer/SRIOConsumerPool.h \ No newline at end of file diff --git a/include/SRLog.h b/include/SRLog.h new file mode 120000 index 000000000..2ee9e1b7b --- /dev/null +++ b/include/SRLog.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRLog.h \ No newline at end of file diff --git a/include/SRMutex.h b/include/SRMutex.h new file mode 120000 index 000000000..37ea8037a --- /dev/null +++ b/include/SRMutex.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRMutex.h \ No newline at end of file diff --git a/include/SRPinningSecurityPolicy.h b/include/SRPinningSecurityPolicy.h new file mode 120000 index 000000000..91db9a4cc --- /dev/null +++ b/include/SRPinningSecurityPolicy.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Security/SRPinningSecurityPolicy.h \ No newline at end of file diff --git a/include/SRProxyConnect.h b/include/SRProxyConnect.h new file mode 120000 index 000000000..97e7f86dc --- /dev/null +++ b/include/SRProxyConnect.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Proxy/SRProxyConnect.h \ No newline at end of file diff --git a/include/SRRandom.h b/include/SRRandom.h new file mode 120000 index 000000000..d6f64cb14 --- /dev/null +++ b/include/SRRandom.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRRandom.h \ No newline at end of file diff --git a/include/SRRunLoopThread.h b/include/SRRunLoopThread.h new file mode 120000 index 000000000..4d584b9fc --- /dev/null +++ b/include/SRRunLoopThread.h @@ -0,0 +1 @@ +./SocketRocket/Internal/RunLoop/SRRunLoopThread.h \ No newline at end of file diff --git a/include/SRSIMDHelpers.h b/include/SRSIMDHelpers.h new file mode 120000 index 000000000..466e22d71 --- /dev/null +++ b/include/SRSIMDHelpers.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRSIMDHelpers.h \ No newline at end of file diff --git a/include/SRSecurityPolicy.h b/include/SRSecurityPolicy.h new file mode 120000 index 000000000..f6fc99798 --- /dev/null +++ b/include/SRSecurityPolicy.h @@ -0,0 +1 @@ +./SocketRocket/SRSecurityPolicy.h \ No newline at end of file diff --git a/include/SRTWebSocketOperation.h b/include/SRTWebSocketOperation.h new file mode 120000 index 000000000..b1dff49f9 --- /dev/null +++ b/include/SRTWebSocketOperation.h @@ -0,0 +1 @@ +./Tests/Operations/SRTWebSocketOperation.h \ No newline at end of file diff --git a/include/SRURLUtilities.h b/include/SRURLUtilities.h new file mode 120000 index 000000000..5169d8186 --- /dev/null +++ b/include/SRURLUtilities.h @@ -0,0 +1 @@ +./SocketRocket/Internal/Utilities/SRURLUtilities.h \ No newline at end of file diff --git a/include/SRWebSocket.h b/include/SRWebSocket.h new file mode 120000 index 000000000..7567db9ce --- /dev/null +++ b/include/SRWebSocket.h @@ -0,0 +1 @@ +./SocketRocket/SRWebSocket.h \ No newline at end of file diff --git a/include/SocketRocket.h b/include/SocketRocket.h new file mode 120000 index 000000000..f369a1a1e --- /dev/null +++ b/include/SocketRocket.h @@ -0,0 +1 @@ +./SocketRocket/SocketRocket.h \ No newline at end of file diff --git a/include/TCAppDelegate.h b/include/TCAppDelegate.h new file mode 120000 index 000000000..bb08ae541 --- /dev/null +++ b/include/TCAppDelegate.h @@ -0,0 +1 @@ +./TestChat/TCAppDelegate.h \ No newline at end of file diff --git a/include/TCChatCell.h b/include/TCChatCell.h new file mode 120000 index 000000000..f3f69e688 --- /dev/null +++ b/include/TCChatCell.h @@ -0,0 +1 @@ +./TestChat/TCChatCell.h \ No newline at end of file diff --git a/include/TCViewController.h b/include/TCViewController.h new file mode 120000 index 000000000..6cfe67102 --- /dev/null +++ b/include/TCViewController.h @@ -0,0 +1 @@ +./TestChat/TCViewController.h \ No newline at end of file From 8ffbc307b4f7ff343fad54456151b137bb57840a Mon Sep 17 00:00:00 2001 From: Anton Belousov Date: Wed, 7 Feb 2024 00:03:04 +0100 Subject: [PATCH 3/4] fix --- SocketRocket/include/SocketRocket.h | 15 ++++++++ create_symlinks.sh | 45 +++++++++++------------ include/NSRunLoop+SRWebSocket.h | 1 - include/NSRunLoop+SRWebSocketPrivate.h | 1 - include/NSURLRequest+SRWebSocket.h | 1 - include/NSURLRequest+SRWebSocketPrivate.h | 1 - include/SRAutobahnOperation.h | 1 - include/SRAutobahnUtilities.h | 1 - include/SRConstants.h | 1 - include/SRDelegateController.h | 1 - include/SRError.h | 1 - include/SRHTTPConnectMessage.h | 1 - include/SRHash.h | 1 - include/SRIOConsumer.h | 1 - include/SRIOConsumerPool.h | 1 - include/SRLog.h | 1 - include/SRMutex.h | 1 - include/SRPinningSecurityPolicy.h | 1 - include/SRProxyConnect.h | 1 - include/SRRandom.h | 1 - include/SRRunLoopThread.h | 1 - include/SRSIMDHelpers.h | 1 - include/SRSecurityPolicy.h | 1 - include/SRTWebSocketOperation.h | 1 - include/SRURLUtilities.h | 1 - include/SRWebSocket.h | 1 - include/SocketRocket.h | 1 - include/TCAppDelegate.h | 1 - include/TCChatCell.h | 1 - include/TCViewController.h | 1 - 30 files changed, 36 insertions(+), 52 deletions(-) create mode 100644 SocketRocket/include/SocketRocket.h delete mode 120000 include/NSRunLoop+SRWebSocket.h delete mode 120000 include/NSRunLoop+SRWebSocketPrivate.h delete mode 120000 include/NSURLRequest+SRWebSocket.h delete mode 120000 include/NSURLRequest+SRWebSocketPrivate.h delete mode 120000 include/SRAutobahnOperation.h delete mode 120000 include/SRAutobahnUtilities.h delete mode 120000 include/SRConstants.h delete mode 120000 include/SRDelegateController.h delete mode 120000 include/SRError.h delete mode 120000 include/SRHTTPConnectMessage.h delete mode 120000 include/SRHash.h delete mode 120000 include/SRIOConsumer.h delete mode 120000 include/SRIOConsumerPool.h delete mode 120000 include/SRLog.h delete mode 120000 include/SRMutex.h delete mode 120000 include/SRPinningSecurityPolicy.h delete mode 120000 include/SRProxyConnect.h delete mode 120000 include/SRRandom.h delete mode 120000 include/SRRunLoopThread.h delete mode 120000 include/SRSIMDHelpers.h delete mode 120000 include/SRSecurityPolicy.h delete mode 120000 include/SRTWebSocketOperation.h delete mode 120000 include/SRURLUtilities.h delete mode 120000 include/SRWebSocket.h delete mode 120000 include/SocketRocket.h delete mode 120000 include/TCAppDelegate.h delete mode 120000 include/TCChatCell.h delete mode 120000 include/TCViewController.h diff --git a/SocketRocket/include/SocketRocket.h b/SocketRocket/include/SocketRocket.h new file mode 100644 index 000000000..4572c1334 --- /dev/null +++ b/SocketRocket/include/SocketRocket.h @@ -0,0 +1,15 @@ +// +// Copyright 2012 Square Inc. +// Portions Copyright (c) 2016-present, Facebook, Inc. +// +// All rights reserved. +// +// This source code is licensed under the BSD-style license found in the +// LICENSE file in the root directory of this source tree. An additional grant +// of patent rights can be found in the PATENTS file in the same directory. +// + + #import "../NSRunLoop+SRWebSocket.h" + #import "../NSURLRequest+SRWebSocket.h" + #import "../SRSecurityPolicy.h" + #import "../SRWebSocket.h" diff --git a/create_symlinks.sh b/create_symlinks.sh index d17d6836a..6cd450b6e 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -1,30 +1,27 @@ #!/bin/bash -# Задайте начальную директорию для поиска .h файлов -SOURCE_DIR="." +if [ "$#" -ne 1 ]; then + echo "Usage: $0 /path/to" + exit 1 +fi -# Директория для создания символических ссылок -INCLUDE_DIR="${SOURCE_DIR}/include" +SOURCE_DIR=$1 +INCLUDE_DIR="$SOURCE_DIR/include" -# Создать директорию include, если она не существует mkdir -p "$INCLUDE_DIR" -# Функция для создания символических ссылок -create_symlinks() { - local src_dir=$1 - local include_dir=$2 - - # Найти все .h файлы в src_dir и поддиректориях - find "$src_dir" -type f -name "*.h" | while read -r header_file; do - # Получить базовое имя файла для создания ссылки - local base_name=$(basename "$header_file") - - # Создать символическую ссылку в include_dir - ln -s "$header_file" "$include_dir/$base_name" 2>/dev/null || echo "Symlink for $base_name already exists." - done -} - -# Вызов функции с заданными параметрами -create_symlinks "$SOURCE_DIR" "$INCLUDE_DIR" - -echo "Symlinks for header files are created in $INCLUDE_DIR" +find "$SOURCE_DIR" -type f -name "*.h" | while read -r file; do + filename=$(basename "$file") + symlink_path="$INCLUDE_DIR/$filename" + if [ ! -e "$symlink_path" ]; then + ln -s "../$file" "$symlink_path" + # cp "$file" "$symlink_path" + echo "Создана ссылка для: $file" + # Выводим исходный путь файла, на который ссылка указывает + echo "Исходный путь: $file" + else + echo "Ссылка для $file уже существует" + fi +done + +echo "Обработка завершена." diff --git a/include/NSRunLoop+SRWebSocket.h b/include/NSRunLoop+SRWebSocket.h deleted file mode 120000 index 77abb2d80..000000000 --- a/include/NSRunLoop+SRWebSocket.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/NSRunLoop+SRWebSocket.h \ No newline at end of file diff --git a/include/NSRunLoop+SRWebSocketPrivate.h b/include/NSRunLoop+SRWebSocketPrivate.h deleted file mode 120000 index 44670d1d7..000000000 --- a/include/NSRunLoop+SRWebSocketPrivate.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/NSRunLoop+SRWebSocketPrivate.h \ No newline at end of file diff --git a/include/NSURLRequest+SRWebSocket.h b/include/NSURLRequest+SRWebSocket.h deleted file mode 120000 index 11639402b..000000000 --- a/include/NSURLRequest+SRWebSocket.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/NSURLRequest+SRWebSocket.h \ No newline at end of file diff --git a/include/NSURLRequest+SRWebSocketPrivate.h b/include/NSURLRequest+SRWebSocketPrivate.h deleted file mode 120000 index ce9b2c450..000000000 --- a/include/NSURLRequest+SRWebSocketPrivate.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/NSURLRequest+SRWebSocketPrivate.h \ No newline at end of file diff --git a/include/SRAutobahnOperation.h b/include/SRAutobahnOperation.h deleted file mode 120000 index f579502b0..000000000 --- a/include/SRAutobahnOperation.h +++ /dev/null @@ -1 +0,0 @@ -./Tests/Operations/SRAutobahnOperation.h \ No newline at end of file diff --git a/include/SRAutobahnUtilities.h b/include/SRAutobahnUtilities.h deleted file mode 120000 index 900f689bc..000000000 --- a/include/SRAutobahnUtilities.h +++ /dev/null @@ -1 +0,0 @@ -./Tests/Utilities/SRAutobahnUtilities.h \ No newline at end of file diff --git a/include/SRConstants.h b/include/SRConstants.h deleted file mode 120000 index 96ca8ce56..000000000 --- a/include/SRConstants.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/SRConstants.h \ No newline at end of file diff --git a/include/SRDelegateController.h b/include/SRDelegateController.h deleted file mode 120000 index f1afd5dd0..000000000 --- a/include/SRDelegateController.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Delegate/SRDelegateController.h \ No newline at end of file diff --git a/include/SRError.h b/include/SRError.h deleted file mode 120000 index 21d78fc46..000000000 --- a/include/SRError.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRError.h \ No newline at end of file diff --git a/include/SRHTTPConnectMessage.h b/include/SRHTTPConnectMessage.h deleted file mode 120000 index 82e56c57d..000000000 --- a/include/SRHTTPConnectMessage.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRHTTPConnectMessage.h \ No newline at end of file diff --git a/include/SRHash.h b/include/SRHash.h deleted file mode 120000 index 902c80506..000000000 --- a/include/SRHash.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRHash.h \ No newline at end of file diff --git a/include/SRIOConsumer.h b/include/SRIOConsumer.h deleted file mode 120000 index e204f8587..000000000 --- a/include/SRIOConsumer.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/IOConsumer/SRIOConsumer.h \ No newline at end of file diff --git a/include/SRIOConsumerPool.h b/include/SRIOConsumerPool.h deleted file mode 120000 index a1aa81231..000000000 --- a/include/SRIOConsumerPool.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/IOConsumer/SRIOConsumerPool.h \ No newline at end of file diff --git a/include/SRLog.h b/include/SRLog.h deleted file mode 120000 index 2ee9e1b7b..000000000 --- a/include/SRLog.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRLog.h \ No newline at end of file diff --git a/include/SRMutex.h b/include/SRMutex.h deleted file mode 120000 index 37ea8037a..000000000 --- a/include/SRMutex.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRMutex.h \ No newline at end of file diff --git a/include/SRPinningSecurityPolicy.h b/include/SRPinningSecurityPolicy.h deleted file mode 120000 index 91db9a4cc..000000000 --- a/include/SRPinningSecurityPolicy.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Security/SRPinningSecurityPolicy.h \ No newline at end of file diff --git a/include/SRProxyConnect.h b/include/SRProxyConnect.h deleted file mode 120000 index 97e7f86dc..000000000 --- a/include/SRProxyConnect.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Proxy/SRProxyConnect.h \ No newline at end of file diff --git a/include/SRRandom.h b/include/SRRandom.h deleted file mode 120000 index d6f64cb14..000000000 --- a/include/SRRandom.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRRandom.h \ No newline at end of file diff --git a/include/SRRunLoopThread.h b/include/SRRunLoopThread.h deleted file mode 120000 index 4d584b9fc..000000000 --- a/include/SRRunLoopThread.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/RunLoop/SRRunLoopThread.h \ No newline at end of file diff --git a/include/SRSIMDHelpers.h b/include/SRSIMDHelpers.h deleted file mode 120000 index 466e22d71..000000000 --- a/include/SRSIMDHelpers.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRSIMDHelpers.h \ No newline at end of file diff --git a/include/SRSecurityPolicy.h b/include/SRSecurityPolicy.h deleted file mode 120000 index f6fc99798..000000000 --- a/include/SRSecurityPolicy.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/SRSecurityPolicy.h \ No newline at end of file diff --git a/include/SRTWebSocketOperation.h b/include/SRTWebSocketOperation.h deleted file mode 120000 index b1dff49f9..000000000 --- a/include/SRTWebSocketOperation.h +++ /dev/null @@ -1 +0,0 @@ -./Tests/Operations/SRTWebSocketOperation.h \ No newline at end of file diff --git a/include/SRURLUtilities.h b/include/SRURLUtilities.h deleted file mode 120000 index 5169d8186..000000000 --- a/include/SRURLUtilities.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/Internal/Utilities/SRURLUtilities.h \ No newline at end of file diff --git a/include/SRWebSocket.h b/include/SRWebSocket.h deleted file mode 120000 index 7567db9ce..000000000 --- a/include/SRWebSocket.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/SRWebSocket.h \ No newline at end of file diff --git a/include/SocketRocket.h b/include/SocketRocket.h deleted file mode 120000 index f369a1a1e..000000000 --- a/include/SocketRocket.h +++ /dev/null @@ -1 +0,0 @@ -./SocketRocket/SocketRocket.h \ No newline at end of file diff --git a/include/TCAppDelegate.h b/include/TCAppDelegate.h deleted file mode 120000 index bb08ae541..000000000 --- a/include/TCAppDelegate.h +++ /dev/null @@ -1 +0,0 @@ -./TestChat/TCAppDelegate.h \ No newline at end of file diff --git a/include/TCChatCell.h b/include/TCChatCell.h deleted file mode 120000 index f3f69e688..000000000 --- a/include/TCChatCell.h +++ /dev/null @@ -1 +0,0 @@ -./TestChat/TCChatCell.h \ No newline at end of file diff --git a/include/TCViewController.h b/include/TCViewController.h deleted file mode 120000 index 6cfe67102..000000000 --- a/include/TCViewController.h +++ /dev/null @@ -1 +0,0 @@ -./TestChat/TCViewController.h \ No newline at end of file From 4a04a2ac61249cebf236b8e7767228f944114846 Mon Sep 17 00:00:00 2001 From: Anton Belousov Date: Mon, 22 Jul 2024 10:43:34 +0200 Subject: [PATCH 4/4] turn off logs --- SocketRocket/Internal/Utilities/SRLog.m | 2 +- TestChat/TCViewController.m | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SocketRocket/Internal/Utilities/SRLog.m b/SocketRocket/Internal/Utilities/SRLog.m index 459601781..529ab9b73 100644 --- a/SocketRocket/Internal/Utilities/SRLog.m +++ b/SocketRocket/Internal/Utilities/SRLog.m @@ -20,7 +20,7 @@ extern void SRErrorLog(NSString *format, ...) va_end(arg_list); - NSLog(@"[SocketRocket] %@", formattedString); + // NSLog(@"[SocketRocket] %@", formattedString); } extern void SRDebugLog(NSString *format, ...) diff --git a/TestChat/TCViewController.m b/TestChat/TCViewController.m index 3511b2d2c..a96247feb 100644 --- a/TestChat/TCViewController.m +++ b/TestChat/TCViewController.m @@ -143,13 +143,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N - (void)webSocketDidOpen:(SRWebSocket *)webSocket; { - NSLog(@"Websocket Connected"); + // NSLog(@"Websocket Connected"); self.title = @"Connected!"; } - (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error; { - NSLog(@":( Websocket Failed With Error %@", error); + // NSLog(@":( Websocket Failed With Error %@", error); self.title = @"Connection Failed! (see logs)"; _webSocket = nil; @@ -157,20 +157,20 @@ - (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error; - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessageWithString:(nonnull NSString *)string { - NSLog(@"Received \"%@\"", string); + // NSLog(@"Received \"%@\"", string); [self _addMessage:[[TCMessage alloc] initWithMessage:string incoming:YES]]; } - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; { - NSLog(@"WebSocket closed"); + // NSLog(@"WebSocket closed"); self.title = @"Connection Closed! (see logs)"; _webSocket = nil; } - (void)webSocket:(SRWebSocket *)webSocket didReceivePong:(NSData *)pongPayload; { - NSLog(@"WebSocket received pong"); + // NSLog(@"WebSocket received pong"); } ///--------------------------------------