Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ description: build the project
runs:
using: "composite"
steps:
- uses: actions/setup-node@v4
- uses: actions/setup-node@v6
with:
node-version: 22

- uses: actions/setup-dotnet@v4
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.x
9.x
8.x

Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,21 @@ jobs:
shell: bash
working-directory: templates

- run: dotnet test -c Release -f net8.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:"Summary;Verbosity=Minimal"
id: test-net80
- run: dotnet test -c Release -f net10.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:"Summary;Verbosity=Minimal"
id: test-net100

- run: dotnet test -c Release -f net9.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:"Summary;Verbosity=Minimal"
if: matrix.os == 'ubuntu-latest'
id: test-net90

- run: dotnet test -c Release -f net8.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:"Summary;Verbosity=Minimal"
if: matrix.os == 'ubuntu-latest'
id: test-net80

- run: npm i -g @percy/cli
if: matrix.os == 'ubuntu-latest'

- run: percy exec -- dotnet test -c Release -f net8.0 --filter Stage=Percy --no-build --collect:"XPlat Code Coverage"
- run: percy exec -- dotnet test -c Release -f net10.0 --filter Stage=Percy --no-build --collect:"XPlat Code Coverage"
if: matrix.os == 'ubuntu-latest'
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
Expand All @@ -55,8 +59,8 @@ jobs:
- run: echo "DOTNET_DbgEnableMiniDump=1" >> $GITHUB_ENV
if: matrix.os == 'ubuntu-latest'

- run: dotnet run -c Release --no-build -f net8.0 --project src/docfx -- docs/docfx.json
- run: dotnet run -c Release --no-build -f net8.0 --project src/docfx -- samples/seed/docfx.json --output docs/_site/seed
- run: dotnet run -c Release --no-build -f net10.0 --project src/docfx -- docs/docfx.json
- run: dotnet run -c Release --no-build -f net10.0 --project src/docfx -- samples/seed/docfx.json --output docs/_site/seed

- uses: actions/upload-pages-artifact@v4
if: matrix.os == 'ubuntu-latest'
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
9.x
dotnet-version: 10.x

- name: Run `dotnet format` command
run: |
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
permissions:
packages: write
steps:
- uses: actions/setup-dotnet@v5
with:
dotnet-version: |
10.x

- uses: actions/checkout@v5
with:
Expand All @@ -34,6 +30,9 @@ jobs:
- name: dotnet test
run: dotnet test -c Release -f net8.0 --no-build

- name: dotnet test
run: dotnet test -c Release -f net9.0 --no-build

- name: dotnet test
run: dotnet test -c Release -f net10.0 --no-build

Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:

- name: dotnet publish
run: |
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r win-x64 -o drop/publish/win-x64
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r linux-x64 -o drop/publish/linux-x64
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r osx-x64 -o drop/publish/osx-x64
dotnet publish src/docfx -f net10.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r win-x64 -o drop/publish/win-x64
dotnet publish src/docfx -f net10.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r linux-x64 -o drop/publish/linux-x64
dotnet publish src/docfx -f net10.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r osx-x64 -o drop/publish/osx-x64
mkdir -p drop/bin

- run: zip -r ../../bin/docfx-win-x64-${GITHUB_REF_NAME}.zip .
Expand Down Expand Up @@ -47,13 +47,14 @@ jobs:
steps:
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
dotnet-version: 10.x

- uses: actions/download-artifact@v5
with:
name: nuget
path: drop/nuget

# Install `Sign CLI` to use Azure Key Vault (See: https://github.com/dotnet/sign/blob/main/docs/comparisons.md)
- run: dotnet tool install --tool-path . --prerelease sign

- uses: azure/login@v1
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
steps:
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
dotnet-version: 10.x

- uses: actions/download-artifact@v5
with:
Expand Down Expand Up @@ -116,5 +117,3 @@ jobs:
gh release upload --repo dotnet/docfx ${GITHUB_REF_NAME} drop/bin/docfx-osx-x64-${GITHUB_REF_NAME}.zip
env:
GH_TOKEN: ${{ github.token }}


2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: ./.github/actions/build

# Update snapshots & accept changes
- run: dotnet test -c Release -f net8.0 --no-build --filter Stage=Snapshot
- run: dotnet test -c Release -f net10.0 --no-build --filter Stage=Snapshot
working-directory: test/docfx.Snapshot.Tests
env:
BUILD_SERVER: false # Need to accept file changes automatically.
Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition="'$(DOCFX_PREVIEW_BUILD)' == 'true'">net8.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<!--<TargetFrameworks Condition="'$(DOCFX_PREVIEW_BUILD)' == 'true'">net8.0;net9.0;net10.0</TargetFrameworks>-->
<LangVersion>Preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
Expand All @@ -17,7 +17,7 @@
<!--
Suppress warnings similar to the following:
warning NU1507: There are 2 package sources defined in your configuration.
warning NU5104: A stable release of a package should not have a prerelease dependency. Either modify the version spec of dependency "PdfPig [0.1.9-alpha-20240510-d86c2, )" or update the version field in the nuspec.
warning NU5104: A stable release of a package should not have a prerelease dependency.
warning NU5111: The script file 'tools\.playwright\package\bin\install_media_pack.ps1' is not recognized by NuGet and hence will not be executed during installation of this package.
-->
<NoWarn>$(NoWarn);NU1507;NU5104;NU5111</NoWarn>
Expand Down
27 changes: 10 additions & 17 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,20 @@
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
</ItemGroup>

