From c8fba62a2e23eacddd57a0adb415b991e1ca0e06 Mon Sep 17 00:00:00 2001 From: SteveGilham Date: Wed, 13 Nov 2024 15:53:04 +0000 Subject: [PATCH] Fix (fudge) documentation generation --- AltCover.Cake/AltCover.Cake.csproj | 6 +- AltCover.Cake/CakeMix.cs | 114 +++++++++++++++++++++++++++++ Build/targets.fs | 95 ++++++++++++------------ 3 files changed, 163 insertions(+), 52 deletions(-) create mode 100644 AltCover.Cake/CakeMix.cs diff --git a/AltCover.Cake/AltCover.Cake.csproj b/AltCover.Cake/AltCover.Cake.csproj index 5220e75c..6b74c4a0 100644 --- a/AltCover.Cake/AltCover.Cake.csproj +++ b/AltCover.Cake/AltCover.Cake.csproj @@ -1,7 +1,7 @@  - net8.0 + net8.0;netstandard2.1 false AltCover.Cake AltCover.Cake @@ -27,8 +27,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/AltCover.Cake/CakeMix.cs b/AltCover.Cake/CakeMix.cs new file mode 100644 index 00000000..b33071d0 --- /dev/null +++ b/AltCover.Cake/CakeMix.cs @@ -0,0 +1,114 @@ +using System; +using System.ComponentModel; +using System.Collections.Generic; + +#if NETSTANDARD2_1 + +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member + +namespace Cake.Core +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ICakeContext + { + Cake.Core.Diagnostics.ICakeLog Log { get; } + } +} + +namespace Cake.Core.Diagnostics +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public interface ICakeLog + { + void Write(Verbosity v, LogLevel l, string format); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public enum Verbosity + { + Normal, + Verbose + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public enum LogLevel + { + Information, + Error, + Warning, + Verbose + } +} + +namespace Cake.Core.IO +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public class ProcessArgumentBuilder + { + public void Append(string s) + { } + + public void Append(IProcessArgument s) + { } + + public IEnumerable Skip(int n) + { return null; } + + public IEnumerable Take(int n) + { return null; } + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public interface IProcessArgument + { } + + [EditorBrowsable(EditorBrowsableState.Never)] + public class FilePath + { + public FilePath GetFilename() + { return null; } + + public string FullPath + { get { return String.Empty; } } + } +} + +namespace Cake.Core.Annotations +{ + [EditorBrowsable(EditorBrowsableState.Never)] + [AttributeUsage(AttributeTargets.Method)] + public class CakeMethodAliasAttribute : Attribute + { } + + [EditorBrowsable(EditorBrowsableState.Never)] + [AttributeUsage(AttributeTargets.All)] + public class CakeAliasCategoryAttribute : Attribute + { + public CakeAliasCategoryAttribute(string s) + { } + } +} + +namespace Cake.Common.Tools.DotNet +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public static class DotNetAliases + { + public static void DotNetTest( + Cake.Core.ICakeContext context, + string fullPath, + Cake.Common.Tools.DotNet.Test.DotNetTestSettings testSettings) + { } + } +} + +namespace Cake.Common.Tools.DotNet.Test +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public class DotNetTestSettings + { + public Func ArgumentCustomization { get; set; } + } +} + +#endif \ No newline at end of file diff --git a/Build/targets.fs b/Build/targets.fs index 3a6ea971..95f8d373 100644 --- a/Build/targets.fs +++ b/Build/targets.fs @@ -4422,7 +4422,52 @@ module Targets = Shell.copyFile (unpacked + "System.Management.Automation.dll") ((packageVersionPart "PowerShellStandard.Library") - + "System.Management.Automation.dll")) + + "System.Management.Automation.dll") + + [ "AltCover.Base" + "AltCover.DotNet" + "AltCover.Engine" // beware static linkage -- maybe copy from debug? + "AltCover.Monitor" + "AltCover.PowerShell" + "AltCover.Toolkit" ] + |> List.iter (fun n -> + Shell.copyFile + (unpacked + n + ".xml") + ("./_Binaries/" + + n + + "/Release+AnyCPU/netstandard2.0/" + + n + + ".xml") + + Actions.RunDotnet + (dotnetOptions >> dotnetOptionsWithRollForwards) + "xmldocmd" + (unpacked + + n + + ".dll ./_Documentation/" + + n + + " --visibility public --skip-unbrowsable --clean") + ("documenting " + n)) + + [ "AltCover.Cake" ] + |> List.iter (fun n -> + //Shell.copyFile + // (unpacked + n + ".xml") + // ("./_Binaries/" + // + n + // + "/Release+AnyCPU/netstandard2.0/" + // + n + // + ".xml") + + Actions.RunDotnet + (dotnetOptions >> dotnetOptionsWithRollForwards) + "xmldocmd" + ("./_Binaries/" + n + "/Release+AnyCPU/netstandard2.1/" + + n + + ".dll ./_Documentation/" + + n + + " --visibility public --skip-unbrowsable --clean") + ("documenting " + n))) let WindowsPowerShell = (fun () -> @@ -7806,54 +7851,6 @@ module Targets = let MakeDocumentation = (fun () -> - let unpacked = - "./_Packaging.api/Unpack/lib/netstandard2.0/" - - [ "AltCover.Base" - "AltCover.DotNet" - "AltCover.Engine" // beware static linkage -- maybe copy from debug? - "AltCover.Monitor" - "AltCover.PowerShell" - "AltCover.Toolkit" ] - |> List.iter (fun n -> - Shell.copyFile - (unpacked + n + ".xml") - ("./_Binaries/" - + n - + "/Release+AnyCPU/netstandard2.0/" - + n - + ".xml") - - Actions.RunDotnet - (dotnetOptions >> dotnetOptionsWithRollForwards) - "xmldocmd" - (unpacked - + n - + ".dll ./_Documentation/" - + n - + " --visibility public --skip-unbrowsable --clean") - ("documenting " + n)) - - [ (*"AltCover.Cake"*) ] - |> List.iter (fun n -> - Shell.copyFile - (unpacked + n + ".xml") - ("./_Binaries/" - + n - + "/Release+AnyCPU/net8.0/" - + n - + ".xml") - - Actions.RunDotnet - (dotnetOptions >> dotnetOptionsWithRollForwards) - "xmldocmd" - (unpacked - + n - + ".dll ./_Documentation/" - + n - + " --visibility public --skip-unbrowsable --clean") - ("documenting " + n)) - let branch = Information.getBranchName (".") Assert.That(branch, Is.EqualTo("master").Or.StartWith("develop/docs/"), branch)