Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cron-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
runs-on: macos-15
env:
XCODE_VERSION: "26.0"
XCODE_VERSION: "26.0.1"
steps:
- uses: actions/checkout@v4.1.1
- uses: ./.github/actions/bootstrap
Expand Down
37 changes: 30 additions & 7 deletions .github/workflows/smoke-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ env:
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}

jobs:
test_llc:
name: Test LLC
test_core:
name: Test Core
runs-on: macos-15
steps:
- uses: actions/checkout@v4.1.1
Expand All @@ -36,8 +36,8 @@ jobs:
env:
INSTALL_YEETD: true
INSTALL_SONAR: true
- name: Run LLC Tests (Debug)
run: bundle exec fastlane test device:"${{ env.IOS_SIMULATOR_DEVICE }}"
- name: Run Core Tests (Debug)
run: bundle exec fastlane test_core device:"${{ env.IOS_SIMULATOR_DEVICE }}"
timeout-minutes: 40
- name: Run Sonar analysis
run: bundle exec fastlane sonar_upload
Expand All @@ -48,7 +48,7 @@ jobs:
with:
status: ${{ job.status }}
text: "You shall not pass!"
job_name: "Test LLC (Debug)"
job_name: "Test Core (Debug)"
fields: repo,commit,author,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: failure()
with:
name: Test Data LLC
name: Test Data Core
path: |
fastlane/test_output/logs/*/Diagnostics/**/*.txt
fastlane/test_output/logs/*/Diagnostics/simctl_diagnostics/DiagnosticReports/*
Expand All @@ -88,7 +88,30 @@ jobs:
with:
status: ${{ job.status }}
text: "You shall not pass!"
job_name: "Test LLC (Debug)"
job_name: "Test UI (Debug)"
fields: repo,commit,author,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: ${{ github.event_name == 'push' && failure() }}

test_attachments:
name: Test Attachments
runs-on: macos-15
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
- uses: ./.github/actions/bootstrap
env:
INSTALL_YEETD: true
- name: Run Attachments Tests (Debug)
run: bundle exec fastlane test_attachments device:"${{ env.IOS_SIMULATOR_DEVICE }}"
timeout-minutes: 40
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: "You shall not pass!"
job_name: "Test Attachments (Debug)"
fields: repo,commit,author,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
5 changes: 4 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
--rules redundantRawValues
--rules redundantVoidReturnType
--rules semicolons
--rules sortedImports
--rules sortImports
--rules spaceAroundBraces
--rules spaceAroundBrackets
--rules spaceAroundComments
Expand Down Expand Up @@ -78,3 +78,6 @@
--wraparguments before-first
--wrapparameters before-first
--wrapcollections before-first

# Exclude paths
--exclude Sources/StreamCore/Generated,Sources/StreamCore/generated,vendor/bundle,Pods,spm_cache,derived_data,.build
7 changes: 0 additions & 7 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ excluded:
- .ruby-lsp
- .swiftpm
- derived_data
- fastlane
- Package.swift
- Scripts
- Sources/StreamCore/Generated
- Sources/StreamCore/generated
- spm_cache
Expand Down Expand Up @@ -50,7 +47,6 @@ only_rules:
- trailing_comma
- trailing_newline
- trailing_semicolon
- trailing_whitespace
- unneeded_break_in_switch
- unneeded_override
- unused_closure_parameter
Expand All @@ -62,8 +58,5 @@ only_rules:
multiline_arguments:
only_enforce_after_first_closure_on_first_line: true

trailing_whitespace:
ignores_empty_lines: true

file_name_no_space:
severity: error
20 changes: 17 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,37 @@ let package = Package(
.library(
name: "StreamCoreUI",
targets: ["StreamCoreUI"]
),
// Features
.library(
name: "StreamAttachments",
targets: ["StreamAttachments"]
)
],
targets: [
.target(
name: "StreamCore"
),
.testTarget(
name: "StreamCoreTests",
dependencies: ["StreamCore"]
),
.target(
name: "StreamCoreUI",
dependencies: ["StreamCore"]
),
.testTarget(
name: "StreamCoreTests",
name: "StreamCoreUITests",
dependencies: ["StreamCoreUI"]
),
// Features
.target(
name: "StreamAttachments",
dependencies: ["StreamCore"]
),
.testTarget(
name: "StreamCoreUITests",
dependencies: ["StreamCoreUI"]
name: "StreamAttachmentsTests",
dependencies: ["StreamAttachments"]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A protocol an attachment payload type has to conform in order it can be
/// attached to/exposed on the message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

enum AttachmentCodingKeys: String, CodingKey, CaseIterable {
case title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type representing a content attachment.
/// `StreamAttachment<Payload>` is an immutable snapshot of the attachment at the given time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type alias for attachment with `AudioAttachmentPayload` payload type.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type alias for attachment with `FileAttachmentPayload` payload type.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type alias for attachment with `GiphyAttachmentPayload` payload type.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type alias for attachment with `ImageAttachmentPayload` payload type.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type alias for attachment with `VideoAttachmentPayload` payload type.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// A type alias for attachment with `VoiceRecordingAttachmentPayload` payload type.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// An uploaded file.
public struct UploadedFile: Decodable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

public struct Endpoint<ResponseType: Decodable>: Codable {
let path: EndpointPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// An object responsible for handling incoming URL request response and decoding it.
public protocol RequestDecoder: Sendable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//

import Foundation
import StreamCore

/// On object responsible for creating a `URLRequest`, and encoding all required and `Endpoint` specific data to it.
public protocol RequestEncoder: Sendable {
Expand Down
22 changes: 22 additions & 0 deletions Sources/StreamAttachments/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.4.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Sources/StreamCore/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.3.0</string>
<string>0.4.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
Expand Down
30 changes: 24 additions & 6 deletions Sources/StreamCore/Logger/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ public struct LogSubsystem: OptionSet, CustomStringConvertible, Sendable {
.audioSession,
.videoCapturer,
.pictureInPicture,
.callKit
.callKit,
.authentication,
.audioPlayback,
.audioRecording
]

/// All subsystems within the SDK.
Expand All @@ -52,7 +55,10 @@ public struct LogSubsystem: OptionSet, CustomStringConvertible, Sendable {
.audioSession,
.videoCapturer,
.pictureInPicture,
.callKit
.callKit,
.authentication,
.audioPlayback,
.audioRecording
]

/// The subsystem responsible for any other part of the SDK.
Expand Down Expand Up @@ -88,6 +94,12 @@ public struct LogSubsystem: OptionSet, CustomStringConvertible, Sendable {
public static let pictureInPicture = Self(rawValue: 1 << 14)
/// The subsystem responsible for PicutreInPicture.
public static let callKit = Self(rawValue: 1 << 15)
/// The subsystem responsible for authentication.
public static let authentication = Self(rawValue: 1 << 16)
/// The subsystem responsible for audio playback.
public static let audioPlayback = Self(rawValue: 1 << 17)
/// The subsystem responsible for audio recording.
public static let audioRecording = Self(rawValue: 1 << 18)

public var description: String {
switch rawValue {
Expand Down Expand Up @@ -123,6 +135,12 @@ public struct LogSubsystem: OptionSet, CustomStringConvertible, Sendable {
"picture-in-picture"
case LogSubsystem.callKit.rawValue:
"CallKit"
case LogSubsystem.authentication.rawValue:
"authentication"
case LogSubsystem.audioPlayback.rawValue:
"audio-playback"
case LogSubsystem.audioRecording.rawValue:
"audio-recording"
default:
"unknown(rawValue:\(rawValue)"
}
Expand Down Expand Up @@ -418,7 +436,7 @@ public enum LogConfig {
}

/// Entity used for logging messages.
public class Logger {
open class Logger {
/// Identifier of the Logger. Will be visible if a destination has `showIdentifiers` enabled.
public let identifier: String

Expand Down Expand Up @@ -619,7 +637,7 @@ public class Logger {
/// - Parameters:
/// - condition: The condition to test.
/// - message: A custom message to log if `condition` is evaluated to false.
public func assert(
open func assert(
_ condition: @autoclosure () -> Bool,
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
Expand Down Expand Up @@ -647,7 +665,7 @@ public class Logger {
///
/// - Parameters:
/// - message: A custom message to log if `condition` is evaluated to false.
public func assertionFailure(
open func assertionFailure(
_ message: @autoclosure () -> Any,
subsystems: LogSubsystem = .other,
functionName: StaticString = #function,
Expand Down Expand Up @@ -688,7 +706,7 @@ private extension Logger {

extension Data {
/// Converts the data into a pretty-printed JSON string. Use only for debug purposes since this operation can be expensive.
var debugPrettyPrintedJSON: String {
public var debugPrettyPrintedJSON: String {
do {
let jsonObject = try JSONSerialization.jsonObject(with: self, options: [])
let prettyPrintedData = try JSONSerialization.data(withJSONObject: jsonObject, options: [.prettyPrinted, .sortedKeys])
Expand Down
Loading
Loading