@@ -5,8 +5,8 @@ using System.Threading.Tasks;
5
5
var target = Argument ( "target" , "Default" ) ;
6
6
var exercise = Argument < string > ( "exercise" , null ) ;
7
7
8
- var sourceDir = "./exercises" ;
9
- var buildDir = "./build" ;
8
+ var exercisesSourceDir = "./exercises" ;
9
+ var exercisesBuildDir = "./build" ;
10
10
11
11
var parallelOptions = new ParallelOptions
12
12
{
@@ -15,21 +15,21 @@ var parallelOptions = new ParallelOptions
15
15
16
16
Task ( "Clean" )
17
17
. Does ( ( ) => {
18
- CleanDirectory ( buildDir ) ;
18
+ CleanDirectory ( exercisesBuildDir ) ;
19
19
} ) ;
20
20
21
21
// Copy everything to build so we make no changes in the actual files.
22
22
Task ( "CopyExercises" )
23
23
. IsDependentOn ( "Clean" )
24
24
. Does ( ( ) => {
25
- CopyDirectory ( $ "{ sourceDir } /{ exercise } ", $ "{ buildDir } /{ exercise } ") ;
25
+ CopyDirectory ( $ "{ exercisesSourceDir } /{ exercise } ", $ "{ exercisesBuildDir } /{ exercise } ") ;
26
26
} ) ;
27
27
28
28
Task ( "EnableAllTests" )
29
29
. IsDependentOn ( "CopyExercises" )
30
30
. Does ( ( ) => {
31
31
var skipRegex = new Regex ( @"Skip\s*=\s*""Remove to run test""" , RegexOptions . Compiled ) ;
32
- var testFiles = GetFiles ( buildDir + "/*/*Test.cs" ) ;
32
+ var testFiles = GetFiles ( exercisesBuildDir + "/*/*Test.cs" ) ;
33
33
34
34
foreach ( var testFile in testFiles ) {
35
35
var contents = System . IO . File . ReadAllText ( testFile . FullPath ) ;
@@ -47,17 +47,17 @@ Task("TestRefactoringProjects")
47
47
// These projects have a working default implementation, and have
48
48
// all the tests enabled. These should pass without any changes.
49
49
var refactoringProjects =
50
- GetFiles ( buildDir + "/*/TreeBuilding.csproj" )
51
- + GetFiles ( buildDir + "/*/Ledger.csproj" )
52
- + GetFiles ( buildDir + "/*/Markdown.csproj" ) ;
50
+ GetFiles ( exercisesBuildDir + "/*/TreeBuilding.csproj" )
51
+ + GetFiles ( exercisesBuildDir + "/*/Ledger.csproj" )
52
+ + GetFiles ( exercisesBuildDir + "/*/Markdown.csproj" ) ;
53
53
54
54
Parallel . ForEach ( refactoringProjects , parallelOptions , ( project ) => DotNetCoreTest ( project . FullPath ) ) ;
55
55
} ) ;
56
56
57
57
Task ( "ReplaceStubWithExample" )
58
58
. IsDependentOn ( "TestRefactoringProjects" )
59
59
. Does ( ( ) => {
60
- var allProjects = GetFiles ( buildDir + "/*/*.csproj" ) ;
60
+ var allProjects = GetFiles ( exercisesBuildDir + "/*/*.csproj" ) ;
61
61
62
62
foreach ( var project in allProjects ) {
63
63
var projectDir = project . GetDirectory ( ) ;
@@ -73,12 +73,18 @@ Task("ReplaceStubWithExample")
73
73
Task ( "TestUsingExampleImplementation" )
74
74
. IsDependentOn ( "ReplaceStubWithExample" )
75
75
. Does ( ( ) => {
76
- var allProjects = GetFiles ( buildDir + "/*/*.csproj" ) ;
76
+ var allProjects = GetFiles ( exercisesBuildDir + "/*/*.csproj" ) ;
77
77
Parallel . ForEach ( allProjects , parallelOptions , ( project ) => DotNetCoreTest ( project . FullPath ) ) ;
78
78
} ) ;
79
79
80
+ Task ( "BuildGenerators" )
81
+ . Does ( ( ) => {
82
+ DotNetCoreBuild ( "./generators/Generators.csproj" ) ;
83
+ } ) ;
84
+
80
85
Task ( "Default" )
81
86
. IsDependentOn ( "TestUsingExampleImplementation" )
87
+ . IsDependentOn ( "BuildGenerators" )
82
88
. Does ( ( ) => { } ) ;
83
89
84
90
RunTarget ( target ) ;
0 commit comments