Skip to content

Commit

Permalink
Revert back to solution build as the NuGet option consumes more memory
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Nov 4, 2023
1 parent e758a55 commit c15874f
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<BaseOutputPath>..\reactiveui\api\src\bin</BaseOutputPath>
<PlatformTarget>x64</PlatformTarget>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
Expand Down
73 changes: 48 additions & 25 deletions build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using ReactiveUI.Web;
using Nuke.Common.Tools.MSBuild;
using System.IO;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using System;

class Build : NukeBuild
{
public static int Main() => Execute<Build>(x => x.Compile);

private static readonly string reactiveui = nameof(reactiveui);
/// Support plugins are available for:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft VisualStudio https://nuke.build/visualstudio
/// - Microsoft VSCode https://nuke.build/vscode

[Solution(GenerateProjects = true)] private readonly Solution Solution;
public static int Main() => Execute<Build>(x => x.Compile);

[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
private readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;

private static readonly string reactiveui = nameof(reactiveui);
private static readonly string akavache = nameof(akavache);
private static readonly string fusillade = nameof(fusillade);
private static readonly string punchclock = nameof(punchclock);
private static readonly string splat = nameof(splat);
private static readonly string DynamicData = nameof(DynamicData);
private static readonly string reactivemarbles = nameof(reactivemarbles);
private static readonly string[] RxUIProjects = new string[] { reactiveui, akavache, fusillade, punchclock, splat, "ReactiveUI.Validation" };

private AbsolutePath RxUIAPIDirectory => RootDirectory / reactiveui / "api" / reactiveui;
private AbsolutePath RxSrcIDirectory => RootDirectory / reactiveui / "api" / "src";
private AbsolutePath RxMAPIDirectory => RootDirectory / reactiveui / "api" / reactivemarbles;

private Project PackageProject;

Target Clean => _ => _
.Before(Restore)
.Executes(() =>
{
RxUIAPIDirectory.DeleteDirectory();
RxSrcIDirectory.CreateOrCleanDirectory();
RxMAPIDirectory.DeleteDirectory();
// Install docfx
ProcessTasks.StartShell("dotnet tool update -g docfx").AssertZeroExitCode();
});
Expand All @@ -40,31 +47,47 @@ class Build : NukeBuild
.Executes(() =>
{
// Restore ReactiveUI Projects
RxUIAPIDirectory.GetSources(reactiveui, reactiveui);
RxUIAPIDirectory.GetSources(reactiveui, RxUIProjects);
// Restore Reactive Projects from Nuget
PackageProject = Solution.GetProject("NugetPackageExtractionForDocs");
DotNetRestore(s => s.SetProjectFile(PackageProject));
// Restore Reactive Marbles Projects
RxMAPIDirectory.GetSources(reactivemarbles, DynamicData);
});

Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
{
foreach (var project in RxUIProjects)
{
try
{
var dirRx = RxUIAPIDirectory / "external" / project / $"{project}-main" / "src";
File.Copy(RootDirectory / "global.json", dirRx / "global.json", true);
MSBuildTasks.MSBuild(s => s
.SetProjectFile(dirRx / $"{project}.sln")
.SetConfiguration(Configuration)
.SetRestore(true));
SourceFetcher.LogInfo($"{project} build complete");
}
catch (Exception ex)
{
SourceFetcher.LogRepositoryError(reactiveui, project, ex.ToString());
}
}
try
{
var dirRx = RxUIAPIDirectory / "external" / reactiveui / $"{reactiveui}-main" / "src";
File.Copy(RootDirectory / "global.json", dirRx / "global.json", true);
var dirDd = RxMAPIDirectory / "external" / DynamicData / $"{DynamicData}-main" / "src";
File.Copy(RootDirectory / "global.json", dirDd / "global.json", true);
MSBuildTasks.MSBuild(s => s
.SetProjectFile(dirRx / $"{reactiveui}.sln")
.SetProjectFile(dirDd / $"{DynamicData}.sln")
.SetConfiguration(Configuration)
.SetRestore(true));
SourceFetcher.LogInfo($"{DynamicData} build complete");
}
catch (Exception ex)
{
SourceFetcher.LogRepositoryError(reactivemarbles, DynamicData, ex.ToString());
}
catch { }
MSBuildTasks.MSBuild(s => s
.SetProjectFile(PackageProject)
.SetConfiguration(Configuration)
.SetRestore(true));
});
}
4 changes: 2 additions & 2 deletions build/SourceFetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private static void RunDotNet(AbsolutePath finalPath, string parameters)
process.Dispose();
}

