-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathSakefile.shade
73 lines (55 loc) · 2.62 KB
/
Sakefile.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
var PRODUCT = "Kayak"
var DESCRIPTION = "Kayak is an event-based IO libary for .NET. Kayak allows you to easily create TCP clients and servers, and contains an HTTP/1.1 server implementation."
var VERSION = "0.7.2"
var AUTHORS = "Benjamin van der Veen"
var COPYRIGHT = "Copyright 2007-2012 Benjamin van der Veen"
var LICENSE_URL = "https://github.com/kayak/kayak/raw/HEAD/LICENSE"
var PROJECT_URL = "https://github.com/kayak/kayak"
#default .build .test
var CONFIGURATION = "Release"
var BUILD_DIR = "${Directory.GetCurrentDirectory()}/build"
var OUTPUT_DIR = "${BUILD_DIR}/out"
var BIN_DIR = "${BUILD_DIR}/bin"
var PACKAGES_DIR = "packages"
use import="Files"
#assemblyinfo .clean
update-assemblyinfo include="Kayak/Properties/AssemblyInfo.cs" assemblyVersion="${VERSION}" assemblyTitle="${PRODUCT}" assemblyDescription="${DESCRIPTION}" assemblyCopyright="${COPYRIGHT}"
#ensure_submodules
exec program="git" commandline="submodule init"
exec program="git" commandline="submodule update"
#ensure_nuget_packages
for each='var file in Files.Include("**/packages.config")'
exec-clr program='.nuget/NuGet.exe' commandline='install ${file} -o packages'
#build .assemblyinfo .ensure_submodules .ensure_nuget_packages
build projectFile="Kayak.sln" outputDir="${OUTPUT_DIR}" configuration="${CONFIGURATION}"
#test .build
nunit testAssembly="${OUTPUT_DIR}/Kayak.Tests.dll" extra="-labels" nunitVersion="2.5.10.11092"
#binaries .build
@{
var binaries = Files.BasePath(OUTPUT_DIR).Include("*.dll", "*.pdb")
.Where(path => !Regex.Match(path, "nunit").Success)
.Where(path => !Regex.Match(path, ".Tests").Success)
.Where(path => !Regex.Match(path, "KayakExamples.").Success);
}
-Directory.CreateDirectory(BIN_DIR);
for each="var file in binaries"
log info="Copying ${file}"
-File.Copy(OUTPUT_DIR + "/" + file, BIN_DIR + "/" + file, true);
#dist_nuget .binaries .build
update-nuspec inputFile="Kayak.nuspec" outputFile="${BUILD_DIR}/Kayak.nuspec" id="${PRODUCT}" version="${VERSION}" authors="${AUTHORS}" description="${DESCRIPTION}" licenseUrl="${LICENSE_URL}" projectUrl="${PROJECT_URL}" tags="http io socket network async"
nuget-pack nuspecFile="${BUILD_DIR}/Kayak.nuspec" workingDir="${BUILD_DIR}" extra="-Symbols"
#dist_zip .build .binaries
@{/*
z.directories_to_zip BIN_DIR
z.output_file = "kayak-#{VERSION}.zip"
z.output_path = BUILD_DIR
*/}
#dist .test .dist_nuget .dist_zip
#clean
directory delete="${BUILD_DIR}"
directory delete="Kayak/bin"
directory delete="Kayak/obj"
directory delete="Kayak.Tests/bin"
directory delete="Kayak.Tests/obj"
#dist_clean
directory delete="${PACKAGES_DIR}"