-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed additional reference links plug-in so that it works with the updated inherited docs build step. Fixes #1092.
- Loading branch information
1 parent
32c2f44
commit 182c20d
Showing
13 changed files
with
48 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ | |
// System : Sandcastle Help File Builder Plug-Ins | ||
// File : AdditionalReferenceLinksPlugIn.cs | ||
// Author : Eric Woodruff ([email protected]) | ||
// Updated : 02/25/2022 | ||
// Note : Copyright 2008-2022, Eric Woodruff, All rights reserved | ||
// Updated : 12/20/2024 | ||
// Note : Copyright 2008-2024, Eric Woodruff, All rights reserved | ||
// | ||
// This file contains a plug-in designed to add additional reference link targets to the Reflection Index Data | ||
// and Resolve Reference Links build components so that links can be created to other third party help in a | ||
|
@@ -166,7 +166,14 @@ public void Execute(ExecutionContext context) | |
|
||
if(context.BuildStep == BuildStep.GenerateInheritedDocumentation) | ||
{ | ||
this.MergeInheritedDocConfig(); | ||
builder.ReportProgress("Adding references to generate inherited documentation tool..."); | ||
|
||
foreach(ReferenceLinkSettings vs in otherLinks) | ||
{ | ||
if(!String.IsNullOrEmpty(vs.ReflectionFilename)) | ||
builder.GenerateInheritedDocsTool.ReflectionFiles.AddReflectionFile(vs.ReflectionFilename); | ||
} | ||
|
||
return; | ||
} | ||
|
||
|
@@ -181,9 +188,13 @@ public void Execute(ExecutionContext context) | |
f => Path.GetFileNameWithoutExtension(f))); | ||
|
||
foreach(ReferenceLinkSettings vs in otherLinks) | ||
{ | ||
if(!String.IsNullOrEmpty(vs.ReflectionFilename)) | ||
{ | ||
foreach(var n in BuildProcess.GetReferencedNamespaces(vs.ReflectionFilename, validNamespaces)) | ||
rn.Add(n); | ||
} | ||
} | ||
|
||
return; | ||
} | ||
|
@@ -193,25 +204,6 @@ public void Execute(ExecutionContext context) | |
this.MergeReflectionInfo(); | ||
} | ||
|
||
/// <summary> | ||
/// This is used to merge the reflection file names into the inherited documentation tool's configuration | ||
/// file. | ||
/// </summary> | ||
private void MergeInheritedDocConfig() | ||
{ | ||
string configFilename = Path.Combine(builder.WorkingFolder, "GenerateInheritedDocs.config"); | ||
|
||
builder.ReportProgress("Adding references to {0}...", configFilename); | ||
|
||
var configFile = XDocument.Load(configFilename); | ||
|
||
foreach(ReferenceLinkSettings vs in otherLinks) | ||
if(!String.IsNullOrEmpty(vs.ReflectionFilename)) | ||
configFile.Root.Add(new XElement("reflectionInfo", new XAttribute("file", vs.ReflectionFilename))); | ||
|
||
configFile.Save(configFilename); | ||
} | ||
|
||
/// <summary> | ||
/// This is used to merge the reflection file info into the named configuration file. | ||
/// </summary> | ||
|
@@ -228,24 +220,16 @@ private void MergeReflectionInfo() | |
// type but we only need the first one. This only appears in the reference build's configuration | ||
// file. | ||
var component = configFile.XPathSelectElement("//component[@id='Copy From Index Component']/" + | ||
"index[@name='reflection']"); | ||
|
||
// If not found, try for the cached version | ||
if(component == null) | ||
{ | ||
component = configFile.XPathSelectElement("//component[starts-with(@id, " + | ||
"'Reflection Index Data')]/index[@name='reflection']"); | ||
} | ||
|
||
if(component == null) | ||
{ | ||
"index[@name='reflection']") ?? | ||
configFile.XPathSelectElement("//component[starts-with(@id, " + | ||
"'Reflection Index Data')]/index[@name='reflection']") ?? | ||
throw new BuilderException("ARL0004", "Unable to locate Reflection Index Data component in " + | ||
builder.BuildAssemblerConfigurationFile); | ||
} | ||
|
||
var lastChild = component.Descendants().Last(); | ||
|
||
foreach(ReferenceLinkSettings vs in otherLinks) | ||
{ | ||
if(!String.IsNullOrEmpty(vs.ReflectionFilename)) | ||
{ | ||
target = new XElement("data", | ||
|
@@ -255,6 +239,7 @@ private void MergeReflectionInfo() | |
// Keep the current project's stuff listed last so that it takes precedence | ||
lastChild.AddBeforeSelf(target); | ||
} | ||
} | ||
|
||
// Add them to the Resolve Reference Links component | ||
var matchingComponents = configFile.XPathSelectElements("//component[starts-with(@id, 'Resolve Reference Links')]").ToList(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// System : Sandcastle Help File Builder | ||
// File : GenerateInheritedDocs.cs | ||
// Author : Eric Woodruff ([email protected]) | ||
// Updated : 09/13/2024 | ||
// Updated : 12/20/2024 | ||
// Note : Copyright 2008-2024, Eric Woodruff, All rights reserved | ||
// | ||
// This file contains the build task that scans XML comments files for <inheritdoc /> tags and produces a new | ||
|
@@ -74,6 +74,11 @@ public class GenerateInheritedDocs | |
/// This read-only property returns the comments cache | ||
/// </summary> | ||
public IndexedCommentsCache CommentsCache => commentsCache; | ||
|
||
/// <summary> | ||
/// This read-only property returns the reflection file information | ||
/// </summary> | ||
public ReflectionFiles ReflectionFiles => reflectionFiles; | ||
|
||
#endregion | ||
|
||
|
@@ -200,14 +205,15 @@ public bool Execute() | |
private void ScanCommentsFiles() | ||
{ | ||
XPathNavigator apiId, apiField, fieldComments, attachedComments; | ||
XmlNode node; | ||
XmlDocumentFragment node; | ||
Dictionary<string, XPathNavigator> members = new Dictionary<string, XPathNavigator>(); | ||
string name; | ||
|
||
// Get a list of all unique members containing an <inheritdoc /> tag. This will include entries with | ||
// occurrences at the root level as well as those nested within other tags. Root level stuff will | ||
// get handled first followed by any nested tags. | ||
foreach(XPathNavigator file in commentsFiles) | ||
{ | ||
foreach(XPathNavigator tag in file.Select("//inheritdoc")) | ||
{ | ||
while(tag.Name != "member") | ||
|
@@ -222,6 +228,7 @@ private void ScanCommentsFiles() | |
if(apiId != null && !members.ContainsKey(name)) | ||
members.Add(name, tag); | ||
} | ||
} | ||
|
||
// For each one, create a new XML node that can be edited | ||
foreach(XPathNavigator nav in members.Values) | ||
|
@@ -608,7 +615,7 @@ private void InheritNestedDocumentation(XmlNode member) | |
{ | ||
StringBuilder sb = new StringBuilder(256); | ||
XPathNavigator baseMember; | ||
XmlNode copyMember, newNode; | ||
XmlNode copyMember; | ||
XmlAttribute cref, filter, autoFilter; | ||
string name; | ||
|
||
|
@@ -686,7 +693,7 @@ private void InheritNestedDocumentation(XmlNode member) | |
{ | ||
foreach(XPathNavigator element in baseMember.Select(sb.ToString())) | ||
{ | ||
newNode = inheritedDocs.CreateDocumentFragment(); | ||
var newNode = inheritedDocs.CreateDocumentFragment(); | ||
|
||
// If there's no filter, we don't want the tag | ||
if(filter != null) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// System : Sandcastle Help File Builder | ||
// File : AssemblyInfoShared.cs | ||
// Author : Eric Woodruff ([email protected]) | ||
// Updated : 12/15/2024 | ||
// Updated : 12/21/2024 | ||
// Note : Copyright 2006-2024, Eric Woodruff, All rights reserved | ||
// | ||
// Sandcastle Help File Builder common assembly attributes. | ||
|
@@ -90,13 +90,13 @@ internal static partial class AssemblyInfo | |
// | ||
// This is used to set the assembly file version. This will change with each new release. MSIs only | ||
// support a Major value between 0 and 255 so we drop the century from the year on this one. | ||
public const string FileVersion = "24.12.15.0"; | ||
public const string FileVersion = "24.12.21.0"; | ||
|
||
// Common product version | ||
// | ||
// This may contain additional text to indicate Alpha or Beta states. The version number will always match | ||
// the file version above but includes the century on the year. | ||
public const string ProductVersion = "2024.12.15.0"; | ||
public const string ProductVersion = "2024.12.21.0"; | ||
|
||
// Assembly copyright information | ||
public const string Copyright = "Copyright \xA9 2006-2024, Eric Woodruff, All Rights Reserved"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters