Skip to content

Commit 1316008

Browse files
committed
Revert "Revert to ecaa7f9 (wrongly pushed old stashed commits)"
This reverts commit 087f92f.
1 parent 087f92f commit 1316008

File tree

6 files changed

+34
-22
lines changed

6 files changed

+34
-22
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"docfx": {
6-
"version": "2.67.5",
6+
"version": "2.75.3",
77
"commands": [
88
"docfx"
99
]

.github/workflows/unity-xref-maps.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: windows-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717

1818
- name: Install DocFX
1919
run: dotnet tool restore
2020

2121
- name: Cache UnityCsReference
22-
uses: actions/cache@v3
22+
uses: actions/cache@v4
2323
with:
2424
path: UnityCsReference
2525
key: unitycsreference
@@ -28,7 +28,7 @@ jobs:
2828
run: dotnet run
2929

3030
- name: Deploy
31-
uses: peaceiris/actions-gh-pages@v3
31+
uses: peaceiris/actions-gh-pages@v4
3232
with:
3333
github_token: ${{ secrets.GITHUB_TOKEN }}
3434
publish_dir: _site

Program.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace DocFxForUnity
1414
///
1515
/// </summary>
1616
/// <remarks>
17-
/// [.NET](https://dotnet.microsoft.com) >= 7.0 and [DocFX](https://dotnet.github.io/docfx/) must be installed
17+
/// [.NET](https://dotnet.microsoft.com) >= 9.0 and [DocFX](https://dotnet.github.io/docfx/) must be installed
1818
/// on your system.
1919
/// </remarks>
2020
partial class Program
@@ -92,25 +92,34 @@ public static void Main()
9292
}
9393

9494
Console.WriteLine($"Fixing hrefs in '{xrefMapPath}'");
95-
Utils.CopyFile(GeneratedXrefMapPath, xrefMapPath);
96-
var xrefMap = XrefMap.Load(xrefMapPath);
97-
xrefMap.FixHrefs(apiUrl: $"https://docs.unity3d.com/{version.name}/Documentation/ScriptReference/");
98-
xrefMap.Save(xrefMapPath);
95+
FixHrefs(xrefMapPath, apiUrl: $"https://docs.unity3d.com/{version.name}/Documentation/ScriptReference/");
9996

10097
// Set the last version's xref map as the default one
10198
if (version == latestVersion)
10299
{
103100
Console.WriteLine($"Fixing hrefs in '{DefaultXrefMapPath}'");
104-
Utils.CopyFile(GeneratedXrefMapPath, DefaultXrefMapPath);
105-
xrefMap = XrefMap.Load(DefaultXrefMapPath);
106-
xrefMap.FixHrefs(UnityApiUrl);
107-
xrefMap.Save(DefaultXrefMapPath);
101+
FixHrefs(DefaultXrefMapPath, UnityApiUrl);
108102
}
109103

110104
Console.WriteLine("\n");
111105
}
112106
}
113107

108+
/// <summary>
109+
/// Copies the generated xref map to <see cref="XrefMapsPath"/> and fixes its hrefs.
110+
/// </summary>
111+
/// <param name="xrefMapPath">Where to copy the xref map.</param>
112+
/// <param name="apiUrl">The URL of the API documentation of this xref map.</param>
113+
/// </summary>
114+
private static void FixHrefs(string xrefMapPath, string apiUrl)
115+
{
116+
Utils.CopyFile(GeneratedXrefMapPath, xrefMapPath);
117+
118+
var xrefMap = XrefMap.Load(xrefMapPath);
119+
xrefMap.FixHrefs(apiUrl);
120+
xrefMap.Save(xrefMapPath);
121+
}
122+
114123
/// <summary>
115124
/// Returns a collection of the latest versions of a specified repository of Unity.
116125
/// </summary>

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ DocFX will set clickable all the references of the Unity API on your documentati
5353

5454
- To run this program:
5555

56-
1. Install Visual Studio 2022.
57-
2. Install [.NET 7.0](https://dotnet.microsoft.com/download/dotnet) SDK.
58-
3. Clone this repository on your computer.
59-
4. Open a terminal on the cloned repository and run:
56+
1. Install [.NET 9.0](https://dotnet.microsoft.com/download/dotnet) SDK.
57+
2. Clone this repository on your computer.
58+
3. Open a terminal on the cloned repository and run:
6059

6160
```sh
6261
dotnet tool restore

UnityXrefMaps.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<DefaultItemExcludes>$(DefaultItemExcludes);UnityCsReference*\**</DefaultItemExcludes>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="LibGit2Sharp" Version="0.26.2" />
11-
<PackageReference Include="YamlDotNet" Version="12.3.1" />
10+
<PackageReference Include="LibGit2Sharp" Version="0.31.0" />
11+
<PackageReference Include="YamlDotNet" Version="16.3.0" />
1212
</ItemGroup>
1313

14-
</Project>
14+
</Project>

docfx.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
],
99
"filter": "filterConfig.yml",
1010
"dest": "UnityCsReference/_api",
11-
"disableGitFeatures": true
11+
"disableGitFeatures": true,
12+
"noRestore": true,
13+
"properties": {
14+
"Configuration": "Debug"
15+
}
1216
}
1317
],
1418
"build":

0 commit comments

Comments
 (0)