<!-- TODO: Remove `Microsoft.Build` settings after `Microsoft.CodeAnalysis.Workspaces.MSBuild` dependency is updated to `5.0.0` -->
<!-- .slnx solution format is supported Microsoft.Build 17.13.9 or later. -->
<ItemGroup>
<PackageVersion Include="Microsoft.Build" Version="[17.11.48]" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageVersion Include="Microsoft.Build" Version="17.14.28" Condition="'$(TargetFramework)' != 'net8.0'" />
<PackageVersion Include="Microsoft.Build" Version="[17.14.28]" Condition="'$(TargetFramework)' == 'net9.0'" />
<PackageVersion Include="Microsoft.Build" Version="18.0.2" Condition="'$(TargetFramework)' != 'net8.0' AND '$(TargetFramework)' != 'net9.0'" />
</ItemGroup>

<!-- Temporary settings to suppress NU1901 warning. -->
<ItemGroup>
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="[17.11.48]" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.14.28" Condition="'$(TargetFramework)' != 'net8.0'" />
</ItemGroup>

<ItemGroup>
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion samples/csharp/src/CSharp.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>net10.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
2 changes: 1 addition & 1 deletion samples/extensions/build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/seed/dotnet/assembly/BuildFromAssembly.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion samples/seed/dotnet/solution/CatLibrary/CatLibrary.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions src/Docfx.Dotnet/Docfx.Dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
<!-- Temporary settings to suppress NU1901 warning. -->
<!-- TODO: Remove this setting after `Microsoft.CodeAnalysis.Workspaces.MSBuild` dependency is updated. -->
<PackageReference Include="Microsoft.Build.Tasks.Core" />
</ItemGroup>

</Project>
6 changes: 5 additions & 1 deletion src/Docfx.Dotnet/DotnetApiCatalog.Compile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ partial class DotnetApiCatalog
var msbuildProperties = config.MSBuildProperties ?? [];
msbuildProperties.TryAdd("Configuration", "Release");

// TODO: Add BinaryLogger support and print log warnings/errors to console. (It requires Roslyn v5.0.0)
// NOTE:
// logger parameter is not works when using Roslyn 4.9.0 or later.
// It'll be fixed in later releases.
Expand All @@ -39,7 +40,10 @@ partial class DotnetApiCatalog
});

using var workspace = MSBuildWorkspace.Create(msbuildProperties);
workspace.WorkspaceFailed += (sender, e) => Logger.LogWarning($"{e.Diagnostic}");
workspace.RegisterWorkspaceFailedHandler(e =>
{
Logger.LogWarning($"{e.Diagnostic}");
});

if (files.TryGetValue(FileType.NotSupported, out var unsupportedFiles))
{
Expand Down
4 changes: 4 additions & 0 deletions src/Docfx.Dotnet/SymbolFormatter.Symbols.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,10 @@ public class MethodSymbol : IMethodSymbol

public bool HasUnsupportedMetadata => Inner.HasUnsupportedMetadata;

public bool IsIterator => Inner.IsIterator;

public IMethodSymbol AssociatedExtensionImplementation => Inner.AssociatedExtensionImplementation;

ISymbol ISymbol.OriginalDefinition => ((ISymbol)Inner).OriginalDefinition;

public void Accept(SymbolVisitor visitor) => Inner.Accept(visitor);
Expand Down
2 changes: 1 addition & 1 deletion src/Docfx.Dotnet/SymbolFormatter.Syntax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ private void AddTypedConstant(TypedConstant typedConstant)
var value = Language is SyntaxLanguage.VB
? VB.SymbolDisplay.FormatPrimitive(typedConstant.Value, quoteStrings: true, useHexadecimalNumbers: false)
: CS.SymbolDisplay.FormatPrimitive(typedConstant.Value, quoteStrings: true, useHexadecimalNumbers: false);
_parts.Add(new(typedConstant.Value is string ? SymbolDisplayPartKind.StringLiteral : SymbolDisplayPartKind.NumericLiteral, null, value));
_parts.Add(new(typedConstant.Value is string ? SymbolDisplayPartKind.StringLiteral : SymbolDisplayPartKind.NumericLiteral, null, value!));
break;

case TypedConstantKind.Enum:
Expand Down
2 changes: 1 addition & 1 deletion test/docfx.Snapshot.Tests/SamplesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SamplesFactAttribute()
{
// When target framework is changed.
// It need to modify TargetFrameworks property of `docfx.Snapshot.Tests.csproj`
#if !NET8_0
#if !NET10_0
Skip = "Skip by target framework";
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion test/docfx.Snapshot.Tests/docfx.Snapshot.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net10.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down