forked from aspnet/dnx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.shade
506 lines (411 loc) · 21.7 KB
/
makefile.shade
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
use assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
use assembly="System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
use import="Environment"
var PRODUCT_VERSION = '0.1'
var VERSION='${PRODUCT_VERSION}-alpha'
var AUTHORS='Microsoft'
default Configuration='Release'
use-standard-lifecycle
k-standard-goals
var ROOT = '${Directory.GetCurrentDirectory()}'
var SCRIPTS_DIR = '${Path.Combine(ROOT, "scripts")}'
var ARTIFACTS_DIR = '${Path.Combine(ROOT, "artifacts")}'
var BUILD_DIR2 = '${Path.Combine(ROOT, "artifacts", "build")}'
var NUSPEC_ROOT = '${Path.Combine(ROOT, "nuspec")}'
var PACKAGES_DIR = '${Path.Combine(ROOT, "packages")}'
var TEST_RESULTS = '${Path.Combine(ROOT, "artifacts", "TestResults")}'
var SAMPLES_DIR = '${Path.Combine(ROOT, "samples")}'
var FULL_VERSION = '${VERSION + "-" + BuildNumber}'
var CORECLR_PATH = '${Environment.GetEnvironmentVariable("CORECLR_PATH")}'
var CORECLR_TARGET_PATH = '${Path.Combine(BUILD_DIR2, "CoreCLR")}'
var MONO_x86_BIN='${Path.Combine(BUILD_DIR2, "KRE-mono45-x86", "bin")}'
var SVR50_x86_BIN='${Path.Combine(BUILD_DIR2, "KRE-svr50-x86", "bin")}'
var SVR50_x64_BIN='${Path.Combine(BUILD_DIR2, "KRE-svr50-x64", "bin")}'
var SVRC50_x86_BIN='${Path.Combine(BUILD_DIR2, "KRE-svrc50-x86", "bin")}'
var SVRC50_x64_BIN='${Path.Combine(BUILD_DIR2, "KRE-svrc50-x64", "bin")}'
var NET45_TARGETS = '${new [] { MONO_x86_BIN, SVR50_x86_BIN, SVR50_x64_BIN}}'
var K10_TARGETS = '${new [] { SVRC50_x86_BIN, SVRC50_x64_BIN}}'
var ALL_TARGETS = '${NET45_TARGETS.Concat(K10_TARGETS)}'
var NEW_RUNTIME = '${Environment.GetEnvironmentVariable("NEW_RUNTIME") == "1"}'
#package-runtime .clean-sdk-dir .copy-bits .tweak-scripts .copy-package-dependencies .copy-coreclr .nuget-pack-runtime target='package'
#rebuild-package .build-mono-entrypoint .build-compile .native-compile .xunit-test .package-runtime
#compile-klr target='native-compile' if='!IsMono'
var programFilesX86 = '${Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)}'
var msbuild = '${Path.Combine(programFilesX86, "MSBuild", "12.0", "Bin", "MSBuild.exe")}'
var klrProj = '${Path.Combine(ROOT, "src", "klr", "klr.vcxproj")}'
@{
if(!File.Exists(msbuild))
{
Log.Warn("msbuild version 12 not found. Please ensure you have the VS 2013 C++ SDK installed.");
Environment.Exit(1);
}
else
{
Exec(msbuild, klrProj + " /p:Configuration=" + Configuration + ";Platform=Win32;TargetFramework=net45");
Exec(msbuild, klrProj + " /p:Configuration=" + Configuration + ";Platform=x64;TargetFramework=net45");
Exec(msbuild, klrProj + " /p:Configuration=" + Configuration + ";Platform=Win32;TargetFramework=k10");
Exec(msbuild, klrProj + " /p:Configuration=" + Configuration + ";Platform=x64;TargetFramework=k10");
}
}
directory delete='${Path.Combine(BUILD_DIR2, "klr")}'
copy sourceDir='${Path.Combine(ROOT, "src", "klr")}' include='bin/**/' outputDir='${Path.Combine(BUILD_DIR2, "klr")}' overwrite='${true}'
#build-mono-entrypoint target='compile' if='!IsMono'
directory create='artifacts/build/klr.mono.managed'
@{
var cscPath = Path.Combine(Environment.GetEnvironmentVariable("WINDIR"), "Microsoft.NET", "Framework", "v4.0.30319", "csc.exe");
Log.Info("Using csc path:" + cscPath);
Exec(cscPath, @"/target:exe /nologo /unsafe /out:artifacts\build\klr.mono.managed\klr.mono.managed.dll /define:NET45 src\klr.mono.managed\EntryPoint.cs src\klr.hosting.shared\RuntimeBootstrapper.cs src\klr.hosting.shared\LoaderEngine.cs src\Microsoft.Framework.CommandLineUtils\CommandLine\CommandLineParser.cs src\Microsoft.Framework.CommandLineUtils\CommandLine\CommandOptions.cs src\Microsoft.Framework.CommandLineUtils\CommandLine\CommandOptionType.cs");
}
#copy-kvm target='compile'
copy sourceDir='setup' outputDir='${ARTIFACTS_DIR}' include='*.cmd' overwrite='${true}'
copy sourceDir='setup' outputDir='${ARTIFACTS_DIR}' include='*.ps1'
update-file updateFile='${ARTIFACTS_DIR}\kvm.ps1' @{
updateText = updateText.Replace("{{BUILD_NUMBER}}", Environment.GetEnvironmentVariable("BUILD_NUMBER"));
}
#xunit-test target='test' if='Directory.Exists("test")'
k-test each='var projectFile in Files.Include("test/**/project.json")' if='NEW_RUNTIME'
#test-package
var helloWorld = '${Path.Combine(SAMPLES_DIR, "HelloWorld")}'
var kcmd = '${Path.Combine(TEST_RESULTS, "KRE", "tools", "k.cmd")}'
var k10Tools = '${Path.Combine(TEST_RESULTS, "KRE", "tools", "k10")}'
var nupkgPaths = '${new string[] {
Files.Include(Path.Combine(BUILD_DIR2, "KRE-svr50-x86.*.nupkg")).Single(),
Files.Include(Path.Combine(BUILD_DIR2, "KRE-svr50-x64.*.nupkg")).Single(),
Files.Include(Path.Combine(BUILD_DIR2, "KRE-svrc50-x86.*.nupkg")).Single(),
Files.Include(Path.Combine(BUILD_DIR2, "KRE-svrc50-x64.*.nupkg")).Single(),
}}'
for each='var nupkgPath in nupkgPaths'
@{
var kreName = Path.GetFileNameWithoutExtension(nupkgPath);
var krePath = Path.Combine(TEST_RESULTS, "KRE", kreName);
Log.Info("Unpacking " + nupkgPath);
if (Directory.Exists(krePath)) {
Directory.Delete(krePath, recursive:true);
}
Directory.CreateDirectory(krePath);
System.IO.Compression.ZipFile.ExtractToDirectory(
nupkgPath,
krePath);
}
@{
Action<string> runWithFramework = nupkgPath => {
var envPath = Environment.GetEnvironmentVariable("PATH");
try
{
var kreName = Path.GetFileNameWithoutExtension(nupkgPath);
var krePath = Path.Combine(TEST_RESULTS, "KRE", kreName);
Environment.SetEnvironmentVariable("K_APPBASE", helloWorld);
var kPath = Path.Combine(krePath, "bin", "k");
Log.Info("kreName = " + kreName);
Log.Info("K_APPBASE = " + helloWorld);
Exec("cmd", "/C " + kPath + " run");
var commands = new [] { "build" };
foreach(var cmd in commands)
{
Exec("cmd", "/C " + kPath + " " + cmd + " " + helloWorld);
Directory.Delete(Path.Combine(helloWorld, "bin"), true);
}
}
finally
{
Environment.SetEnvironmentVariable("PATH", envPath);
Environment.SetEnvironmentVariable("K_APPBASE", null);
}
};
Action<string> crossGen = nupkgPath => {
var kreName = Path.GetFileNameWithoutExtension(nupkgPath);
var krePath = Path.Combine(TEST_RESULTS, "KRE", kreName);
var kPath = Path.Combine(krePath, "bin", "k");
var kTools = new[] {
Path.Combine(krePath, "bin", "lib", "Microsoft.Framework.Project"),
Path.Combine(krePath, "bin", "lib", "Microsoft.Framework.PackageManager"),
Path.Combine(krePath, "bin", "lib", "Microsoft.Framework.DesignTimeHost"),
};
Log.Info("kreName = " + kreName);
foreach(var kTool in kTools) {
Exec("cmd", string.Format("/C \"{0}\" crossgen --in \"{1}\"", kPath, kTool));
}
};
foreach(var nupkgPath in nupkgPaths) {
runWithFramework(nupkgPath);
}
// Crossgen
/* FIX
crossGen(nupkgPaths[2]);
crossGen(nupkgPaths[3]);
foreach(var nupkgPath in nupkgPaths) {
runWithFramework(nupkgPath);
}
*/
}
#ensure-latest-package
@{
// We need to re-run the build using the current output
var nupkgPath = Files.Include(Path.Combine(BUILD_DIR2, "KRE-svr50-x86.*.nupkg")).Single();
Log.Info("Unpacking " + nupkgPath);
if (Directory.Exists(Path.Combine(PACKAGES_DIR, "KRE"))) {
Directory.Delete(Path.Combine(PACKAGES_DIR, "KRE"), recursive:true);
}
Directory.CreateDirectory(Path.Combine(PACKAGES_DIR, "KRE"));
System.IO.Compression.ZipFile.ExtractToDirectory(
Path.Combine(nupkgPath),
Path.Combine(PACKAGES_DIR, "KRE"));
// Nuke the build dir
Directory.Delete(BUILD_DIR2, recursive: true);
var envPath = Environment.GetEnvironmentVariable("PATH");
try
{
Log.Info("Adding PATH " + Path.Combine(PACKAGES_DIR, "KRE", "bin"));
Environment.SetEnvironmentVariable("PATH", Path.Combine(PACKAGES_DIR, "KRE", "bin") + ";" + envPath);
Environment.SetEnvironmentVariable("NEW_RUNTIME", "1");
Log.Info("Rebuilding target default");
Exec("build.cmd", "rebuild-package");
}
finally
{
Environment.SetEnvironmentVariable("PATH", envPath);
Environment.SetEnvironmentVariable("NEW_RUNTIME", null);
}
}
#verify-package .ensure-latest-package .test-package target='verify'
#clean-sdk-dir
directory each='var delete in ALL_TARGETS'
directory each='var create in ALL_TARGETS'
#copy-bits
var x86Target="x86"
var x64Target="amd64"
-// KRE-mono45-x86
copy sourceDir='${SCRIPTS_DIR}' include='*.sh' outputDir='${MONO_x86_BIN}' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.mono.managed")}' outputDir='${MONO_x86_BIN}' include='*.dll' overwrite='${true}'
@{
// Rename all .sh files to remove the sh
foreach (var shFile in Files.Include(Path.Combine(MONO_x86_BIN, "*.sh")))
{
var targetShFile = Path.Combine(Path.GetDirectoryName(shFile),
Path.GetFileNameWithoutExtension(shFile));
if (File.Exists(targetShFile))
{
File.Delete(targetShFile);
}
// Make sure new lines are \n (\r\n messes up the bash script)
var script = File.ReadAllText(shFile).Replace('\r\n', '\n');
File.Move(shFile, targetShFile);
File.WriteAllText(targetShFile, script);
}
}
-// KRE-svr50-x86
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr", "bin", "Win32", Configuration, "net45")}' outputDir='${SVR50_x86_BIN}' include='*.exe' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.net45", "bin", "Win32", Configuration)}' outputDir='${SVR50_x86_BIN}' include='*.dll' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.net45", "bin", "Win32", Configuration)}' outputDir='${SVR50_x86_BIN}' include='*.pdb' overwrite='${true}'
copy sourceDir='${Path.Combine(ROOT, "src", "klr.net45.managed")}' outputDir='${SVR50_x86_BIN}' include='*.config' overwrite='${true}'
-// KRE-svr50-x64
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr", "bin", "x64", Configuration, "net45")}' outputDir='${SVR50_x64_BIN}' include='*.exe' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.net45", "bin", "x64", Configuration)}' outputDir='${SVR50_x64_BIN}' include='*.dll' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.net45", "bin", "x64", Configuration)}' outputDir='${SVR50_x64_BIN}' include='*.pdb' overwrite='${true}'
copy sourceDir='${Path.Combine(ROOT, "src", "klr.net45.managed")}' outputDir='${SVR50_x64_BIN}' include='*.config' overwrite='${true}'
-// KRE-svrc50-x86
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr", "bin", "Win32", Configuration, "k10")}' outputDir='${SVRC50_x86_BIN}' include='*.exe' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.core45", "bin", "Win32", Configuration)}' outputDir='${SVRC50_x86_BIN}' include='*.dll' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.core45", "bin", "Win32", Configuration)}' outputDir='${SVRC50_x86_BIN}' include='*.pdb' overwrite='${true}'
-// KRE-svrc50-x64
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr", "bin", "x64", Configuration, "k10")}' outputDir='${SVRC50_x64_BIN}' include='*.exe' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.core45", "bin", "x64", Configuration)}' outputDir='${SVRC50_x64_BIN}' include='*.dll' overwrite='${true}'
copy sourceDir='${Path.Combine(BUILD_DIR2, "klr.core45", "bin", "x64", Configuration)}' outputDir='${SVRC50_x64_BIN}' include='*.pdb' overwrite='${true}'
copy sourceDir='${SCRIPTS_DIR}' include='*.cmd' overwrite='${true}' each='var outputDir in new[]{ SVR50_x86_BIN, SVR50_x64_BIN, SVRC50_x86_BIN, SVRC50_x64_BIN }'
@{
var hostK10 = Path.Combine(BUILD_DIR2, "*", "k10", "**.*");
var hostnet45 = Path.Combine(BUILD_DIR2, "*", "net45", "**.*");
var libPackages = new[] { "Microsoft.Framework.PackageManager",
"Microsoft.Framework.DesignTimeHost",
"Microsoft.Framework.Project" };
var sharedSourceAssemblies = new [] {
Path.Combine(BUILD_DIR2, "klr.hosting.shared/**/*.*"),
Path.Combine(BUILD_DIR2, "Microsoft.Framework.CommandLineUtils/**/*.*"),
Path.Combine(BUILD_DIR2, "Microsoft.Framework.Runtime.Common/**/*.*"),
Path.Combine(BUILD_DIR2, "Microsoft.Framework.Runtime.Interfaces/**/*.*")
};
foreach(var file in Files.Include(hostK10).Exclude(sharedSourceAssemblies))
{
foreach(var k10Target in K10_TARGETS)
{
string dest = Path.Combine(k10Target, Path.GetFileName(file));
File.Copy(file, dest, true);
}
}
foreach(var file in Files.Include(hostnet45).Exclude(sharedSourceAssemblies))
{
foreach(var net45Target in NET45_TARGETS)
{
string dest = Path.Combine(net45Target, Path.GetFileName(file));
File.Copy(file, dest, true);
}
}
// Clean up net45.managed from mono (it's never used)
File.Delete(Path.Combine(MONO_x86_BIN, "klr.net45.managed.dll"));
// Remove k-crossgen.cmd from the net45 build
foreach (var net45Target in NET45_TARGETS)
{
var crossgen = Path.Combine(net45Target, "k-crossgen.cmd");
if(File.Exists(crossgen))
{
File.Delete(crossgen);
Log.Info("Deleting crossgen from " + crossgen);
}
}
Action<string, string, string> move = (binFolder, name, extension) =>
{
var libPath = Path.Combine(binFolder, "lib", name);
var source = Path.Combine(binFolder, name + extension);
var target = Path.Combine(libPath, name + extension);
if (File.Exists(source))
{
if (File.Exists(target))
{
File.Delete(target);
}
Directory.CreateDirectory(libPath);
File.Move(source, target);
Log.Info("Moving " + name + " to " + target);
}
else
{
Log.Warn(name + " does not exist in " + binFolder);
}
};
// Move some packages into the lib/ folder
foreach (var libPackage in libPackages)
{
foreach(var binFolder in ALL_TARGETS)
{
move(binFolder, libPackage, ".dll");
move(binFolder, libPackage, ".pdb");
}
}
}
#tweak-scripts
@{
foreach(var targetDir in new[] { SVR50_x86_BIN, SVR50_x64_BIN, SVRC50_x86_BIN, SVRC50_x64_BIN })
{
foreach(var file in Files.Include(Path.Combine(targetDir, "*.cmd")))
{
var script = File.ReadAllText(file);
script = Regex.Replace(script, @"REM \<dev\>(.*?)REM \<\/dev\>(\s*)", @"", RegexOptions.Singleline);
File.WriteAllText(file, script);
}
}
}
#copy-package-dependencies
@{
var targetFrameworks = new [] { "k10", "net45" };
var packages = new[] { "Newtonsoft.Json",
"Microsoft.CodeAnalysis.Common",
"Microsoft.CodeAnalysis.CSharp",
"Microsoft.Bcl.Immutable",
"Microsoft.Bcl.Metadata" };
foreach (var framework in targetFrameworks)
{
foreach (var package in packages)
{
var packageDir = Directory.GetDirectories(PACKAGES_DIR, package + "*").OrderByDescending(d => d).FirstOrDefault();
if(packageDir == null)
{
Log.Warn("Unable to find resolve " + package);
continue;
}
string[] candidates = null;
if(framework == "k10")
{
candidates = new [] { framework, "netcore45", "win8" };
}
else
{
candidates = new [] { framework, "net40", "net35", "net20" };
}
var lib = new DirectoryInfo(Path.Combine(packageDir, "lib"));
var di = candidates.Select(fmk => lib.EnumerateDirectories("*" + fmk+ "*")
.OrderBy(d => d.Name.Length)
.FirstOrDefault())
.FirstOrDefault(d => d != null);
if(!di.Exists)
{
Log.Warn("Couldn't find version of " + package + " matching " + framework);
continue;
}
foreach(var fi in di.GetFiles("*.dll"))
{
string[] targetDirs = null;
if (framework == "k10")
{
targetDirs = K10_TARGETS;
}
else
{
targetDirs = NET45_TARGETS;
}
foreach(var targetDir in targetDirs)
{
string packageFileDest = Path.Combine(targetDir, fi.Name);
File.Copy(fi.FullName, packageFileDest, true);
Log.Info("Copying to " + packageFileDest);
}
}
}
}
}
#copy-coreclr
nuget-install package='CoreCLR' outputDir='packages' extra='-pre -nocache' once='CoreCLR' if='!IsMono && String.IsNullOrEmpty(CORECLR_PATH)'
var CoreCLR_DIR='${""}'
@{
if (String.IsNullOrEmpty(CORECLR_PATH))
{
Func<string, long> getVersion = version => {
var dash = version.LastIndexOf('-');
if(dash != -1)
{
var lastToken = version.Substring(dash + 1);
if(lastToken.StartsWith("t"))
{
return Int64.Parse(lastToken.Substring(1));
}
return Int64.Parse(lastToken);
}
return Int64.MaxValue;
};
string packagesDir = Path.Combine(Directory.GetCurrentDirectory(), "packages");
CoreCLR_DIR = Directory.EnumerateDirectories(packagesDir, "CoreCLR*")
.OrderByDescending(getVersion)
.First();
Log.Warn("The environment variable CORECLR_PATH is not set, using " + CoreCLR_DIR);
}
}
-// For CI builds
copy sourceDir='${CORECLR_PATH}' outputDir='${CORECLR_TARGET_PATH}' overwrite='${true}' if='!String.IsNullOrEmpty(CORECLR_PATH)'
-// For local builds
copy sourceDir='${Path.Combine(CoreCLR_DIR, "Runtime")}' outputDir='${Path.Combine(CORECLR_TARGET_PATH, "Runtime")}' overwrite='${true}' if='!String.IsNullOrEmpty(CoreCLR_DIR)'
-// Copy the CoreCLR to the k10 builds
copy sourceDir='${Path.Combine(CORECLR_TARGET_PATH, "Runtime", "x86")}' outputDir='${SVRC50_x86_BIN}'
copy sourceDir='${Path.Combine(CORECLR_TARGET_PATH, "Runtime", "amd64")}' outputDir='${SVRC50_x64_BIN}'
#nuget-pack-runtime
-//var nuspecs = KRE-mono45-x86
@{
var allPackages = Path.Combine(BUILD_DIR2, "**", "*.nupkg");
var excludePackages = Path.Combine(BUILD_DIR2, "**", "Microsoft.Framework.Runtime.Interfaces*.nupkg");
var excludePackages2 = Path.Combine(BUILD_DIR2, "**", "Microsoft.Framework.PackageManager*.nupkg");
foreach(var packageFile in Files.Include(allPackages).Exclude(excludePackages).Exclude(excludePackages2))
{
File.Delete(packageFile);
}
}
copy sourceDir='${NUSPEC_ROOT}' outputDir='${BUILD_DIR2}' include='*.nuspec' overwrite='${true}'
nuget-pack packageVersion='${FULL_VERSION}' outputDir='${BUILD_DIR2}' extra='-NoPackageAnalysis' each='var nuspecFile in Files.Include(Path.Combine(BUILD_DIR2, "*.nuspec"))'
#install-runtime target='install'
var matchVersion=''
for each='var pattern in new[]{"svr50-x86", "svrc50-x86", "svr50-x64", "svrc50-x64"}'
for each='var runtime in Files.Include(Path.Combine(BUILD_DIR2, "KRE-"+pattern+".*.nupkg"))'
exec program='cmd' commandline='/C kvm install ${runtime}' if='!IsMono'
var parts='${Path.GetFileNameWithoutExtension(runtime).Split(".".ToArray(), 2)}'
set matchVersion='${parts[1]}' if='matchVersion == ""'
exec program='cmd' commandline='/C kvm alias build ${matchVersion}' if='!IsMono && matchVersion != ""'
exec program='cmd' commandline='/C start cmd /K kvm use build' if='!IsMono && matchVersion != ""'
macro name='NuGetInstall' Package='string' OutputDir='string' Extra='string'
nuget-install package='${Package}' outputDir='${OutputDir}' extra='${Extra}'