forked from yonaskolb/XcodeGen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for adding build tool plugins to targets (yonaskolb#1374)
* Add support for adding build tool plugins to targets * Added Plugin validation * Added some tests * Limited the minimum version to 5.7 Swift * Update .gitignore Co-authored-by: freddi(Yuki Aki) <[email protected]> * Update CHANGELOG.md Co-authored-by: freddi(Yuki Aki) <[email protected]> * Update CHANGELOG.md Co-authored-by: freddi(Yuki Aki) <[email protected]> * Update Docs/ProjectSpec.md Co-authored-by: freddi(Yuki Aki) <[email protected]> * Added a fixture for testing plugins * Update CHANGELOG.md * Installed the release version of XcodeProj --------- Co-authored-by: freddi(Yuki Aki) <[email protected]>
- Loading branch information
1 parent
2ef94c9
commit d8d5457
Showing
14 changed files
with
323 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,95 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "AEXML", | ||
"repositoryURL": "https://github.com/tadija/AEXML.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", | ||
"version": "4.6.1" | ||
} | ||
}, | ||
{ | ||
"package": "GraphViz", | ||
"repositoryURL": "https://github.com/SwiftDocOrg/GraphViz.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "70bebcf4597b9ce33e19816d6bbd4ba9b7bdf038", | ||
"version": "0.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "JSONUtilities", | ||
"repositoryURL": "https://github.com/yonaskolb/JSONUtilities.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "128d2ffc22467f69569ef8ff971683e2393191a0", | ||
"version": "4.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "PathKit", | ||
"repositoryURL": "https://github.com/kylef/PathKit.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", | ||
"version": "1.0.1" | ||
} | ||
}, | ||
{ | ||
"package": "Rainbow", | ||
"repositoryURL": "https://github.com/onevcat/Rainbow.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "626c3d4b6b55354b4af3aa309f998fae9b31a3d9", | ||
"version": "3.2.0" | ||
} | ||
}, | ||
{ | ||
"package": "Spectre", | ||
"repositoryURL": "https://github.com/kylef/Spectre.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7", | ||
"version": "0.10.1" | ||
} | ||
}, | ||
{ | ||
"package": "SwiftCLI", | ||
"repositoryURL": "https://github.com/jakeheis/SwiftCLI.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "2e949055d9797c1a6bddcda0e58dada16cc8e970", | ||
"version": "6.0.3" | ||
} | ||
}, | ||
{ | ||
"package": "Version", | ||
"repositoryURL": "https://github.com/mxcl/Version", | ||
"state": { | ||
"branch": null, | ||
"revision": "a94b48f36763c05629fc102837398505032dead9", | ||
"version": "2.0.0" | ||
} | ||
}, | ||
{ | ||
"package": "XcodeProj", | ||
"repositoryURL": "https://github.com/tuist/XcodeProj.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "c4d5f9d7f789dd944222be95938810947561e559", | ||
"version": "8.12.0" | ||
} | ||
}, | ||
{ | ||
"package": "Yams", | ||
"repositoryURL": "https://github.com/jpsim/Yams.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6", | ||
"version": "5.0.1" | ||
} | ||
"pins" : [ | ||
{ | ||
"identity" : "aexml", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/tadija/AEXML.git", | ||
"state" : { | ||
"revision" : "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3", | ||
"version" : "4.6.1" | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
}, | ||
{ | ||
"identity" : "graphviz", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/SwiftDocOrg/GraphViz.git", | ||
"state" : { | ||
"revision" : "70bebcf4597b9ce33e19816d6bbd4ba9b7bdf038", | ||
"version" : "0.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "jsonutilities", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/yonaskolb/JSONUtilities.git", | ||
"state" : { | ||
"revision" : "128d2ffc22467f69569ef8ff971683e2393191a0", | ||
"version" : "4.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "pathkit", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kylef/PathKit.git", | ||
"state" : { | ||
"revision" : "3bfd2737b700b9a36565a8c94f4ad2b050a5e574", | ||
"version" : "1.0.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "rainbow", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/onevcat/Rainbow.git", | ||
"state" : { | ||
"revision" : "626c3d4b6b55354b4af3aa309f998fae9b31a3d9", | ||
"version" : "3.2.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "spectre", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/kylef/Spectre.git", | ||
"state" : { | ||
"revision" : "26cc5e9ae0947092c7139ef7ba612e34646086c7", | ||
"version" : "0.10.1" | ||
} | ||
}, | ||
{ | ||
"identity" : "swiftcli", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/jakeheis/SwiftCLI.git", | ||
"state" : { | ||
"revision" : "2e949055d9797c1a6bddcda0e58dada16cc8e970", | ||
"version" : "6.0.3" | ||
} | ||
}, | ||
{ | ||
"identity" : "version", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/mxcl/Version", | ||
"state" : { | ||
"revision" : "a94b48f36763c05629fc102837398505032dead9", | ||
"version" : "2.0.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "xcodeproj", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/tuist/XcodeProj.git", | ||
"state" : { | ||
"revision" : "6e60fb55271c80f83a186c9b1b4982fd991cfc0a", | ||
"version" : "8.13.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "yams", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/jpsim/Yams.git", | ||
"state" : { | ||
"revision" : "01835dc202670b5bb90d07f3eae41867e9ed29f6", | ||
"version" : "5.0.1" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
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 | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.