Add basic ExtensionPoint support.

This commit is contained in:
Maurice Parker
2020-04-07 15:25:33 -05:00
parent f8667be32b
commit 49cff8eb8e
29 changed files with 299 additions and 140 deletions

View 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
}
}