Add deprecation annotation to the context classes

This commit is contained in:
Pedro Piñera 2018-07-21 10:15:43 -04:00
parent 5bef671990
commit ee400ee73e
3 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import Foundation
import xpmcore
/// Generator context protocol.
@available(*, deprecated, message: "The context approach for injecting dependencies is deprecated. Inject dependencies through the constructor instead.")
protocol GeneratorContexting: Contexting {
/// Graph that is beging generated.
var graph: Graphing { get }

View File

@ -3,6 +3,7 @@ import Foundation
import xpmcore
/// Protocol that defines the interface of the context that is used during the graph loading.
@available(*, deprecated, message: "The context approach for injecting dependencies is deprecated. Inject dependencies through the constructor instead.")
protocol GraphLoaderContexting: Contexting {
/// Manifest loader that is used to get a JSON representation of the manifests.
var manifestLoader: GraphManifestLoading { get }

View File

@ -2,6 +2,7 @@ import Foundation
import xpmcore
/// Context protocol.
@available(*, deprecated, message: "The context approach for injecting dependencies is deprecated. Inject dependencies through the constructor instead.")
protocol Contexting: AnyObject {
/// Shell.
var shell: Shelling { get }
@ -18,6 +19,7 @@ protocol Contexting: AnyObject {
/// xpm uses contexts as a dependency injection mechanism.
/// Contexts are initialized by the commands and passed to the different components that will use the dependencies defined in them.
@available(*, deprecated, message: "The context approach for injecting dependencies is deprecated. Inject dependencies through the constructor instead.")
class Context: Contexting {
/// Util to handle files.
let fileHandler: FileHandling