Skip to content

Commit

Permalink
Fix (fudge) documentation generation
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Nov 13, 2024
1 parent 4ebf55d commit c8fba62
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 52 deletions.
6 changes: 3 additions & 3 deletions AltCover.Cake/AltCover.Cake.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<RootNamespace>AltCover.Cake</RootNamespace>
<AssemblyName>AltCover.Cake</AssemblyName>
Expand All @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cake.Common" />
<PackageReference Include="Cake.Core" />
<PackageReference Include="Cake.Common" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Cake.Core" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
114 changes: 114 additions & 0 deletions AltCover.Cake/CakeMix.cs
Original file line number Diff line number Diff line change
@@ -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<IProcessArgument> Skip(int n)
{ return null; }

public IEnumerable<IProcessArgument> 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<Cake.Core.IO.ProcessArgumentBuilder, Cake.Core.IO.ProcessArgumentBuilder> ArgumentCustomization { get; set; }
}
}

#endif
95 changes: 46 additions & 49 deletions Build/targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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 () ->
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c8fba62

Please sign in to comment.