forked from PawelTroka/Computator.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generateTravisBuildEnvironments.csx
121 lines (105 loc) · 4.32 KB
/
generateTravisBuildEnvironments.csx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
var monos = new[]{
//"nightly",
//"weekly",
//"alpha",
//"beta",
//"latest",
"5.14.0",
//"5.4.0",
//"5.2.0",
//"5.0.1",
//"5.0.0",
//"4.8.0",
//"4.6.2",
//"4.6.1",
//"4.6.0" ,
////"4.4.2",
//"4.4.1","4.4.0","4.2.3","4.2.2","4.2.1","4.2.0","4.0.5","4.0.4.4","4.0.4","4.0.3","4.0.2","4.0.1",
////"4.0.0",
////"3.12.0",
////"3.10.0",
////"3.8.0",
////"3.2.8",
////"2.10.8"
};
var oses = new[] { "linux",
"osx"//for now we lack GSL native libraries on Mac OS
};
var sudos = new[] {
"required",
//"false"
};
var dists = new[] {
"trusty",
//"precise"
};
var dotnets = new string[] {
////"1.0.0-preview2-003121",
////"1.0.0-preview2-003131"
};
var osx_images = new[] {
"xcode9.4",//OS X 10.13
//"xcode8.2",//OS X 10.12
//"xcode8.1",//OS X 10.12
//"xcode8",//OS X 10.11
////"xcode7.3",//OS X 10.11
//"xcode7.2",//OS X 10.11
//"xcode6.4"//OS X 10.10
};
var buildConfigs = new[] { "Release", "Debug" };
var osConfigs = new Dictionary<string, string[]>()
{
{ "linux",dists},
{"osx",osx_images }
};
StringBuilder sb = new StringBuilder("matrix:" + Environment.NewLine);
sb.AppendLine(" include:");
Console.Write(sb.ToString());
foreach (var os in oses)
foreach (var buildConfig in buildConfigs)
foreach (var osConfig in osConfigs[os])
foreach (var sudo in sudos)
{
foreach (var mono in monos)
{
if (os == "linux" && (mono.StartsWith("2") || (mono.StartsWith("3") && mono[2] == '2')))
continue;//versions older than 3.8.0 do not support nuget on linux and we need it bad
if (mono == "2.10.8" && os == "osx")
continue;//Mono 2.10.8 is unavailable on Mac OS X
sb = new StringBuilder($" - os: {os}{Environment.NewLine}");
if (os == "linux")
sb.AppendLine($" dist: {osConfig}");
if (os == "osx")
sb.AppendLine($" osx_image: {osConfig}");
sb.AppendLine($" sudo: {sudo}");
sb.AppendLine($" mono: {mono}");
sb.AppendLine($" env: build_config={buildConfig}");
if (mono.StartsWith("2.") || mono.StartsWith("3.") || (mono.StartsWith("4.") && mono[2] < '6'))
{
sb.AppendLine($" env: netmoniker=net40");
Console.Write(sb.ToString());
}
else
{
sb.AppendLine($" env: netmoniker=net461");
Console.Write(sb.ToString());
////sb.AppendLine($" env: netmoniker=.NET40");
////Console.Write(sb.ToString());
}
}
if (osConfig != "precise")//.NET Core does not work currently on precise dist
foreach (var dotnet in dotnets)
{
sb = new StringBuilder($" - os: {os}{Environment.NewLine}");
if (os == "linux")
sb.AppendLine($" dist: {osConfig}");
if (os == "osx")
sb.AppendLine($" osx_image: {osConfig}");
sb.AppendLine($" sudo: {sudo}");
sb.AppendLine($" dotnet: {dotnet}");
sb.AppendLine($" mono: none");
sb.AppendLine($" env: DOTNETCORE=1");
sb.AppendLine($" env: build_config={buildConfig}");
Console.Write(sb.ToString());
}
}