1
1
#tool "xunit.runner.console"
2
+ #tool "nuget:?package=GitVersion.CommandLine"
2
3
3
4
var target = Argument ( "target" , "Default" ) ;
4
5
var configuration = Argument ( "configuration" , "Release" ) ;
6
+ var debugConfiguration = Argument ( "configuration" , "Debug" ) ;
5
7
var buildDir = Directory ( "./build" ) ;
6
8
var distDir = Directory ( "./dist" ) ;
7
9
var solutionFile = GetFiles ( "./*.sln" ) . First ( ) ;
@@ -16,6 +18,11 @@ Task("Clean")
16
18
. SetConfiguration ( configuration )
17
19
. WithTarget ( "Clean" )
18
20
. SetVerbosity ( Verbosity . Minimal ) ) ;
21
+
22
+ MSBuild ( solutionFile , settings => settings
23
+ . SetConfiguration ( debugConfiguration )
24
+ . WithTarget ( "Clean" )
25
+ . SetVerbosity ( Verbosity . Minimal ) ) ;
19
26
} ) ;
20
27
21
28
Task ( "Clean-Outputs" )
@@ -30,7 +37,7 @@ Task("Build")
30
37
. Does ( ( ) =>
31
38
{
32
39
NuGetRestore ( solutionFile ) ;
33
-
40
+ GitVersion ( new GitVersionSettings { UpdateAssemblyInfo = true } ) ;
34
41
MSBuild ( solutionFile , settings => settings
35
42
. SetConfiguration ( configuration )
36
43
. WithTarget ( "Rebuild" )
@@ -41,13 +48,13 @@ Task("Test")
41
48
. IsDependentOn ( "Build" )
42
49
. Does ( ( ) =>
43
50
{
44
- XUnit2 ( string . Format ( "./test/**/bin/{0} /*.Tests.dll" , configuration ) , new XUnit2Settings {
51
+ XUnit2 ( string . Format ( "./test/**/bin/Release/** /*.Tests.dll" , configuration ) , new XUnit2Settings {
45
52
XmlReport = true ,
46
53
OutputDirectory = buildDir
47
54
} ) ;
48
55
} ) ;
49
56
50
57
Task ( "Default" )
51
- . IsDependentOn ( "Build " ) ;
58
+ . IsDependentOn ( "Test " ) ;
52
59
53
60
RunTarget ( target ) ;
0 commit comments