1313using static Nuke . Common . IO . FileSystemTasks ;
1414using static Nuke . Common . IO . PathConstruction ;
1515using static Nuke . Common . Tools . DotNet . DotNetTasks ;
16+ using static Nuke . Common . Logger ;
1617
1718[ CheckBuildProjectConfigurations ]
1819[ ShutdownDotNetAfterServerBuild ]
@@ -24,7 +25,7 @@ class Build : NukeBuild
2425 /// - Microsoft VisualStudio https://nuke.build/visualstudio
2526 /// - Microsoft VSCode https://nuke.build/vscode
2627
27- public static int Main ( ) => Execute < Build > ( x => x . Compile ) ;
28+ public static int Main ( ) => Execute < Build > ( x => x . Publish ) ;
2829
2930 [ Parameter ( "Configuration to build - Default is 'Debug' (local) or 'Release' (server)" ) ]
3031 readonly Configuration Configuration = IsLocalBuild ? Configuration . Debug : Configuration . Release ;
@@ -65,8 +66,9 @@ class Build : NukeBuild
6566 . DependsOn ( Compile , Clean )
6667 . Executes ( ( ) =>
6768 {
69+ var projectName = "Excursion360.Desktop" ;
6870 DotNetPublish ( s => s
69- . SetProject ( Solution . GetProject ( "Excursion360.Desktop" ) )
71+ . SetProject ( Solution . GetProject ( projectName ) )
7072 . SetConfiguration ( Configuration )
7173 . SetOutput ( OutputDirectory )
7274 . SetRuntime ( Runtime )
@@ -76,6 +78,14 @@ class Build : NukeBuild
7678 . SetProperty ( "DebugType" , "None" )
7779 . SetProperty ( "DebugSymbols" , false )
7880 . EnableNoRestore ( ) ) ;
81+
82+ var executableFile = System . IO . Directory . GetFiles ( OutputDirectory )
83+ . Select ( System . IO . Path . GetFileName )
84+ . Where ( f => f . StartsWith ( projectName ) )
85+ . Single ( ) ;
86+ RenameFile ( OutputDirectory / executableFile ,
87+ $ "{ OutputDirectory / projectName } .{ Runtime } { executableFile . Substring ( projectName . Length ) } ") ;
88+
7989 } ) ;
8090
8191}
0 commit comments