Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support test target for local Swift Package #1169

Merged
merged 27 commits into from
Mar 20, 2022
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
81de1e5
support local Swift Package test case into test scheme
freddi-kit May 5, 2021
2fb1d01
update test
freddi-kit May 5, 2021
70c0e0d
add test
freddi-kit May 5, 2021
f1f0df5
update CHABGELOG.md
freddi-kit May 5, 2021
5474cc5
Update CHANGELOG.md
freddi-kit May 5, 2021
a58383e
revert resolved package test
freddi-kit May 6, 2021
b4b8635
Update Sources/XcodeGenKit/SchemeGenerator.swift
freddi-kit May 6, 2021
fc1ec31
make TargetReference convert from new JSON format
freddi-kit May 7, 2021
9022364
add .package for location of target reference
freddi-kit May 13, 2021
68c29dc
Merge branch 'test-local-spm' of github.com:yonaskolb/XcodeGen into t…
freddi-kit May 13, 2021
9de7623
receive target reference format at target of scheme
freddi-kit May 13, 2021
4ed02a4
update test
freddi-kit May 13, 2021
b8c8aab
update XcodeProj
freddi-kit May 25, 2021
9fd8d2e
Merge branch 'master' into test-local-spm
freddi-kit May 25, 2021
1cda325
add test and fix small bugs
freddi-kit May 25, 2021
f29af31
update docs
freddi-kit May 25, 2021
52d9d81
support multiple style of coverageTargets
freddi-kit May 25, 2021
86ca040
add edge case of parsing test targets
freddi-kit May 25, 2021
69d0072
fix docs
freddi-kit May 25, 2021
6bfa5dc
Update Docs/ProjectSpec.md
freddi-kit Jun 18, 2021
1d746d5
create TestableTargetReference for not making API complex
freddi-kit Oct 20, 2021
771edd4
fix code format
freddi-kit Oct 20, 2021
53a9c34
Merge branch 'master' into test-local-spm
freddi-kit Oct 20, 2021
487d25c
fix parameter name to Testable Target Reference
freddi-kit Oct 20, 2021
66ff567
support directly writing key of Testable Target Reference
freddi-kit Feb 2, 2022
a969634
Merge branch 'master' into test-local-spm
freddi-kit Feb 2, 2022
54ab164
fix compile error in build
freddi-kit Feb 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
make TargetReference convert from new JSON format
  • Loading branch information
freddi-kit committed May 13, 2021
commit fc1ec31dda6613f02b1465de78f208c655d7e98a
27 changes: 27 additions & 0 deletions Sources/ProjectSpec/TargetReference.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,30 @@ extension TargetReference: CustomStringConvertible {
reference
}
}

extension TargetReference: JSONObjectConvertible {

public init(jsonDictionary: JSONDictionary) throws {
if let project: String = jsonDictionary.json(atKeyPath: "project") {
let paths = project.split(separator: "/")
name = String(paths[1])
location = .project(String(paths[0]))
} else {
name = try jsonDictionary.json(atKeyPath: "local")
location = .local
}
}
}

extension TargetReference: JSONEncodable {
public func toJSONValue() -> Any {
var dictionary: JSONDictionary = [:]
switch self.location {
case .project(let projectName):
dictionary["project"] = "\(projectName)/\(name)"
case .local:
dictionary["local"] = name
}
return dictionary
}
}