private static void LogInfo(string message)
internal static void LogInfo(string message)
{
lock (_lockConsoleObject)
{
Expand All @@ -160,7 +160,7 @@ private static void LogInfo(string message)
private static void LogRepositoryInfo(string owner, string repository, string message) =>
LogInfo($"{message} {owner}/{repository}...");

private static void LogRepositoryError(string owner, string repository, string message)
internal static void LogRepositoryError(string owner, string repository, string message)
{
lock (_lockConsoleObject)
{
Expand Down
77 changes: 41 additions & 36 deletions reactiveui/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,52 @@
"src": [
{
"files": [
"/**/src/bin/*/netstandard2.0/Akavache.dll",
"/**/src/bin/*/netstandard2.0/Akavache.Core.dll",
"/**/src/bin/*/netstandard2.0/Akavache.Drawing.dll",
"/**/src/src/bin/*/netstandard2.0/Akavache.Mobiledll",
"/**/src/bin/*/netstandard2.0/Akavache.Sqlite3.dll",
"/**/src/bin/*/netstandard2.0/Fusillade.dll",
"/**/src/bin/*/netstandard2.0/Punchclock.dll",
"/**/src/bin/*/netstandard2.0/ReactiveUI.dll",
"/**/Akavache/bin/*/netstandard2.0/Akavache.dll",
"/**/Akavache.Core/bin/*/netstandard2.0/Akavache.Core.dll",
"/**/Akavache.Drawing/bin/*/netstandard2.0/Akavache.Drawing.dll",
"/**/Akavache.Mobile/bin/*/netstandard2.0/Akavache.Mobiledll",
"/**/Akavache.Sqlite3/bin/*/netstandard2.0/Akavache.Sqlite3.dll",
"/**/Fusillade/bin/*/netstandard2.0/Fusillade.dll",
"/**/Punchclock/bin/*/netstandard2.0/Punchclock.dll",
"/**/ReactiveUI/bin/*/netstandard2.0/ReactiveUI.dll",
"/**/ReactiveUI/bin/*/monoandroid13.0/ReactiveUI.dll",
"/**/src/bin/*/xamarin.ios10/ReactiveUI.dll",
"/**/src/bin/*/xamarin.mac20/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",
"/**/src/bin/*/netstandard2.0/ReactiveUI.Blazor.dll",
"/**/ReactiveUI.Blazor/bin/*/netstandard2.0/ReactiveUI.Blazor.dll",
"/**/ReactiveUI.Blend/bin/*/net7.0-windows10.0.19041.0/ReactiveUI.Blend.dll",
"/**/src/bin/*/net7.0/ReactiveUI.Drawing.dll",
"/**/src/bin/*/netstandard2.0/ReactiveUI.Fody.dll",
"/**/ReactiveUI.Drawing/bin/*/net7.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",
"/**/src/bin/*/net7.0/ReactiveUI.Maui.dll",
"/**/src/bin/*/netstandard2.0/ReactiveUI.Testing.dll",
"/**/ReactiveUI.Maui/bin/*/net7.0/ReactiveUI.Maui.dll",
"/**/ReactiveUI.Testing/bin/*/netstandard2.0/ReactiveUI.Testing.dll",
"/**/ReactiveUI.Winforms/bin/*/net7.0-windows10.0.19041.0/ReactiveUI.Winforms.dll",
"/**/ReactiveUI.WinUI/bin/*/net7.0-windows10.0.17763.0/ReactiveUI.WinUI.dll",
"/**/ReactiveUI.Wpf/bin/*/net7.0-windows10.0.19041.0/ReactiveUI.Wpf.dll",
"/**/src/bin/*/netstandard2.0/ReactiveUI.XamForms.dll",
"/**/src/bin/*/netstandard2.0/ReactiveUI.Validation.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",
"/**/src/bin/*/netstandard2.0/Splat.dll",
"/**/src/bin/*/netstandard2.0/Splat.AppCenter.dll",
"/**/src/bin/*/netstandard2.0/Splat.ApplicationInsights.dll",
"/**/src/bin/*/netstandard2.0/Splat.Autofac.dll",
"/**/src/bin/*/netstandard2.0/Splat.Drawing.dll",
"/**/src/bin/*/netstandard2.0/Splat.DryIoc.dll",
"/**/src/bin/*/netstandard2.0/Splat.Exceptionless.dll",
"/**/src/bin/*/netstandard2.0/Splat.Log4Net.dll",
"/**/src/bin/*/netstandard2.0/Splat.Microsoft.Extensions.DependencyInjection.dll",
"/**/src/bin/*/netstandard2.0/Splat.Microsoft.Extensions.Logging.dll",
"/**/src/bin/*/netstandard2.0/Splat.Ninject.dll",
"/**/src/bin/*/netstandard2.0/Splat.NLog.dll",
"/**/src/bin/*/netstandard2.0/Splat.Prism.dll",
"/**/src/bin/*/netstandard2.0/Splat.Prism.Forms.dll",
"/**/src/bin/*/netstandard2.0/Splat.Raygun.dll",
"/**/src/bin/*/netstandard2.0/Splat.Serilog.dll",
"/**/src/bin/*/netstandard2.0/Splat.SimpleInjector.dll",
"/**/src/bin/*/netstandard2.0/DynamicData.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"
]
}
],
Expand Down Expand Up @@ -123,6 +123,11 @@
],
"postProcessors": [],
"keepFileLink": false,
"disableGitFeatures": false
"disableGitFeatures": false,
"sitemap": {
"baseUrl": "https://www.reactiveui.net",
"priority": 0.1,
"changefreq": "monthly"
}
}
}

0 comments on commit c15874f

Please sign in to comment.