My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
using System;
using Flubu;
using Flubu.Builds;

//css_ref bin\Debug\Flubu.dll;
//css_ref ProjectPilot.BuildScripts.dll;

namespace ProjectPilot.BuildScripts
{
public class BuildScript
{
public static int Main(string[] args)
{
using (ConcreteBuildRunner runner = new ConcreteBuildRunner("ProjectPilot"))
{
try
{
runner.AddTarget("load.solution").SetAsHidden().Do(TargetLoadSolution);
runner.AddTarget("compile")
.SetDescription("Compiles the VS solution and runs FxCop analysis on it")
.Do(TargetCompile).DependsOn("load.solution");
runner.AddTarget("unit.tests")
.SetDescription("Runs unit tests on the project")
.Do(r => r.RunTests("ProjectPilot.Tests", false)).DependsOn("load.solution");
runner.AddTarget("package")
.SetDescription("Packages all the build products into ZIP files")
.Do(TargetPackage).DependsOn("load.solution");
runner.AddTarget("stats")
.SetDescription("Generates project statistics")
.Do(r => r.SourceMonitor());
runner.AddTarget("rebuild")
.SetDescription("Rebuilds the project, runs tests and packages the build products.")
.SetAsDefault().DependsOn("compile", "unit.tests", "package");

// actual run
if (args.Length == 0)
runner.RunTarget(runner.DefaultTarget.TargetName);
else
{
string targetName = args[0];
if (false == runner.HasTarget (targetName))
{
runner.ScriptExecutionEnvironment.LogError("ERROR: The target '{0}' does not exist", targetName);
runner.RunTarget("help");
return 2;
}

runner.RunTarget(args[0]);
}

runner
.Complete();

return 0;
}
catch (RunnerFailedException)
{
return 1;
}
catch (Exception ex)
{
Console.WriteLine(ex);
return 1;
}
finally
{
runner.MergeCoverageReports();
runner.CopyBuildLogsToCCNet();
}
}
}

private static void TargetCompile(ConcreteBuildRunner runner)
{
runner
.PrepareBuildDirectory()
.SetCompanyInfo(
"HERMES SoftLab d.d.",
"Copyright (C) 2008 HERMES SoftLab d.d.",
String.Empty)

.CleanOutput()
.GenerateCommonAssemblyInfo()
.CompileSolution()
.FxCop()
.Gendarme(
"Accipio",
"Accipio.Console",
"Headless",
"KillXml",
"ProjectPilot.Common",
"ProjectPilot.Extras",
"ProjectPilot.Framework",
"ProjectPilot.Log4NetBrowser",
"ProjectPilot.Portal",
"Stump");
runner
.RunTarget("unit.tests");
}

private static void TargetLoadSolution(ConcreteBuildRunner runner)
{
runner
.LoadSolution("ProjectPilot.sln");
runner
.FetchBuildVersion()
.RegisterAsWebProject("ProjectPilot.Portal", "http://localhost/projectpilot");
}

private static void TargetPackage(ConcreteBuildRunner runner)
{
runner
.BuildProducts
.AddProject("accipio", "Accipio.Console", false)
.AddProject("flubu", "Flubu", String.Empty, true);
runner
.PackageBuildProduct("Accipio-{1}.zip", "Accipio-{1}", "accipio")
.CopyBuildProductToCCNet(@"packages\Accipio\Accipio-latest.zip")
.CopyBuildProductToCCNet(@"packages\Accipio\{2}.{3}\{4}")

.PackageBuildProduct("Flubu-{1}.zip", "Flubu-{1}", "flubu")
.CopyBuildProductToCCNet(@"packages\Flubu\Flubu-latest.zip")
.CopyBuildProductToCCNet(@"packages\Flubu\{2}.{3}\{4}");
}
}
}

Change log

r559 by igor.brejc on Dec 15, 2010   Diff
Started working on improved IIS Flubu
tasks.
Go to: 
Project members, sign in to write a code review

Older revisions

r530 by zoro.zorec on May 20, 2010   Diff
flubu: execute sql scripts with
osql.exe
r518 by andrej.jeznik on Feb 22, 2010   Diff
[CHG] Removed dependency 'stats' from
target 'rebuild'
r516 by igor.brejc on Oct 16, 2009   Diff
Added an option for excluding PDB
files in the build package.
All revisions of this file

File info

Size: 4933 bytes, 126 lines
Powered by Google Project Hosting