Skip to content

Commit c620c8b

Browse files
committed
added RuntimeIdMapGenerator.csx
1 parent cd3cca7 commit c620c8b

File tree

4 files changed

+445
-231
lines changed

4 files changed

+445
-231
lines changed

src/GitVersionTask.MsBuild/LibGit2Sharp/RuntimeIdMap.cs

Lines changed: 5 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace GitVersion.MSBuildTask.LibGit2Sharp
88
{
9-
internal static class RuntimeIdMap
9+
internal static partial class RuntimeIdMap
1010
{
1111
// This functionality needs to be provided as .NET Core API.
1212
// Releated issues:
@@ -76,7 +76,7 @@ void FindBestCandidate(int startIndex, int increment)
7676
return SDirectories[index];
7777
}
7878

79-
internal static int CompareVersions(string[] left, string[] right)
79+
private static int CompareVersions(string[] left, string[] right)
8080
{
8181
for (var i = 0; i < Math.Max(left.Length, right.Length); i++)
8282
{
@@ -105,21 +105,14 @@ internal static int CompareVersions(string[] left, string[] right)
105105
return 0;
106106
}
107107

108-
internal static void ParseRuntimeId(string runtimeId, out string osName, out string[] version, out string qualifiers)
108+
private static void ParseRuntimeId(string runtimeId, out string osName, out string[] version, out string qualifiers)
109109
{
110110
// We use the following convention in all newly-defined RIDs. Some RIDs (win7-x64, win8-x64) predate this convention and don't follow it, but all new RIDs should follow it.
111111
// [os name].[version]-[architecture]-[additional qualifiers]
112112
// See https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Platforms/readme.md#naming-convention
113113

114114
var versionSeparator = runtimeId.IndexOf('.');
115-
if (versionSeparator >= 0)
116-
{
117-
osName = runtimeId.Substring(0, versionSeparator);
118-
}
119-
else
120-
{
121-
osName = null;
122-
}
115+
osName = versionSeparator >= 0 ? runtimeId.Substring(0, versionSeparator) : null;
123116

124117
var architectureSeparator = runtimeId.IndexOf('-', versionSeparator + 1);
125118
if (architectureSeparator >= 0)
@@ -151,227 +144,8 @@ internal static void ParseRuntimeId(string runtimeId, out string osName, out str
151144
qualifiers = string.Empty;
152145
}
153146
}
147+
}
154148

155-
// The following tables were generated by scripts/RuntimeIdMapGenerator.csx.
156-
// Regenerate when upgrading LibGit2Sharp to a new version that supports more platforms.
157-
158-
private static readonly string[] SRids = {
159-
"alpine-x64",
160-
"alpine.3.6-x64",
161-
"alpine.3.7-x64",
162-
"alpine.3.8-x64",
163-
"alpine.3.9-x64",
164-
"centos-x64",
165-
"centos.7-x64",
166-
"debian-x64",
167-
"debian.8-x64",
168-
"debian.9-x64",
169-
"fedora-x64",
170-
"fedora.23-x64",
171-
"fedora.24-x64",
172-
"fedora.25-x64",
173-
"fedora.26-x64",
174-
"fedora.27-x64",
175-
"fedora.28-x64",
176-
"fedora.29-x64",
177-
"gentoo-x64",
178-
"linux-musl-x64",
179-
"linux-x64",
180-
"linuxmint.17-x64",
181-
"linuxmint.17.1-x64",
182-
"linuxmint.17.2-x64",
183-
"linuxmint.17.3-x64",
184-
"linuxmint.18-x64",
185-
"linuxmint.18.1-x64",
186-
"linuxmint.18.2-x64",
187-
"linuxmint.18.3-x64",
188-
"linuxmint.19-x64",
189-
"ol-x64",
190-
"ol.7-x64",
191-
"ol.7.0-x64",
192-
"ol.7.1-x64",
193-
"ol.7.2-x64",
194-
"ol.7.3-x64",
195-
"ol.7.4-x64",
196-
"ol.7.5-x64",
197-
"ol.7.6-x64",
198-
"opensuse-x64",
199-
"opensuse.13.2-x64",
200-
"opensuse.15.0-x64",
201-
"opensuse.42.1-x64",
202-
"opensuse.42.2-x64",
203-
"opensuse.42.3-x64",
204-
"osx",
205-
"osx-x64",
206-
"osx.10.10",
207-
"osx.10.10-x64",
208-
"osx.10.11",
209-
"osx.10.11-x64",
210-
"osx.10.12",
211-
"osx.10.12-x64",
212-
"osx.10.13",
213-
"osx.10.13-x64",
214-
"osx.10.14",
215-
"osx.10.14-x64",
216-
"rhel-x64",
217-
"rhel.6-x64",
218-
"rhel.7-x64",
219-
"rhel.7.0-x64",
220-
"rhel.7.1-x64",
221-
"rhel.7.2-x64",
222-
"rhel.7.3-x64",
223-
"rhel.7.4-x64",
224-
"rhel.7.5-x64",
225-
"rhel.7.6-x64",
226-
"rhel.8-x64",
227-
"rhel.8.0-x64",
228-
"sles-x64",
229-
"sles.12-x64",
230-
"sles.12.1-x64",
231-
"sles.12.2-x64",
232-
"sles.12.3-x64",
233-
"sles.15-x64",
234-
"ubuntu-x64",
235-
"ubuntu.14.04-x64",
236-
"ubuntu.14.10-x64",
237-
"ubuntu.15.04-x64",
238-
"ubuntu.15.10-x64",
239-
"ubuntu.16.04-x64",
240-
"ubuntu.16.10-x64",
241-
"ubuntu.17.04-x64",
242-
"ubuntu.17.10-x64",
243-
"ubuntu.18.04-x64",
244-
"ubuntu.18.10-x64",
245-
"win-x64",
246-
"win-x64-aot",
247-
"win-x86",
248-
"win-x86-aot",
249-
"win10-x64",
250-
"win10-x64-aot",
251-
"win10-x86",
252-
"win10-x86-aot",
253-
"win7-x64",
254-
"win7-x64-aot",
255-
"win7-x86",
256-
"win7-x86-aot",
257-
"win8-x64",
258-
"win8-x64-aot",
259-
"win8-x86",
260-
"win8-x86-aot",
261-
"win81-x64",
262-
"win81-x64-aot",
263-
"win81-x86",
264-
"win81-x86-aot",
265-
};
266149

267-
private static readonly string[] SDirectories = {
268-
"alpine-x64",
269-
"alpine-x64",
270-
"alpine-x64",
271-
"alpine-x64",
272-
"alpine-x64",
273-
"rhel-x64",
274-
"rhel-x64",
275-
"linux-x64",
276-
"linux-x64",
277-
"debian.9-x64",
278-
"fedora-x64",
279-
"fedora-x64",
280-
"fedora-x64",
281-
"fedora-x64",
282-
"fedora-x64",
283-
"fedora-x64",
284-
"fedora-x64",
285-
"fedora-x64",
286-
"linux-x64",
287-
"linux-x64",
288-
"linux-x64",
289-
"linux-x64",
290-
"linux-x64",
291-
"linux-x64",
292-
"linux-x64",
293-
"linux-x64",
294-
"linux-x64",
295-
"linux-x64",
296-
"linux-x64",
297-
"ubuntu.18.04-x64",
298-
"rhel-x64",
299-
"rhel-x64",
300-
"rhel-x64",
301-
"rhel-x64",
302-
"rhel-x64",
303-
"rhel-x64",
304-
"rhel-x64",
305-
"rhel-x64",
306-
"rhel-x64",
307-
"linux-x64",
308-
"linux-x64",
309-
"linux-x64",
310-
"linux-x64",
311-
"linux-x64",
312-
"linux-x64",
313-
"osx",
314-
"osx",
315-
"osx",
316-
"osx",
317-
"osx",
318-
"osx",
319-
"osx",
320-
"osx",
321-
"osx",
322-
"osx",
323-
"osx",
324-
"osx",
325-
"rhel-x64",
326-
"rhel-x64",
327-
"rhel-x64",
328-
"rhel-x64",
329-
"rhel-x64",
330-
"rhel-x64",
331-
"rhel-x64",
332-
"rhel-x64",
333-
"rhel-x64",
334-
"rhel-x64",
335-
"rhel-x64",
336-
"rhel-x64",
337-
"linux-x64",
338-
"linux-x64",
339-
"linux-x64",
340-
"linux-x64",
341-
"linux-x64",
342-
"linux-x64",
343-
"linux-x64",
344-
"linux-x64",
345-
"linux-x64",
346-
"linux-x64",
347-
"linux-x64",
348-
"linux-x64",
349-
"linux-x64",
350-
"linux-x64",
351-
"linux-x64",
352-
"ubuntu.18.04-x64",
353-
"linux-x64",
354-
"win-x64",
355-
"win-x64",
356-
"win-x86",
357-
"win-x86",
358-
"win-x64",
359-
"win-x64",
360-
"win-x86",
361-
"win-x86",
362-
"win-x64",
363-
"win-x64",
364-
"win-x86",
365-
"win-x86",
366-
"win-x64",
367-
"win-x64",
368-
"win-x86",
369-
"win-x86",
370-
"win-x64",
371-
"win-x64",
372-
"win-x86",
373-
"win-x86",
374-
};
375-
}
376150
}
377151
#endif
Binary file not shown.

0 commit comments

Comments
 (0)