mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add basic ExtensionPoint support.
This commit is contained in:
49
Shared/ExtensionPoints/ExtensionPointManager.swift
Normal file
49
Shared/ExtensionPoints/ExtensionPointManager.swift
Normal file
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// ExtensionPointManager.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 4/7/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import FeedProvider
|
||||
import RSCore
|
||||
|
||||
struct ExtensionPointManager {
|
||||
|
||||
static let shared = ExtensionPointManager()
|
||||
|
||||
let marsEdit = SendToMarsEditCommand()
|
||||
let microblog = SendToMicroBlogCommand()
|
||||
let twitter = TwitterFeedProvider()
|
||||
|
||||
let availableExtensionPoints: [ExtensionPoint]
|
||||
let activeSendToCommands: [SendToCommand]
|
||||
let activeFeedProviders: [FeedProvider]
|
||||
|
||||
init() {
|
||||
#if os(macOS)
|
||||
#if DEBUG
|
||||
availableExtensionPoints = [marsEdit, microblog, twitter]
|
||||
activeSendToCommands = [marsEdit, microblog]
|
||||
activeFeedProviders = [twitter]
|
||||
#else
|
||||
availableExtensionPoints = [marsEdit, microblog, twitter]
|
||||
activeSendToCommands = [marsEdit, microblog]
|
||||
activeFeedProviders = [twitter]
|
||||
#endif
|
||||
#else
|
||||
#if DEBUG
|
||||
availableExtensionPoints = [twitter]
|
||||
activeSendToCommands = []()
|
||||
activeFeedProviders = [twitter]
|
||||
#else
|
||||
availableExtensionPoints = [twitter]
|
||||
activeSendToCommands = []()
|
||||
activeFeedProviders = [twitter]
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user