Skip to content

Commit 8db5e92

Browse files
authored
Merge pull request #26 from alsi-lawr/main
feat: added xml docs to generated output if they exist
2 parents 350bf58 + 6e44648 commit 8db5e92

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/IgnoresAccessChecksToGenerator.Tasks/IgnoresAccessChecksToGenerator.Tasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>netstandard2.0;net462</TargetFrameworks>
55
<LangVersion>latest</LangVersion>
66
<PackageId>IgnoresAccessChecksToGenerator</PackageId>
7-
<Version>0.8.0</Version>
7+
<Version>0.9.0</Version>
88
<DevelopmentDependency>true</DevelopmentDependency>
99
<Authors>Eli Arbel</Authors>
1010
<RepositoryUrl>https://github.com/aelij/IgnoresAccessChecksToGenerator</RepositoryUrl>

src/IgnoresAccessChecksToGenerator.Tasks/PublicizeInternals.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ private void CreatePublicAssembly(string source, string target, HashSet<string>
146146
}
147147

148148
assembly.Write(target);
149+
// copy XML docs alongside the new assembly
150+
var xmlSource = Path.ChangeExtension(source, ".xml");
151+
if (File.Exists(xmlSource))
152+
{
153+
var xmlTarget = Path.ChangeExtension(target, ".xml");
154+
File.Copy(xmlSource, xmlTarget, overwrite: true);
155+
Log.LogMessageFromText($"Copied XML docs to {xmlTarget}", MessageImportance.Low);
156+
}
149157
}
150158

151159
private string GetFullFilePath(string basePath, string path) =>
@@ -212,4 +220,4 @@ private AssemblyDefinition GetAssembly(string file, ReaderParameters parameters)
212220
}
213221
}
214222
}
215-
}
223+
}

test/IgnoresAccessChecksToGenerator.Test/IgnoresAccessChecksToGenerator.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.7.1" PrivateAssets="all" />
15+
<PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.9.0" PrivateAssets="all" />
1616
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
1717
</ItemGroup>
1818

19-
</Project>
19+
</Project>

0 commit comments

Comments
 (0)