mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-23 11:26:54 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
59 lines
1.4 KiB
Swift
59 lines
1.4 KiB
Swift
import Foundation
|
|
import JSONUtilities
|
|
|
|
/// Specifies the use of a plug-in product in a target.
|
|
public struct BuildToolPlugin: Equatable {
|
|
|
|
/// The name of the plug-in target.
|
|
public var plugin: String
|
|
/// The name of the package that defines the plug-in target.
|
|
public var package: String
|
|
|
|
public init(
|
|
plugin: String,
|
|
package: String
|
|
) {
|
|
self.plugin = plugin
|
|
self.package = package
|
|
}
|
|
}
|
|
|
|
extension BuildToolPlugin: JSONObjectConvertible {
|
|
|
|
public init(jsonDictionary: JSONDictionary) throws {
|
|
if let plugin: String = jsonDictionary.json(atKeyPath: "plugin") {
|
|
self.plugin = plugin
|
|
} else {
|
|
throw SpecParsingError.invalidDependency(jsonDictionary)
|
|
}
|
|
|
|
if let package: String = jsonDictionary.json(atKeyPath: "package") {
|
|
self.package = package
|
|
} else {
|
|
throw SpecParsingError.invalidDependency(jsonDictionary)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension BuildToolPlugin {
|
|
public var uniqueID: String {
|
|
return "\(plugin)/\(package)"
|
|
}
|
|
}
|
|
|
|
extension BuildToolPlugin: Hashable {
|
|
public func hash(into hasher: inout Hasher) {
|
|
hasher.combine(plugin)
|
|
hasher.combine(package)
|
|
}
|
|
}
|
|
|
|
extension BuildToolPlugin: JSONEncodable {
|
|
public func toJSONValue() -> Any {
|
|
[
|
|
"plugin": plugin,
|
|
"package": package
|
|
]
|
|
}
|
|
}
|