Skip to content

Commit

Permalink
Merge pull request #43 from igorcferreira/feature/watchOS_support
Browse files Browse the repository at this point in the history
Include watchOS support
  • Loading branch information
igorcferreira authored Apr 13, 2022
2 parents dfb40b4 + 56960ad commit 1cac368
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let packageName = "GIFImage"
let package = Package(
name: packageName,
platforms: [
.macOS(.v12), .iOS(.v15), .tvOS(.v15)
.macOS(.v12), .iOS(.v15), .tvOS(.v15), .watchOS(.v8)
],
products: [
.library(name: packageName, targets: [packageName])
Expand Down
2 changes: 1 addition & 1 deletion Sources/domain/CGImageSourceFrameSequence.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import CoreImage
import ImageIO

public struct CGImageSourceFrameSequence: AsyncSequence {
public typealias Element = ImageFrame
Expand Down
2 changes: 1 addition & 1 deletion Sources/domain/CGImageSourceIterator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import CoreImage
import ImageIO

public struct CGImageSourceIterator: AsyncIteratorProtocol {

Expand Down
2 changes: 1 addition & 1 deletion Sources/extension/CFString+GIFImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import CoreImage
import ImageIO

extension CFString {
var asKey: UnsafeMutableRawPointer {
Expand Down
2 changes: 1 addition & 1 deletion Sources/extension/CGImageSource+GIFImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import CoreImage
import ImageIO

extension CGImageSource {
func intervalAtIndex(_ index: Int) -> TimeInterval? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/extension/Data+GIFImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import CoreImage
import ImageIO

extension Data {
func imageAsyncSequence(loop: Bool) throws -> CGImageSourceFrameSequence {
Expand Down
3 changes: 2 additions & 1 deletion Sources/model/ImageFrame.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// Created by Igor Ferreira on 29/10/2020.
//

import CoreImage
import ImageIO
import Foundation

public struct ImageFrame {
public let image: CGImage
Expand Down
2 changes: 1 addition & 1 deletion Sources/model/RawImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Igor Ferreira on 05/04/2022.
//

import CoreImage
import ImageIO
import SwiftUI
#if os(macOS)
import AppKit
Expand Down
4 changes: 4 additions & 0 deletions Tests/ImageLoaderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ class ImageLoaderTests: XCTestCase {
_ = try await imageLoader.load(source: GIFSource.remote(url: url), loop: false)
XCTFail("Sequence should throw error")
} catch {
#if os(watchOS)
XCTAssertEqual((error as? URLError)?.code, URLError.Code.init(rawValue: -1001))
#else
XCTAssertEqual((error as? URLError)?.code, URLError.Code.badURL)
#endif
}
}

Expand Down
7 changes: 7 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ workflows:
- project_path: $WORKSPACE_PATH
- xcodebuild_options: $BUILD_OPTIONS
title: Xcode Test for tvOS
- xcode-test@4:
inputs:
- scheme: $BUILD_SCHEME
- destination: 'platform=watchOS Simulator,name=Apple Watch Series 7 - 41mm,OS=latest'
- project_path: $WORKSPACE_PATH
- xcodebuild_options: $BUILD_OPTIONS
title: Xcode Test for watchOS
- deploy-to-bitrise-io@2: {}
meta:
bitrise.io:
Expand Down

0 comments on commit 1cac368

Please sign in to comment.