-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
195 lines (153 loc) · 6.11 KB
/
build.cake
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/*
#########################################################################################
Installing
dotnet cake global tool
dotnet tool uninstall -g Cake.Tool
dotnet tool install -g Cake.Tool
script bootstrappers (deprecated)
Windows - powershell
Invoke-WebRequest http://cakebuild.net/download/bootstrapper/windows -OutFile build.ps1
.\build.ps1
Get-ExecutionPolicy -List
Set-ExecutionPolicy RemoteSigned -Scope Process
Unblock-File .\build.ps1
Windows - cmd.exe prompt
powershell ^
Invoke-WebRequest http://cakebuild.net/download/bootstrapper/windows -OutFile build.ps1
powershell ^
.\build.ps1
Mac OSX
rm -fr tools/; mkdir ./tools/ ; \
cp cake.packages.config ./tools/packages.config ; \
curl -Lsfo build.sh http://cakebuild.net/download/bootstrapper/osx ; \
sh ./build.sh
chmod +x ./build.sh ;
./build.sh
Linux
curl -Lsfo build.sh http://cakebuild.net/download/bootstrapper/linux
chmod +x ./build.sh && ./build.sh
Running Cake to Build targets
Windows
tools\Cake\Cake.exe --verbosity=diagnostic --target=libs
tools\Cake\Cake.exe --verbosity=diagnostic --target=nuget
tools\Cake\Cake.exe --verbosity=diagnostic --target=samples
Mac OSX
mono tools/Cake/Cake.exe --verbosity=diagnostic --target=libs
mono tools/Cake/Cake.exe --verbosity=diagnostic --target=nuget
mono tools/nunit.consolerunner/NUnit.ConsoleRunner/tools/nunit3-console.exe \
#########################################################################################
*/
// https://www.nuget.org/packages/Cake.CoreCLR
// Cake.CoreCLR add to ./tools/ folder for debugging
#addin nuget:?package=Cake.FileHelpers
//---------------------------------------------------------------------------------------
// unit testing
#tool nuget:?package=NUnit.ConsoleRunner
#tool nuget:?package=xunit.runner.console
//---------------------------------------------------------------------------------------
// coverage
#tool "nuget:?package=OpenCover"
// dotCover is commercial
// #tool "nuget:?package=JetBrains.dotCover.CommandLineTools"
//---------------------------------------------------------------------------------------
// reporting
#tool "nuget:?package=ReportUnit"
#tool "nuget:?package=ReportGenerator"
#load "./externals-data.cake"
//---------------------------------------------------------------------------------------
string TARGET = Argument ("t", Argument ("target", "Default"));
string verbosity = Argument ("v", Argument ("verbosity", "diagnostic"));
string source_solutions = $"./source/**/*.sln";
string source_projects = $"./source/**/*.csproj";
string samples_solutions = $"./samples/**/*.sln";
string samples_projects = $"./samples/**/*.csproj";
string samples_scripts_interactive_csharp_cake = $"./samples/**/*.cake";
string externals_scripts_interactive_csharp_cake = $"./externals/**/*.cake";
string samples_cake_scripts = $"./samples/**/*.cake";
string tests_cake_scripts = $"./samples/**/*.cake";
FilePathCollection LibrarySourceSolutions = GetFiles(source_solutions);
FilePathCollection LibrarySourceProjects = GetFiles(source_projects);
FilePathCollection SamplesSolutions = GetFiles(samples_solutions);
FilePathCollection SamplesScriptsInteractiveCsharpCake = GetFiles(samples_solutions);
FilePathCollection SamplesProjects = GetFiles(samples_projects);
string[] configurations = new string[]
{
//"Debug",
"Release",
};
string[] clean_folder_patterns = new string[]
{
"./externals/",
"./output/",
"./**/.vs/",
"./**/.idea/",
"./**/*-packages/",
"./**/.mfractor/",
"./source/**/bin/",
"./source/**/obj/",
"./source/**/packages/",
"./samples/**/bin/",
"./samples/**/obj/",
"./samples/**/packages/",
"./samples/**/tools/",
"./tests/**/bin/",
"./tests/**/obj/",
"./tests/**/packages/",
"./tests/**/tools/",
};
string[] clean_file_patterns = new string[]
{
"./**/*.binlog",
"./**/.DS_Store",
};
#load "./scripts/common/externals.cake"
#load "./scripts/private-protected-sensitive/externals.private.cake"
#load "./scripts/common/main.cake"
#load "./scripts/common/nuget-restore.cake"
#load "./scripts/common/nuget-pack.cake"
#load "./scripts/common/libs.cake"
#load "./scripts/common/samples.cake"
#load "./scripts/common/tests-unit-tests.cake"
// FilePathCollection UnitTestsNUnitMobileProjects = GetFiles($"./tests/unit-tests/project-references/**/*.NUnit.Xamarin*.csproj");
// FilePathCollection UnitTestsXUnitProjects = GetFiles($"./tests/unit-tests/project-references/**/*.XUnit.csproj");
// FilePathCollection UnitTestsMSTestProjects = GetFiles($"./tests/unit-tests/project-references/**/*.NUnit.csproj");
Task("Default")
.Does
(
() =>
{
//RunTarget("unit-tests");
RunTarget("nuget-pack");
RunTarget("samples");
}
);
RunTarget (TARGET);
if( ! IsRunningOnWindows())
{
try
{
int exit_code = StartProcess
(
"tree",
new ProcessSettings
{
Arguments = @"-h ./output"
}
);
}
catch(Exception ex)
{
Information($"unable to start process - tree {ex.Message}");
}
}
else
{
// int exit_code = StartProcess
// (
// "dir",
// new ProcessSettings
// {
// Arguments = @"output"
// }
// );
}