Skip to content

Commit c8fba62

Browse files
committed
Fix (fudge) documentation generation
1 parent 4ebf55d commit c8fba62

File tree

3 files changed

+163
-52
lines changed

3 files changed

+163
-52
lines changed

AltCover.Cake/AltCover.Cake.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;netstandard2.1</TargetFrameworks>
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
<RootNamespace>AltCover.Cake</RootNamespace>
77
<AssemblyName>AltCover.Cake</AssemblyName>
@@ -27,8 +27,8 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Cake.Common" />
31-
<PackageReference Include="Cake.Core" />
30+
<PackageReference Include="Cake.Common" Condition="'$(TargetFramework)' == 'net8.0'" />
31+
<PackageReference Include="Cake.Core" Condition="'$(TargetFramework)' == 'net8.0'" />
3232
<PackageReference Include="Microsoft.SourceLink.GitHub">
3333
<PrivateAssets>all</PrivateAssets>
3434
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>

AltCover.Cake/CakeMix.cs

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
using System;
2+
using System.ComponentModel;
3+
using System.Collections.Generic;
4+
5+
#if NETSTANDARD2_1
6+
7+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
8+
9+
namespace Cake.Core
10+
{
11+
[EditorBrowsable(EditorBrowsableState.Never)]
12+
public interface ICakeContext
13+
{
14+
Cake.Core.Diagnostics.ICakeLog Log { get; }
15+
}
16+
}
17+
18+
namespace Cake.Core.Diagnostics
19+
{
20+
[EditorBrowsable(EditorBrowsableState.Never)]
21+
public interface ICakeLog
22+
{
23+
void Write(Verbosity v, LogLevel l, string format);
24+
}
25+
26+
[EditorBrowsable(EditorBrowsableState.Never)]
27+
public enum Verbosity
28+
{
29+
Normal,
30+
Verbose
31+
}
32+
33+
[EditorBrowsable(EditorBrowsableState.Never)]
34+
public enum LogLevel
35+
{
36+
Information,
37+
Error,
38+
Warning,
39+
Verbose
40+
}
41+
}
42+
43+
namespace Cake.Core.IO
44+
{
45+
[EditorBrowsable(EditorBrowsableState.Never)]
46+
public class ProcessArgumentBuilder
47+
{
48+
public void Append(string s)
49+
{ }
50+
51+
public void Append(IProcessArgument s)
52+
{ }
53+
54+
public IEnumerable<IProcessArgument> Skip(int n)
55+
{ return null; }
56+
57+
public IEnumerable<IProcessArgument> Take(int n)
58+
{ return null; }
59+
}
60+
61+
[EditorBrowsable(EditorBrowsableState.Never)]
62+
public interface IProcessArgument
63+
{ }
64+
65+
[EditorBrowsable(EditorBrowsableState.Never)]
66+
public class FilePath
67+
{
68+
public FilePath GetFilename()
69+
{ return null; }
70+
71+
public string FullPath
72+
{ get { return String.Empty; } }
73+
}
74+
}
75+
76+
namespace Cake.Core.Annotations
77+
{
78+
[EditorBrowsable(EditorBrowsableState.Never)]
79+
[AttributeUsage(AttributeTargets.Method)]
80+
public class CakeMethodAliasAttribute : Attribute
81+
{ }
82+
83+
[EditorBrowsable(EditorBrowsableState.Never)]
84+
[AttributeUsage(AttributeTargets.All)]
85+
public class CakeAliasCategoryAttribute : Attribute
86+
{
87+
public CakeAliasCategoryAttribute(string s)
88+
{ }
89+
}
90+
}
91+
92+
namespace Cake.Common.Tools.DotNet
93+
{
94+
[EditorBrowsable(EditorBrowsableState.Never)]
95+
public static class DotNetAliases
96+
{
97+
public static void DotNetTest(
98+
Cake.Core.ICakeContext context,
99+
string fullPath,
100+
Cake.Common.Tools.DotNet.Test.DotNetTestSettings testSettings)
101+
{ }
102+
}
103+
}
104+
105+
namespace Cake.Common.Tools.DotNet.Test
106+
{
107+
[EditorBrowsable(EditorBrowsableState.Never)]
108+
public class DotNetTestSettings
109+
{
110+
public Func<Cake.Core.IO.ProcessArgumentBuilder, Cake.Core.IO.ProcessArgumentBuilder> ArgumentCustomization { get; set; }
111+
}
112+
}
113+
114+
#endif

