Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tvOS support #778

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ branches:
script:
- set -o pipefail && xcodebuild test -project Macaw.xcodeproj -scheme 'Macaw iOS' -sdk iphonesimulator13.5 ONLY_ACTIVE_ARCH=NO -destination 'platform=iOS Simulator,OS=13.5,name=iPhone 11 Pro' | xcpretty;
- set -o pipefail && xcodebuild test -project Macaw.xcodeproj -scheme 'MacawOSX' ONLY_ACTIVE_ARCH=NO | xcpretty;

- set -o pipefail && xcodebuild build -project Macaw.xcodeproj -scheme 'MacawTV' ONLY_ACTIVE_ARCH=NO | xcpretty;

notifications:
slack: exyte:kdo9FNtTOFMuMqAyyvZPDAD7
1 change: 1 addition & 0 deletions Macaw.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Pod::Spec.new do |s|

s.ios.deployment_target = "9.0"
s.osx.deployment_target = "10.12"
s.tvos.deployment_target = "10.0"
s.requires_arc = true
s.swift_version = "5.3"

Expand Down
431 changes: 424 additions & 7 deletions Macaw.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions Macaw.xcodeproj/xcshareddata/xcschemes/MacawTV.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EF78802327220CE8006E331E"
BuildableName = "MacawTV.framework"
BlueprintName = "MacawTV"
ReferencedContainer = "container:Macaw.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "EF78802327220CE8006E331E"
BuildableName = "MacawTV.framework"
BlueprintName = "MacawTV"
ReferencedContainer = "container:Macaw.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 2 additions & 0 deletions MacawTests/Animation/AnimationUtilsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class AnimationUtilsTests: XCTestCase {
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/Animation/CombineAnimationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class CombineAnimationTests: XCTestCase {
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/Animation/ControlStatesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class ControlStatesTests: XCTestCase {
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/Animation/DelayedAnimationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class DelayedAnimationTests: XCTestCase {
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/Animation/SequenceAnimationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class SequenceAnimationTests: XCTestCase {
Expand Down
10 changes: 6 additions & 4 deletions MacawTests/Bounds/ImageBoundsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class ImageBoundsTests: XCTestCase {
Expand All @@ -29,7 +31,7 @@ class ImageBoundsTests: XCTestCase {
return
}

#if os(iOS)
#if os(iOS) || os(tvOS)
XCTAssert(bounds.w == 1174.0 && bounds.h == 862.0, "Wrong bounds for path src")
#elseif os(OSX)
XCTAssert(bounds.w == 587.0 && bounds.h == 431.0, "Wrong bounds for path src")
Expand All @@ -55,7 +57,7 @@ class ImageBoundsTests: XCTestCase {
return
}

#if os(iOS)
#if os(iOS) || os(tvOS)
XCTAssert(bounds.w == 1174.0 && bounds.h == 862.0, "Wrong bounds for base64 src")
#elseif os(OSX)
XCTAssert(bounds.w == 587.0 && bounds.h == 431.0, "Wrong bounds for base64 src")
Expand All @@ -65,7 +67,7 @@ class ImageBoundsTests: XCTestCase {
func testInMemoryImage() {
let bundle = Bundle(for: type(of: TestUtils()))

#if os(iOS)
#if os(iOS) || os(tvOS)
guard let mImage = MImage(named: "logo.png", in: bundle, compatibleWith: .none) else {
XCTFail()
return
Expand All @@ -84,7 +86,7 @@ class ImageBoundsTests: XCTestCase {
return
}

#if os(iOS)
#if os(iOS) || os(tvOS)
XCTAssert(bounds.w == 1174.0 && bounds.h == 862.0, "Wrong bounds for in-memory image")
#elseif os(OSX)
XCTAssert(bounds.w == 587.0 && bounds.h == 431.0, "Wrong bounds for in-memory image")
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/Bounds/NodeBoundsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class NodeBoundsTests: XCTestCase {
Expand Down
10 changes: 6 additions & 4 deletions MacawTests/MacawSVGTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class MacawSVGTests: XCTestCase {
Expand Down Expand Up @@ -259,7 +261,7 @@ class MacawSVGTests: XCTestCase {
}
#endif

#if os(iOS)
#if os(iOS) || os(tvOS)
guard let referenceContentData = referenceImage.pngData() else {
XCTFail("Failed to get Data from png \(referenceFile).png")
return
Expand Down Expand Up @@ -312,7 +314,7 @@ class MacawSVGTests: XCTestCase {
}
#endif

#if os(iOS)
#if os(iOS) || os(tvOS)
if #available(iOS 11.0, *) {
return try JSONSerialization.data(withJSONObject: serializableNode.toDictionary(), options: [.prettyPrinted, .sortedKeys])
} else {
Expand Down Expand Up @@ -647,7 +649,7 @@ class MacawSVGTests: XCTestCase {
}

func testColorProp04() {
#if os(iOS)
#if os(iOS) || os(tvOS)
validateJSON("color-prop-04-t-manual")
#elseif os(OSX)
validateJSON("color-prop-04-t-manual-osx")
Expand Down Expand Up @@ -853,7 +855,7 @@ class MacawSVGTests: XCTestCase {
}
#endif

#if os(iOS)
#if os(iOS) || os(tvOS)
guard let data = image.pngData() else {
return
}
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/MacawTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class MacawTests: XCTestCase {
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/SVGParserTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import XCTest
@testable import MacawOSX
#elseif os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class SVGParserTest: XCTestCase {
Expand Down
5 changes: 4 additions & 1 deletion MacawTests/SceneSerialization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import Foundation
#if os(iOS)
import UIKit
@testable import Macaw
#elseif os(tvOS)
import UIKit
@testable import MacawTV
#endif

protocol Initializable {
Expand Down Expand Up @@ -374,7 +377,7 @@ extension Path: Serializable {
}
}

#if os(iOS)
#if os(iOS) || os(tvOS)
extension Polygon: Serializable {

func toDictionary() -> [String:Any] {
Expand Down
2 changes: 2 additions & 0 deletions MacawTests/TestUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Foundation

#if os(iOS)
@testable import Macaw
#elseif os(tvOS)
@testable import MacawTV
#endif

class TestUtils {
Expand Down
2 changes: 1 addition & 1 deletion Source/MCAMediaTimingFillMode_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit

public struct MCAMediaTimingFillMode {
Expand Down
2 changes: 1 addition & 1 deletion Source/MCAMediaTimingFunctionName_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit

public struct MCAMediaTimingFunctionName {
Expand Down
2 changes: 1 addition & 1 deletion Source/MCAShapeLayerLineCap_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit

public struct MCAShapeLayerLineCap {
Expand Down
2 changes: 1 addition & 1 deletion Source/MCAShapeLayerLineJoin_iOS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit

public struct MCAShapeLayerLineJoin {
Expand Down
2 changes: 1 addition & 1 deletion Source/animation/AnimationProducer.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
2 changes: 1 addition & 1 deletion Source/animation/Easing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
//

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Alisa Mylnikova on 17/12/2018.
//

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

#if os(iOS)
#if os(iOS) || os(tvOS)
import UIKit
#elseif os(OSX)
import AppKit
Expand Down
Loading