mirror of
https://github.com/mas-cli/mas
synced 2025-02-16 12:38:30 +00:00
🧱 Import only Foundation instead of Cocoa
This commit is contained in:
parent
99bd7533b1
commit
f28c2a4232
15 changed files with 23 additions and 3 deletions
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2018 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Utility for managing installed apps.
|
||||
public protocol AppLibrary {
|
||||
/// Entire set of installed apps.
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2018 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Manages searching the MAS catalog through the iTunes Search and Lookup APIs.
|
||||
public class MasStoreSearch: StoreSearch {
|
||||
private let networkManager: NetworkManager
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2018 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Protocol for searching the MAS catalog.
|
||||
public protocol StoreSearch {
|
||||
func lookup(app appId: Int) throws -> SearchResult?
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2019 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// CLI command
|
||||
public protocol ExternalCommand {
|
||||
var binaryPath: String { get set }
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2019 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Wrapper for the external open system command.
|
||||
/// https://ss64.com/osx/open.html
|
||||
public struct OpenSystemCommand: ExternalCommand {
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2016 Andrew Naylor. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// A collection of output formatting helpers
|
||||
|
||||
/// Terminal Control Sequence Indicator
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2018 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Protocol describing the members of CKSoftwareProduct used throughout MasKit.
|
||||
public protocol SoftwareProduct {
|
||||
var appName: String { get }
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2019 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum NetworkResult {
|
||||
case success(Data)
|
||||
case failure(Error)
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
// Copyright © 2019 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
@objc public protocol NetworkSession {
|
||||
@objc func loadData(from url: URL, completionHandler: @escaping (Data?, Error?) -> Void)
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// Copyright © 2018 Andrew Naylor. All rights reserved.
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
@import Foundation;
|
||||
|
||||
//! Project version number for MasKit.
|
||||
FOUNDATION_EXPORT double MasKitVersionNumber;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright © 2019 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import MasKit
|
||||
|
||||
class OpenSystemCommandMock: ExternalCommand {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright © 2018 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
@testable import MasKit
|
||||
|
||||
struct SoftwareProductMock: SoftwareProduct {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright © 2018 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import MasKit
|
||||
|
||||
/// Mock NetworkSession for testing.
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright © 2019 mas-cli. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import MasKit
|
||||
|
||||
/// Mock NetworkSession for testing with saved JSON response payload files.
|
||||
|
|
|
@ -290,7 +290,6 @@
|
|||
F80B27B52611116A00A285C9 /* AppListFormatterSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppListFormatterSpec.swift; sourceTree = "<group>"; };
|
||||
F80B27B92611118E00A285C9 /* AppListFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppListFormatter.swift; sourceTree = "<group>"; };
|
||||
F8242D8020746A510026DF35 /* StoreAccount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAccount.swift; sourceTree = "<group>"; };
|
||||
F83213A42173EF75008BA8A0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
F83213A52173EF75008BA8A0 /* StoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreFoundation.framework; path = /System/Library/PrivateFrameworks/StoreFoundation.framework; sourceTree = "<absolute>"; };
|
||||
F83213A62173EF75008BA8A0 /* CommerceKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CommerceKit.framework; path = /System/Library/PrivateFrameworks/CommerceKit.framework; sourceTree = "<absolute>"; };
|
||||
F85DA8AD240C313900FE5650 /* MasAppLibrarySpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasAppLibrarySpec.swift; sourceTree = "<group>"; };
|
||||
|
@ -639,7 +638,6 @@
|
|||
EDFC76381B642A2E00D0DBD7 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F83213A42173EF75008BA8A0 /* Cocoa.framework */,
|
||||
F83213A62173EF75008BA8A0 /* CommerceKit.framework */,
|
||||
F83213A52173EF75008BA8A0 /* StoreFoundation.framework */,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue