@@ -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>
0 commit comments