Build/targets.fs

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4422,7 +4422,52 @@ module Targets =
44224422
Shell.copyFile
44234423
(unpacked + "System.Management.Automation.dll")
44244424
((packageVersionPart "PowerShellStandard.Library")
4425-
+ "System.Management.Automation.dll"))
4425+
+ "System.Management.Automation.dll")
4426+
4427+
[ "AltCover.Base"
4428+
"AltCover.DotNet"
4429+
"AltCover.Engine" // beware static linkage -- maybe copy from debug?
4430+
"AltCover.Monitor"
4431+
"AltCover.PowerShell"
4432+
"AltCover.Toolkit" ]
4433+
|> List.iter (fun n ->
4434+
Shell.copyFile
4435+
(unpacked + n + ".xml")
4436+
("./_Binaries/"
4437+
+ n
4438+
+ "/Release+AnyCPU/netstandard2.0/"
4439+
+ n
4440+
+ ".xml")
4441+
4442+
Actions.RunDotnet
4443+
(dotnetOptions >> dotnetOptionsWithRollForwards)
4444+
"xmldocmd"
4445+
(unpacked
4446+
+ n
4447+
+ ".dll ./_Documentation/"
4448+
+ n
4449+
+ " --visibility public --skip-unbrowsable --clean")
4450+
("documenting " + n))
4451+
4452+
[ "AltCover.Cake" ]
4453+
|> List.iter (fun n ->
4454+
//Shell.copyFile
4455+
// (unpacked + n + ".xml")
4456+
// ("./_Binaries/"
4457+
// + n
4458+
// + "/Release+AnyCPU/netstandard2.0/"
4459+
// + n
4460+
// + ".xml")
4461+
4462+
Actions.RunDotnet
4463+
(dotnetOptions >> dotnetOptionsWithRollForwards)
4464+
"xmldocmd"
4465+
("./_Binaries/" + n + "/Release+AnyCPU/netstandard2.1/"
4466+
+ n
4467+
+ ".dll ./_Documentation/"
4468+
+ n
4469+
+ " --visibility public --skip-unbrowsable --clean")
4470+
("documenting " + n)))
44264471

44274472
let WindowsPowerShell =
44284473
(fun () ->
@@ -7806,54 +7851,6 @@ module Targets =
78067851

78077852
let MakeDocumentation =
78087853
(fun () ->
7809-
let unpacked =
7810-
"./_Packaging.api/Unpack/lib/netstandard2.0/"
7811-
7812-
[ "AltCover.Base"
7813-
"AltCover.DotNet"
7814-
"AltCover.Engine" // beware static linkage -- maybe copy from debug?
7815-
"AltCover.Monitor"
7816-
"AltCover.PowerShell"
7817-
"AltCover.Toolkit" ]
7818-
|> List.iter (fun n ->
7819-
Shell.copyFile
7820-
(unpacked + n + ".xml")
7821-
("./_Binaries/"
7822-
+ n
7823-
+ "/Release+AnyCPU/netstandard2.0/"
7824-
+ n
7825-
+ ".xml")
7826-
7827-
Actions.RunDotnet
7828-
(dotnetOptions >> dotnetOptionsWithRollForwards)
7829-
"xmldocmd"
7830-
(unpacked
7831-
+ n
7832-
+ ".dll ./_Documentation/"
7833-
+ n
7834-
+ " --visibility public --skip-unbrowsable --clean")
7835-
("documenting " + n))
7836-
7837-
[ (*"AltCover.Cake"*) ]
7838-
|> List.iter (fun n ->
7839-
Shell.copyFile
7840-
(unpacked + n + ".xml")
7841-
("./_Binaries/"
7842-
+ n
7843-
+ "/Release+AnyCPU/net8.0/"
7844-
+ n
7845-
+ ".xml")
7846-
7847-
Actions.RunDotnet
7848-
(dotnetOptions >> dotnetOptionsWithRollForwards)
7849-
"xmldocmd"
7850-
(unpacked
7851-
+ n
7852-
+ ".dll ./_Documentation/"
7853-
+ n
7854-
+ " --visibility public --skip-unbrowsable --clean")
7855-
("documenting " + n))
7856-
78577854
let branch = Information.getBranchName (".")
78587855
Assert.That(branch, Is.EqualTo("master").Or.StartWith("develop/docs/"), branch)
78597856

0 commit comments

Comments
 (0)