-
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.
* Update SwiftSyntax * update script * fixes * Restore script
- Loading branch information
Showing
9 changed files
with
99 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
DerivedData/ | ||
Package_generated.swift | ||
package-generator-cli.artifactbundle/ | ||
xcuserdata/ | ||
xcuserdata/ | ||
.swiftpm/ |
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 was deleted.
Oops, something went wrong.
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,25 @@ | ||
import Foundation | ||
|
||
public struct PackageInformation: Codable { | ||
public struct PathInfo: Codable { | ||
public let path: String | ||
public let name: String | ||
} | ||
public let test: PathInfo? | ||
public let target: PathInfo | ||
|
||
public init(from decoder: any Decoder) throws { | ||
// Legacy Parser | ||
let stringContainer = try decoder.singleValueContainer() | ||
if let pathString = try? stringContainer.decode(String.self) { | ||
let path = URL(fileURLWithPath: pathString) | ||
self.target = PathInfo(path: pathString, name: path.lastPathComponent) | ||
self.test = nil | ||
return | ||
} | ||
|
||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
self.test = try container.decodeIfPresent(PackageInformation.PathInfo.self, forKey: .test) | ||
self.target = try container.decode(PackageInformation.PathInfo.self, forKey: .target) | ||
} | ||
} |
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,31 @@ | ||
import Foundation | ||
|
||
public struct ParsedPackage: Codable, CustomStringConvertible { | ||
public var name: String | ||
public var test: PackageInformation.PathInfo? | ||
public var dependencies: [String] | ||
public var path: String | ||
public var fullPath: String | ||
public var resources: String? | ||
public var localDependencies: Int = 0 | ||
public var hasBiggestNumberOfDependencies: Bool = false | ||
|
||
public var hasResources: Bool { | ||
resources != nil && resources!.isEmpty == false | ||
} | ||
|
||
public var description: String { | ||
"[\(dependencies.count)|\(localDependencies)] \(name) \(hasResources == false ? "" : "/ hasResources")" | ||
} | ||
|
||
public init(name: String, test: PackageInformation.PathInfo? = nil, dependencies: [String], path: String, fullPath: String, resources: String? = nil, localDependencies: Int = 0, hasBiggestNumberOfDependencies: Bool = false) { | ||
self.name = name | ||
self.test = test | ||
self.dependencies = dependencies | ||
self.path = path | ||
self.fullPath = fullPath | ||
self.resources = resources | ||
self.localDependencies = localDependencies | ||
self.hasBiggestNumberOfDependencies = hasBiggestNumberOfDependencies | ||
} | ||
} |
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