Skip to content

Commit d06af37

Browse files
committed
Test support for swift package manager
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 12ee23b commit d06af37

14 files changed

+1850
-1
lines changed

src/packagedcode/swift.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
Handle the resolved file and JSON dump of the manifest for Swift packages.
2020
https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html
2121
22-
Run the command below before running the scan:
22+
Run the commands below before running the scan:
2323
``swift package dump-package > Package.swift.json``
24+
``swift package resolve``
2425
"""
2526

2627

Lines changed: 323 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,323 @@
1+
{
2+
"cLanguageStandard" : null,
3+
"cxxLanguageStandard" : null,
4+
"dependencies" : [
5+
{
6+
"sourceControl" : [
7+
{
8+
"identity" : "turf-swift",
9+
"location" : {
10+
"remote" : [
11+
{
12+
"urlString" : "https://github.com/mapbox/turf-swift.git"
13+
}
14+
]
15+
},
16+
"productFilter" : null,
17+
"requirement" : {
18+
"range" : [
19+
{
20+
"lowerBound" : "2.8.0",
21+
"upperBound" : "3.0.0"
22+
}
23+
]
24+
}
25+
}
26+
]
27+
},
28+
{
29+
"sourceControl" : [
30+
{
31+
"identity" : "mapbox-core-maps-ios",
32+
"location" : {
33+
"remote" : [
34+
{
35+
"urlString" : "https://github.com/mapbox/mapbox-core-maps-ios.git"
36+
}
37+
]
38+
},
39+
"productFilter" : null,
40+
"requirement" : {
41+
"exact" : [
42+
"11.4.0-rc.2"
43+
]
44+
}
45+
}
46+
]
47+
},
48+
{
49+
"sourceControl" : [
50+
{
51+
"identity" : "mapbox-common-ios",
52+
"location" : {
53+
"remote" : [
54+
{
55+
"urlString" : "https://github.com/mapbox/mapbox-common-ios.git"
56+
}
57+
]
58+
},
59+
"productFilter" : null,
60+
"requirement" : {
61+
"exact" : [
62+
"24.4.0-rc.2"
63+
]
64+
}
65+
}
66+
]
67+
}
68+
],
69+
"name" : "MapboxMaps",
70+
"packageKind" : {
71+
"root" : [
72+
"/workspace"
73+
]
74+
},
75+
"pkgConfig" : null,
76+
"platforms" : [
77+
{
78+
"options" : [
79+
80+
],
81+
"platformName" : "ios",
82+
"version" : "12.0"
83+
},
84+
{
85+
"options" : [
86+
87+
],
88+
"platformName" : "macos",
89+
"version" : "10.15"
90+
},
91+
{
92+
"options" : [
93+
94+
],
95+
"platformName" : "visionos",
96+
"version" : "1.0"
97+
}
98+
],
99+
"products" : [
100+
{
101+
"name" : "MapboxMaps",
102+
"targets" : [
103+
"MapboxMaps"
104+
],
105+
"type" : {
106+
"library" : [
107+
"automatic"
108+
]
109+
}
110+
}
111+
],
112+
"providers" : null,
113+
"swiftLanguageVersions" : null,
114+
"targets" : [
115+
{
116+
"dependencies" : [
117+
{
118+
"product" : [
119+
"MapboxCoreMaps",
120+
"mapbox-core-maps-ios",
121+
null,
122+
null
123+
]
124+
},
125+
{
126+
"product" : [
127+
"MapboxCommon",
128+
"mapbox-common-ios",
129+
null,
130+
null
131+
]
132+
},
133+
{
134+
"product" : [
135+
"Turf",
136+
"turf-swift",
137+
null,
138+
null
139+
]
140+
}
141+
],
142+
"exclude" : [
143+
"Info.plist"
144+
],
145+
"name" : "MapboxMaps",
146+
"packageAccess" : true,
147+
"resources" : [
148+
{
149+
"path" : "MapboxMaps.json",
150+
"rule" : {
151+
"copy" : {
152+
153+
}
154+
}
155+
},
156+
{
157+
"path" : "PrivacyInfo.xcprivacy",
158+
"rule" : {
159+
"copy" : {
160+
161+
}
162+
}
163+
}
164+
],
165+
"settings" : [
166+
167+
],
168+
"type" : "regular"
169+
},
170+
{
171+
"dependencies" : [
172+
{
173+
"byName" : [
174+
"MapboxMaps",
175+
null
176+
]
177+
}
178+
],
179+
"exclude" : [
180+
181+
],
182+
"name" : "MapboxMapsTests",
183+
"packageAccess" : true,
184+
"resources" : [
185+
{
186+
"path" : "MigrationGuide/Fixtures/polygon.geojson",
187+
"rule" : {
188+
"copy" : {
189+
190+
}
191+
}
192+
},
193+
{
194+
"path" : "Helpers/MapboxAccessToken",
195+
"rule" : {
196+
"copy" : {
197+
198+
}
199+
}
200+
},
201+
{
202+
"path" : "Resources/empty-style-chicago.json",
203+
"rule" : {
204+
"copy" : {
205+
206+
}
207+
}
208+
},
209+
{
210+
"path" : "Snapshot/testDoesNotShowAttribution().png",
211+
"rule" : {
212+
"copy" : {
213+
214+
}
215+
}
216+
},
217+
{
218+
"path" : "Snapshot/testDoesNotShowLogo().png",
219+
"rule" : {
220+
"copy" : {
221+
222+
}
223+
}
224+
},
225+
{
226+
"path" : "Snapshot/testDoesNotShowLogoAndAttribution().png",
227+
"rule" : {
228+
"copy" : {
229+
230+
}
231+
}
232+
},
233+
{
234+
"path" : "Snapshot/testShowsLogoAndAttribution().png",
235+
"rule" : {
236+
"copy" : {
237+
238+
}
239+
}
240+
},
241+
{
242+
"path" : "Snapshot/testSnapshotAttribution-100.png",
243+
"rule" : {
244+
"copy" : {
245+
246+
}
247+
}
248+
},
249+
{
250+
"path" : "Snapshot/testSnapshotAttribution-150.png",
251+
"rule" : {
252+
"copy" : {
253+
254+
}
255+
}
256+
},
257+
{
258+
"path" : "Snapshot/testSnapshotAttribution-200.png",
259+
"rule" : {
260+
"copy" : {
261+
262+
}
263+
}
264+
},
265+
{
266+
"path" : "Snapshot/testSnapshotAttribution-250.png",
267+
"rule" : {
268+
"copy" : {
269+
270+
}
271+
}
272+
},
273+
{
274+
"path" : "Snapshot/testSnapshotAttribution-300.png",
275+
"rule" : {
276+
"copy" : {
277+
278+
}
279+
}
280+
},
281+
{
282+
"path" : "Snapshot/testSnapshotAttribution-50.png",
283+
"rule" : {
284+
"copy" : {
285+
286+
}
287+
}
288+
},
289+
{
290+
"path" : "Snapshot/testSnapshotLogoVisibility.png",
291+
"rule" : {
292+
"copy" : {
293+
294+
}
295+
}
296+
},
297+
{
298+
"path" : "Snapshot/testSnapshotOverlay.png",
299+
"rule" : {
300+
"copy" : {
301+
302+
}
303+
}
304+
},
305+
{
306+
"path" : "Resources/MapInitOptionsTests.xib",
307+
"rule" : {
308+
"process" : {
309+
310+
}
311+
}
312+
}
313+
],
314+
"settings" : [
315+
316+
],
317+
"type" : "test"
318+
}
319+
],
320+
"toolsVersion" : {
321+
"_version" : "5.9.0"
322+
}
323+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Test file for swift package.

tests/packagedcode/data/swift/packages/mapboxmaps_manifest_and_resolved/Package.resolved

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)