diff --git a/build/Build.cs b/build/Build.cs index 34b9e2e1..400af525 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -1,10 +1,14 @@ using Nuke.Common; using Nuke.Common.IO; +using Nuke.Common.ProjectModel; using Nuke.Common.Tooling; -using ReactiveUI.Web; +using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.MSBuild; -using System.IO; +using ReactiveUI.Web; using System; +using System.IO; +using System.Linq; +using static Nuke.Common.Tools.DotNet.DotNetTasks; class Build : NukeBuild { @@ -65,19 +69,33 @@ class Build : NukeBuild var dirRx = RxUIAPIDirectory / "external" / project / $"{project}-main" / "src"; File.Copy(RootDirectory / "global.json", dirRx / "global.json", true); var solutionFile = dirRx / $"{project}.sln"; + + // Find any .sln or .slnx file as a fallback + var solutionFileSearch = Directory.EnumerateFiles(dirRx, "*.sln*").FirstOrDefault(); if (File.Exists(solutionFile) == false) { solutionFile += "x"; if (File.Exists(solutionFile) == false) { - SourceFetcher.LogRepositoryError(reactiveui, project, $"Solution file not found: {dirRx / $"{project}.sln(x)"}"); - continue; + if (File.Exists(solutionFileSearch)) + { + solutionFile = solutionFileSearch; + } + else + { + SourceFetcher.LogRepositoryError(reactiveui, project, $"Solution file not found: {dirRx / $"{project}.sln(x)"}"); + continue; + } } } - MSBuildTasks.MSBuild(s => s + + SourceFetcher.LogInfo($"Restoring {solutionFile}..."); + DotNetRestore(s => s.SetProjectFile(solutionFile)); + SourceFetcher.LogInfo($"Building {solutionFile}..."); + DotNetBuild(s => s .SetProjectFile(solutionFile) .SetConfiguration(Configuration) - .SetRestore(true)); + .EnableNoRestore()); SourceFetcher.LogInfo($"{project} build complete"); } catch (Exception ex) @@ -100,6 +118,8 @@ class Build : NukeBuild return; } } + + SourceFetcher.LogInfo($"Building {solutionFile}..."); MSBuildTasks.MSBuild(s => s .SetProjectFile(solutionFile) .SetConfiguration(Configuration) diff --git a/build/SourceFetcher.cs b/build/SourceFetcher.cs index f08271e4..47d37783 100644 --- a/build/SourceFetcher.cs +++ b/build/SourceFetcher.cs @@ -115,7 +115,26 @@ private static void FetchNuGet(string owner, string repository, AbsolutePath fin LogRepositoryInfo(owner, repository, "Restoring Packages for "); var directory = useSrc ? finalPath / $"{repository}-main" / "src" : finalPath; - RunDotNet(directory, $"restore {repository}.sln"); + + // Find any .sln or .slnx file and run dotnet restore on it + var solutionFile = Directory.EnumerateFiles(directory.ToString(), "*.sln*").FirstOrDefault(); + + if (File.Exists(directory / $"{repository}.sln")) + { + RunDotNet(directory, $"restore {repository}.sln"); + } + else if (File.Exists(directory / $"{repository}.slnx")) + { + RunDotNet(directory, $"restore {repository}.slnx"); + } + else if (solutionFile != null) + { + RunDotNet(directory, $"restore {Path.GetFileName(solutionFile)}"); + } + else + { + LogRepositoryError(owner, repository, "No solution file found to restore packages."); + } } private static void WorkflowRestore(string owner, string repository, AbsolutePath finalPath, bool useSrc) @@ -125,7 +144,25 @@ private static void WorkflowRestore(string owner, string repository, AbsolutePat LogRepositoryInfo(owner, repository, "Restoring workload for "); var directory = useSrc ? finalPath / $"{repository}-main" / "src" : finalPath; - RunDotNet(directory, $"workload restore {repository}.sln"); + + // Find any .sln or .slnx file and run dotnet restore on it + var solutionFile = Directory.EnumerateFiles(directory.ToString(), "*.sln*").FirstOrDefault(); + if (File.Exists(directory / $"{repository}.sln")) + { + RunDotNet(directory, $"workload restore {repository}.sln"); + } + else if (File.Exists(directory / $"{repository}.slnx")) + { + RunDotNet(directory, $"workload restore {repository}.slnx"); + } + else if (solutionFile != null) + { + RunDotNet(directory, $"workload restore {Path.GetFileName(solutionFile)}"); + } + else + { + LogRepositoryError(owner, repository, "No solution file found to restore workloads."); + } } } @@ -159,7 +196,7 @@ internal static void LogInfo(string message) } } - private static void LogRepositoryInfo(string owner, string repository, string message) => + internal static void LogRepositoryInfo(string owner, string repository, string message) => LogInfo($"{message} {owner}/{repository}..."); internal static void LogRepositoryError(string owner, string repository, string message) diff --git a/global.json b/global.json index 9eeb4288..e91e4418 100644 --- a/global.json +++ b/global.json @@ -2,5 +2,8 @@ "sdk": { "version": "10.0.101", "rollForward": "latestFeature" + }, + "msbuild-sdks": { + "MSBuild.Sdk.Extras": "3.0.44" } } diff --git a/reactiveui/docfx.json b/reactiveui/docfx.json index dfd873b7..6d8fdcee 100644 --- a/reactiveui/docfx.json +++ b/reactiveui/docfx.json @@ -4,55 +4,49 @@ "src": [ { "files": [ - "/**/Akavache.Core/bin/*/netstandard2.0/Akavache.dll", - "/**/Akavache.SystemTextJson/bin/*/netstandard2.0/Akavache.SystemTextJson.dll", - "/**/Akavache.NewtonsoftJson/bin/*/netstandard2.0/Akavache.NewtonsoftJson.dll", - "/**/Akavache.Sqlite3/bin/*/netstandard2.0/Akavache.Sqlite3.dll", - "/**/Akavache.EncryptedSqlite3/bin/*/netstandard2.0/Akavache.EncryptedSqlite3.dll", - "/**/Akavache.Drawing/bin/*/netstandard2.0/Akavache.Drawing.dll", - "/**/Akavache.Settings/bin/*/netstandard2.0/Akavache.Settings", - "/**/Fusillade/bin/*/netstandard2.0/Fusillade.dll", + "/**/Akavache.Core/bin/*/net10.0/Akavache.dll", + "/**/Akavache.SystemTextJson/bin/*/net10.0/Akavache.SystemTextJson.dll", + "/**/Akavache.NewtonsoftJson/bin/*/net10.0/Akavache.NewtonsoftJson.dll", + "/**/Akavache.Sqlite3/bin/*/net10.0/Akavache.Sqlite3.dll", + "/**/Akavache.EncryptedSqlite3/bin/*/net10.0/Akavache.EncryptedSqlite3.dll", + "/**/Akavache.Drawing/bin/*/net10.0/Akavache.Drawing.dll", + "/**/Akavache.Settings/bin/*/net10.0/Akavache.Settings", + "/**/Fusillade/bin/*/net10.0/Fusillade.dll", "/**/Punchclock/bin/*/netstandard2.0/Punchclock.dll", - "/**/ReactiveUI/bin/*/netstandard2.0/ReactiveUI.dll", - "/**/ReactiveUI/bin/*/monoandroid13.0/ReactiveUI.dll", - "/**/ReactiveUI/bin/*/xamarin.ios10/ReactiveUI.dll", - "/**/ReactiveUI/bin/*/xamarin.mac20/ReactiveUI.dll", - "/**/ReactiveUI.AndroidSupport/bin/*/monoandroid13.0/ReactiveUI.AndroidSupport.dll", - "/**/ReactiveUI.AndroidX/bin/*/monoandroid13.0/ReactiveUI.AndroidX.dll", - "/**/ReactiveUI.Blazor/bin/*/netstandard2.0/ReactiveUI.Blazor.dll", - "/**/ReactiveUI.Blend/bin/*/net9.0-windows10.0.17763.0/ReactiveUI.Blend.dll", - "/**/ReactiveUI.Drawing/bin/*/netstandard2.0/ReactiveUI.Drawing.dll", - "/**/ReactiveUI.Fody/bin/*/netstandard2.0/ReactiveUI.Fody.dll", - "/**/ReactiveUI.Fody.Analyzer/bin/*/netstandard2.0/ReactiveUI.Fody.Analyzer.dll", - "/**/ReactiveUI.Fody.Helpers/bin/*/netstandard2.0/ReactiveUI.Fody.Helpers.dll", - "/**/ReactiveUI.Maui/bin/*/net9.0/ReactiveUI.Maui.dll", - "/**/ReactiveUI.Testing/bin/*/netstandard2.0/ReactiveUI.Testing.dll", - "/**/ReactiveUI.Winforms/bin/*/net9.0-windows10.0.19041.0/ReactiveUI.Winforms.dll", - "/**/ReactiveUI.WinUI/bin/*/net9.0-windows10.0.17763.0/ReactiveUI.WinUI.dll", - "/**/ReactiveUI.Wpf/bin/*/net9.0-windows10.0.19041.0/ReactiveUI.Wpf.dll", - "/**/ReactiveUI.XamForms/bin/*/netstandard2.0/ReactiveUI.XamForms.dll", - "/**/ReactiveUI.Validation/bin/*/netstandard2.0/ReactiveUI.Validation.dll", - "/**/ReactiveUI.Validation.AndroidSupport/bin/*/monoandroid13.0/ReactiveUI.Validation.AndroidSupport.dll", - "/**/ReactiveUI.Validation.AndroidX/bin/*/monoandroid13.0/ReactiveUI.Validation.AndroidX.dll", - "/**/Splat.Builder/bin/*/netstandard2.0/Splat.Builder.dll", - "/**/Splat/bin/*/netstandard2.0/Splat.dll", - "/**/Splat.AppCenter/bin/*/netstandard2.0/Splat.AppCenter.dll", - "/**/Splat.ApplicationInsights/bin/*/netstandard2.0/Splat.ApplicationInsights.dll", - "/**/Splat.Autofac/bin/*/netstandard2.0/Splat.Autofac.dll", - "/**/Splat.Drawing/bin/*/netstandard2.0/Splat.Drawing.dll", - "/**/Splat.DryIoc/bin/*/netstandard2.0/Splat.DryIoc.dll", - "/**/Splat.Exceptionless/bin/*/netstandard2.0/Splat.Exceptionless.dll", - "/**/Splat.Log4Net/bin/*/netstandard2.0/Splat.Log4Net.dll", - "/**/Splat.Microsoft.Extensions.DependencyInjection/bin/*/netstandard2.0/Splat.Microsoft.Extensions.DependencyInjection.dll", - "/**/Splat.Microsoft.Extensions.Logging/bin/*/netstandard2.0/Splat.Microsoft.Extensions.Logging.dll", - "/**/Splat.Ninject/bin/*/netstandard2.0/Splat.Ninject.dll", - "/**/Splat.NLog/bin/*/netstandard2.0/Splat.NLog.dll", - "/**/Splat.Prism/bin/*/netstandard2.0/Splat.Prism.dll", - "/**/Splat.Prism.Forms/bin/*/netstandard2.0/Splat.Prism.Forms.dll", - "/**/Splat.Raygun/bin/*/netstandard2.0/Splat.Raygun.dll", - "/**/Splat.Serilog/bin/*/netstandard2.0/Splat.Serilog.dll", - "/**/Splat.SimpleInjector/bin/*/netstandard2.0/Splat.SimpleInjector.dll", - "/**/DynamicData/bin/*/netstandard2.0/DynamicData.dll" + "/**/ReactiveUI/bin/*/net10.0/ReactiveUI.dll", + "/**/ReactiveUI.AndroidX/bin/*/net10.0-android/ReactiveUI.AndroidX.dll", + "/**/ReactiveUI.Blazor/bin/*/net10.0/ReactiveUI.Blazor.dll", + "/**/ReactiveUI.Blend/bin/*/net10.0-windows10.0.19041.0/ReactiveUI.Blend.dll", + "/**/ReactiveUI.Drawing/bin/*/net10.0/ReactiveUI.Drawing.dll", + "/**/ReactiveUI.Maui/bin/*/net10.0/ReactiveUI.Maui.dll", + "/**/ReactiveUI.Testing/bin/*/net10.0/ReactiveUI.Testing.dll", + "/**/ReactiveUI.Winforms/bin/*/net10.0-windows10.0.19041.0/ReactiveUI.Winforms.dll", + "/**/ReactiveUI.WinUI/bin/*/net10.0-windows10.0.19041.0/ReactiveUI.WinUI.dll", + "/**/ReactiveUI.Wpf/bin/*/net10.0-windows10.0.19041.0/ReactiveUI.Wpf.dll", + "/**/ReactiveUI.Validation/bin/*/net10.0/ReactiveUI.Validation.dll", + "/**/ReactiveUI.Validation.AndroidX/bin/*/net10.0-android/ReactiveUI.Validation.AndroidX.dll", + "/**/ReactiveUI.Maui.Plugins.Popup/bin/*/net10.0/ReactiveUI.Maui.Plugins.Popup.dll", + "/**/Splat.Core/bin/*/net10.0/Splat.Core.dll", + "/**/Splat.Builder/bin/*/net10.0/Splat.Builder.dll", + "/**/Splat/bin/*/net10.0/Splat.dll", + "/**/Splat.AppCenter/bin/*/net10.0/Splat.AppCenter.dll", + "/**/Splat.ApplicationInsights/bin/*/net10.0/Splat.ApplicationInsights.dll", + "/**/Splat.Autofac/bin/*/net10.0/Splat.Autofac.dll", + "/**/Splat.Drawing/bin/*/net10.0/Splat.Drawing.dll", + "/**/Splat.DryIoc/bin/*/net10.0/Splat.DryIoc.dll", + "/**/Splat.Exceptionless/bin/*/net10.0/Splat.Exceptionless.dll", + "/**/Splat.Log4Net/bin/*/net10.0/Splat.Log4Net.dll", + "/**/Splat.Microsoft.Extensions.DependencyInjection/bin/*/net10.0/Splat.Microsoft.Extensions.DependencyInjection.dll", + "/**/Splat.Microsoft.Extensions.Logging/bin/*/net10.0/Splat.Microsoft.Extensions.Logging.dll", + "/**/Splat.Ninject/bin/*/net10.0/Splat.Ninject.dll", + "/**/Splat.NLog/bin/*/net10.0/Splat.NLog.dll", + "/**/Splat.Prism/bin/*/net10.0/Splat.Prism.dll", + "/**/Splat.Prism.Forms/bin/*/net10.0/Splat.Prism.Forms.dll", + "/**/Splat.Raygun/bin/*/net10.0/Splat.Raygun.dll", + "/**/Splat.Serilog/bin/*/net10.0/Splat.Serilog.dll", + "/**/Splat.SimpleInjector/bin/*/net10.0/Splat.SimpleInjector.dll", + "/**/DynamicData/bin/*/net9.0/DynamicData.dll", + "/**/ReactiveUI.Extensions/bin/*/net10.0/ReactiveUI.Extensions.dll" ] } ],