@@ -24,7 +24,9 @@ class Build : NukeBuild
2424 /// - Microsoft VisualStudio https://nuke.build/visualstudio
2525 /// - Microsoft VSCode https://nuke.build/vscode
2626
27- public static int Main ( ) => Execute < Build > ( x => x . Compile ) ;
27+ public static int Main ( ) => Execute < Build > (
28+ x => x . UnitTests ,
29+ x => x . Pack ) ;
2830
2931 [ Parameter ( "Configuration to build - Default is 'Debug' (local) or 'Release' (server)" ) ]
3032 readonly Configuration Configuration = IsLocalBuild ? Configuration . Debug : Configuration . Release ;
@@ -33,9 +35,9 @@ class Build : NukeBuild
3335 [ GitRepository ] readonly GitRepository GitRepository ;
3436 [ GitVersion ] readonly GitVersion GitVersion ;
3537
36- AbsolutePath SourceDirectory => RootDirectory / "src " ;
37- AbsolutePath TestsDirectory => RootDirectory / "tests " ;
38- AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts " ;
38+ AbsolutePath SourceDirectory => RootDirectory / "Src " ;
39+ AbsolutePath TestsDirectory => RootDirectory / "Tests " ;
40+ AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts " ;
3941
4042 Target Clean => _ => _
4143 . Before ( Restore )
@@ -66,4 +68,24 @@ class Build : NukeBuild
6668 . EnableNoRestore ( ) ) ;
6769 } ) ;
6870
71+ Target UnitTests => _ => _
72+ . DependsOn ( Compile )
73+ . Executes ( ( ) =>
74+ {
75+ DotNetTest ( s => s
76+ . SetProjectFile ( Solution . GetProject ( "FluentAssertions.Reactive.Specs" ) )
77+ . SetConfiguration ( Configuration . Debug )
78+ . CombineWith ( cc => cc . SetFramework ( "netcoreapp3.1" ) ) ) ;
79+ } ) ;
80+
81+ Target Pack => _ => _
82+ . DependsOn ( UnitTests )
83+ . Executes ( ( ) =>
84+ {
85+ DotNetPack ( s => s
86+ . SetProject ( Solution . GetProject ( "FluentAssertions.Reactive" ) )
87+ . SetOutputDirectory ( ArtifactsDirectory )
88+ . SetConfiguration ( Configuration . Release )
89+ . SetVersion ( GitVersion . NuGetVersionV2 ) ) ;
90+ } ) ;
6991}
0 commit comments