tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
xcodegen: init
Sam
1 year ago
a0d07c62
8dacc3a6
+304
4 changed files
expand all
collapse all
unified
split
pkgs
by-name
xc
xcodegen
0001-spectre-xct-record.patch
nix
default.nix
workspace-state.json
package.nix
+34
pkgs/by-name/xc/xcodegen/0001-spectre-xct-record.patch
···
1
1
+
diff --git a/Sources/Spectre/XCTest.swift b/Sources/Spectre/XCTest.swift
2
2
+
index 3704436..e759f14 100644
3
3
+
--- a/Sources/Spectre/XCTest.swift
4
4
+
+++ b/Sources/Spectre/XCTest.swift
5
5
+
@@ -31,28 +31,6 @@ class XcodeReporter: ContextReporter {
6
6
+
func addDisabled(_ name: String) {}
7
7
+
8
8
+
func addFailure(_ name: String, failure: FailureType) {
9
9
+
- // Xcode 12 removed `recordFailure` and replaced with `record(_:)`
10
10
+
- #if swift(>=4.2)
11
11
+
- // The `compiler` statement was added in swift 4.2, so it needs to be in a separate statement to retain
12
12
+
- // compatibility with 4.x.
13
13
+
- #if compiler(>=5.3) && os(macOS)
14
14
+
- let location = XCTSourceCodeLocation(filePath: failure.file, lineNumber: failure.line)
15
15
+
- #if Xcode
16
16
+
- // As of Xcode 12.0.1, XCTIssue is unavailable even though it is documented:
17
17
+
- // https://developer.apple.com/documentation/xctest/xctissue
18
18
+
- // When building with `swift build`, it is available. Perhaps the xctest overlay behaves differently between the two.
19
19
+
- let issue = XCTIssueReference(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
20
20
+
- #else
21
21
+
- let issue = XCTIssue(type: .assertionFailure, compactDescription: "\(name): \(failure.reason)", detailedDescription: nil, sourceCodeContext: .init(location: location), associatedError: nil, attachments: [])
22
22
+
- #endif
23
23
+
- #if compiler(>=5.4)
24
24
+
- testCase.record(issue as XCTIssue)
25
25
+
- #else
26
26
+
- testCase.record(issue)
27
27
+
- #endif
28
28
+
- #else
29
29
+
testCase.recordFailure(withDescription: "\(name): \(failure.reason)", inFile: failure.file, atLine: failure.line, expected: false)
30
30
+
- #endif
31
31
+
- #endif
32
32
+
}
33
33
+
}
34
34
+
\ No newline at end of file
+16
pkgs/by-name/xc/xcodegen/nix/default.nix
···
1
1
+
# This file was generated by swiftpm2nix.
2
2
+
{
3
3
+
workspaceStateFile = ./workspace-state.json;
4
4
+
hashes = {
5
5
+
"AEXML" = "sha256-bQcXq1aS76sOjW8yYCOlGVZ2tStDvzRQSyj9VrAj6nI=";
6
6
+
"ArtifactBundleGen" = "sha256-mSXJiRGFIm2RtzBG8l6s4RJ2BzSbPZKUZIqWM4vDIhc=";
7
7
+
"JSONUtilities" = "sha256-jl8XfgoB5IX0qwwDtzcWgK0u3SNG2HfrPoEb2a6/mlA=";
8
8
+
"PathKit" = "sha256-ewxTC1kpu6PXhwamCxYfI50ooYO1SIU0+IXH2tc/uv4=";
9
9
+
"Rainbow" = "sha256-zmd/wGFX0AYRvwecqQerlxDETMuBqQM+Whuf3JezAGM=";
10
10
+
"Spectre" = "sha256-fipGRIgw+jV7Wrxa+xivRk7YMyxDhGFB6SHIHscrmV8=";
11
11
+
"SwiftCLI" = "sha256-PmjzLss0D12iy6YKsudFa8i63NQAssyCBqqq8VjRiH4=";
12
12
+
"Version" = "sha256-4IwQlexWtIH9M0sSai1a+ITTAKkD2zJtbYoV4Cg+Snw=";
13
13
+
"XcodeProj" = "sha256-ycHDzay37YtT/3QqUpG6XPjRh32P5iU/I5GpfjrXs/I=";
14
14
+
"Yams" = "sha256-5qxuCkmopm3uFcoYJKQA8ofW98f53H1gZaPiOh2DS4U=";
15
15
+
};
16
16
+
}
+178
pkgs/by-name/xc/xcodegen/nix/workspace-state.json
···
1
1
+
{
2
2
+
"object": {
3
3
+
"artifacts": [],
4
4
+
"dependencies": [
5
5
+
{
6
6
+
"basedOn": null,
7
7
+
"packageRef": {
8
8
+
"identity": "aexml",
9
9
+
"kind": "remoteSourceControl",
10
10
+
"location": "https://github.com/tadija/AEXML.git",
11
11
+
"name": "AEXML"
12
12
+
},
13
13
+
"state": {
14
14
+
"checkoutState": {
15
15
+
"revision": "38f7d00b23ecd891e1ee656fa6aeebd6ba04ecc3",
16
16
+
"version": "4.6.1"
17
17
+
},
18
18
+
"name": "sourceControlCheckout"
19
19
+
},
20
20
+
"subpath": "AEXML"
21
21
+
},
22
22
+
{
23
23
+
"basedOn": null,
24
24
+
"packageRef": {
25
25
+
"identity": "artifactbundlegen",
26
26
+
"kind": "remoteSourceControl",
27
27
+
"location": "https://github.com/freddi-kit/ArtifactBundleGen",
28
28
+
"name": "ArtifactBundleGen"
29
29
+
},
30
30
+
"state": {
31
31
+
"checkoutState": {
32
32
+
"revision": "707e4ccc4b1c7e48e881cd5ea91e493a95df24bf",
33
33
+
"version": "0.0.6"
34
34
+
},
35
35
+
"name": "sourceControlCheckout"
36
36
+
},
37
37
+
"subpath": "ArtifactBundleGen"
38
38
+
},
39
39
+
{
40
40
+
"basedOn": null,
41
41
+
"packageRef": {
42
42
+
"identity": "jsonutilities",
43
43
+
"kind": "remoteSourceControl",
44
44
+
"location": "https://github.com/yonaskolb/JSONUtilities.git",
45
45
+
"name": "JSONUtilities"
46
46
+
},
47
47
+
"state": {
48
48
+
"checkoutState": {
49
49
+
"revision": "128d2ffc22467f69569ef8ff971683e2393191a0",
50
50
+
"version": "4.2.0"
51
51
+
},
52
52
+
"name": "sourceControlCheckout"
53
53
+
},
54
54
+
"subpath": "JSONUtilities"
55
55
+
},
56
56
+
{
57
57
+
"basedOn": null,
58
58
+
"packageRef": {
59
59
+
"identity": "pathkit",
60
60
+
"kind": "remoteSourceControl",
61
61
+
"location": "https://github.com/kylef/PathKit.git",
62
62
+
"name": "PathKit"
63
63
+
},
64
64
+
"state": {
65
65
+
"checkoutState": {
66
66
+
"revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
67
67
+
"version": "1.0.1"
68
68
+
},
69
69
+
"name": "sourceControlCheckout"
70
70
+
},
71
71
+
"subpath": "PathKit"
72
72
+
},
73
73
+
{
74
74
+
"basedOn": null,
75
75
+
"packageRef": {
76
76
+
"identity": "rainbow",
77
77
+
"kind": "remoteSourceControl",
78
78
+
"location": "https://github.com/onevcat/Rainbow.git",
79
79
+
"name": "Rainbow"
80
80
+
},
81
81
+
"state": {
82
82
+
"checkoutState": {
83
83
+
"revision": "e0dada9cd44e3fa7ec3b867e49a8ddbf543e3df3",
84
84
+
"version": "4.0.1"
85
85
+
},
86
86
+
"name": "sourceControlCheckout"
87
87
+
},
88
88
+
"subpath": "Rainbow"
89
89
+
},
90
90
+
{
91
91
+
"basedOn": null,
92
92
+
"packageRef": {
93
93
+
"identity": "spectre",
94
94
+
"kind": "remoteSourceControl",
95
95
+
"location": "https://github.com/kylef/Spectre.git",
96
96
+
"name": "Spectre"
97
97
+
},
98
98
+
"state": {
99
99
+
"checkoutState": {
100
100
+
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7",
101
101
+
"version": "0.10.1"
102
102
+
},
103
103
+
"name": "sourceControlCheckout"
104
104
+
},
105
105
+
"subpath": "Spectre"
106
106
+
},
107
107
+
{
108
108
+
"basedOn": null,
109
109
+
"packageRef": {
110
110
+
"identity": "swiftcli",
111
111
+
"kind": "remoteSourceControl",
112
112
+
"location": "https://github.com/jakeheis/SwiftCLI.git",
113
113
+
"name": "SwiftCLI"
114
114
+
},
115
115
+
"state": {
116
116
+
"checkoutState": {
117
117
+
"revision": "2e949055d9797c1a6bddcda0e58dada16cc8e970",
118
118
+
"version": "6.0.3"
119
119
+
},
120
120
+
"name": "sourceControlCheckout"
121
121
+
},
122
122
+
"subpath": "SwiftCLI"
123
123
+
},
124
124
+
{
125
125
+
"basedOn": null,
126
126
+
"packageRef": {
127
127
+
"identity": "version",
128
128
+
"kind": "remoteSourceControl",
129
129
+
"location": "https://github.com/mxcl/Version",
130
130
+
"name": "Version"
131
131
+
},
132
132
+
"state": {
133
133
+
"checkoutState": {
134
134
+
"revision": "a94b48f36763c05629fc102837398505032dead9",
135
135
+
"version": "2.0.0"
136
136
+
},
137
137
+
"name": "sourceControlCheckout"
138
138
+
},
139
139
+
"subpath": "Version"
140
140
+
},
141
141
+
{
142
142
+
"basedOn": null,
143
143
+
"packageRef": {
144
144
+
"identity": "xcodeproj",
145
145
+
"kind": "remoteSourceControl",
146
146
+
"location": "https://github.com/tuist/XcodeProj.git",
147
147
+
"name": "XcodeProj"
148
148
+
},
149
149
+
"state": {
150
150
+
"checkoutState": {
151
151
+
"revision": "447c159b0c5fb047a024fd8d942d4a76cf47dde0",
152
152
+
"version": "8.16.0"
153
153
+
},
154
154
+
"name": "sourceControlCheckout"
155
155
+
},
156
156
+
"subpath": "XcodeProj"
157
157
+
},
158
158
+
{
159
159
+
"basedOn": null,
160
160
+
"packageRef": {
161
161
+
"identity": "yams",
162
162
+
"kind": "remoteSourceControl",
163
163
+
"location": "https://github.com/jpsim/Yams.git",
164
164
+
"name": "Yams"
165
165
+
},
166
166
+
"state": {
167
167
+
"checkoutState": {
168
168
+
"revision": "01835dc202670b5bb90d07f3eae41867e9ed29f6",
169
169
+
"version": "5.0.1"
170
170
+
},
171
171
+
"name": "sourceControlCheckout"
172
172
+
},
173
173
+
"subpath": "Yams"
174
174
+
}
175
175
+
]
176
176
+
},
177
177
+
"version": 6
178
178
+
}
+76
pkgs/by-name/xc/xcodegen/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
swiftPackages,
4
4
+
swift,
5
5
+
swiftpm,
6
6
+
swiftpm2nix,
7
7
+
fetchFromGitHub,
8
8
+
versionCheckHook,
9
9
+
nix-update-script,
10
10
+
...
11
11
+
}:
12
12
+
13
13
+
let
14
14
+
# Pass the generated files to the helper.
15
15
+
generated = swiftpm2nix.helpers ./nix;
16
16
+
in
17
17
+
18
18
+
swiftPackages.stdenv.mkDerivation (finalAttrs: {
19
19
+
pname = "xcodegen";
20
20
+
version = "2.42.0";
21
21
+
22
22
+
src = fetchFromGitHub {
23
23
+
owner = "yonaskolb";
24
24
+
repo = "XcodeGen";
25
25
+
tag = finalAttrs.version;
26
26
+
hash = "sha256-wcjmADG+XnS2kR8BHe6ijApomucS9Tx7ZRjWZmTCUiI=";
27
27
+
};
28
28
+
29
29
+
# Including SwiftPM as a nativeBuildInput provides a buildPhase for you.
30
30
+
# This by default performs a release build using SwiftPM, essentially:
31
31
+
# swift build -c release
32
32
+
nativeBuildInputs = [
33
33
+
swift
34
34
+
swiftpm
35
35
+
];
36
36
+
37
37
+
buildInputs = [
38
38
+
swiftPackages.XCTest
39
39
+
];
40
40
+
41
41
+
# The helper provides a configure snippet that will prepare all dependencies
42
42
+
# in the correct place, where SwiftPM expects them.
43
43
+
configurePhase =
44
44
+
generated.configure
45
45
+
+ ''
46
46
+
# Replace the dependency symlink with a writable copy
47
47
+
swiftpmMakeMutable Spectre
48
48
+
# Now apply a patch
49
49
+
patch -p1 -d .build/checkouts/Spectre -i ${./0001-spectre-xct-record.patch}
50
50
+
'';
51
51
+
52
52
+
installPhase = ''
53
53
+
mkdir -p $out/bin
54
54
+
cp "$(swiftpmBinPath)/${finalAttrs.pname}" $out/bin/
55
55
+
'';
56
56
+
57
57
+
nativeInstallCheckInputs = [
58
58
+
versionCheckHook
59
59
+
];
60
60
+
versionCheckProgramArg = [ "--version" ];
61
61
+
doInstallCheck = true;
62
62
+
63
63
+
passthru = {
64
64
+
updateScript = nix-update-script { };
65
65
+
};
66
66
+
67
67
+
meta = {
68
68
+
description = "Swift command line tool for generating your Xcode project";
69
69
+
homepage = "https://github.com/yonaskolb/XcodeGen";
70
70
+
changelog = "https://github.com/XcodeGen/blob/${finalAttrs.version}/CHANGELOG.md";
71
71
+
license = lib.licenses.mit;
72
72
+
platforms = lib.platforms.darwin;
73
73
+
maintainers = [ lib.maintainers.samasaur ];
74
74
+
mainProgram = "xcodegen";
75
75
+
};
76
76
+
})