Fix dnx random failures (#20284)
* Try to fix dnx random failure * Use full paths for WebAppDir everywhere * Call dnx explicitly on CI --------- Co-authored-by: Max Katz <maxkatz6@outlook.com>
This commit is contained in:
committed by
GitHub
parent
79be86d923
commit
37526dc904
@@ -35,6 +35,7 @@
|
||||
"CreateNugetPackages",
|
||||
"DownloadApiBaselinePackages",
|
||||
"GenerateCppHeaders",
|
||||
"InitDnx",
|
||||
"OutputApiDiff",
|
||||
"OutputVersion",
|
||||
"Package",
|
||||
|
||||
+16
-2
@@ -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)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<NoWarn>$(NoWarn);CS1591</NoWarn>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<NugetPackageName>Avalonia</NugetPackageName>
|
||||
<WebAppDir>Remote\HtmlTransport\webapp</WebAppDir>
|
||||
<WebAppDir>$(MSBuildThisFileDirectory)Remote/HtmlTransport/webapp</WebAppDir>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Remote\HtmlTransport\webapp\build\**\*.gz" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TargetFrameworks>$(AvsCurrentTargetFramework);$(AvsCurrentBrowserTargetFramework)</TargetFrameworks>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<WebAppDir>webapp</WebAppDir>
|
||||
<WebAppDir>$(MSBuildThisFileDirectory)webapp</WebAppDir>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>$(AvsCurrentTargetFramework)</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<WebAppDir>Remote\HtmlTransport\webapp</WebAppDir>
|
||||
<WebAppDir>$(MSBuildThisFileDirectory)Remote/HtmlTransport/webapp</WebAppDir>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\build\UnitTests.NetCore.targets" />
|
||||
<Import Project="..\..\build\Moq.props" />
|
||||
|
||||
Reference in New Issue
Block a user