@ -36,13 +36,13 @@ partial class Build : NukeBuild
[NuGetPackage("Microsoft.DotNet.ApiCompat.Tool", "Microsoft.DotNet.ApiCompat.Tool.dll", Framework = "net8.0")]
Tool ApiCompatTool ;
[NuGetPackage("Microsoft.DotNet.ApiDiff.Tool", "Microsoft.DotNet.ApiDiff.Tool.dll", Framework = "net8.0")]
Tool ApiDiffTool ;
[NuGetPackage("dotnet-ilrepack", "ILRepackTool.dll", Framework = "net8.0")]
Tool IlRepackTool ;
protected override void OnBuildInitialized ( )
{
Parameters = new BuildParameters ( this , ScheduledTargets . Contains ( BuildToNuGetCache ) ) ;
@ -57,6 +57,7 @@ partial class Build : NukeBuild
Information ( "Repository Name: " + Parameters . RepositoryName ) ;
Information ( "Repository Branch: " + Parameters . RepositoryBranch ) ;
}
Information ( "Configuration: " + Parameters . Configuration ) ;
Information ( "IsLocalBuild: " + Parameters . IsLocalBuild ) ;
Information ( "IsRunningOnUnix: " + Parameters . IsRunningOnUnix ) ;
@ -73,8 +74,9 @@ partial class Build : NukeBuild
void ExecWait ( string preamble , string command , string args )
{
Console . WriteLine ( preamble ) ;
Process . Start ( new ProcessStartInfo ( command , args ) { UseShellExecute = false } ) . WaitForExit ( ) ;
Process . Start ( new ProcessStartInfo ( command , args ) { UseShellExecute = false } ) . WaitForExit ( ) ;
}
ExecWait ( "dotnet version:" , "dotnet" , "--info" ) ;
ExecWait ( "dotnet workloads:" , "dotnet" , "workload list" ) ;
Information ( "Processor count: " + Environment . ProcessorCount ) ;
@ -99,6 +101,7 @@ partial class Build : NukeBuild
. AddProperty ( "SkipBuildingTests" , "True" ) ;
return c ;
}
DotNetBuildSettings ApplySetting ( DotNetBuildSettings c , Configure < DotNetBuildSettings > configurator = null ) = >
ApplySettingCore ( c ) . Build . Apply ( configurator ) ;
@ -129,6 +132,17 @@ partial class Build : NukeBuild
}
} ) ;
// Ensure that Bun.Official.Tool is downloaded at least once on CI to work around https://github.com/dotnet/sdk/issues/51831
Target InitDnx = > _ = > _
. Executes ( ( ) = >
{
var process = ProcessTasks . StartProcess (
"dnx" ,
"Bun.Unofficial.Tool --yes -- install" ,
$"{RootDirectory}/src/Browser/Avalonia.Browser/webapp" ) ;
process . AssertZeroExitCode ( ) ;
} ) ;
Target CompileNative = > _ = > _
. DependsOn ( Clean )
. DependsOn ( GenerateCppHeaders )
@ -141,7 +155,7 @@ partial class Build : NukeBuild
} ) ;
Target Compile = > _ = > _
. DependsOn ( Clean , CompileNative )
. DependsOn ( Clean , CompileNative , InitDnx )
. Executes ( ( ) = >
{
DotNetBuild ( c = > ApplySetting ( c )