File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
src/Smdn.Reflection.ReverseGenerating.ListApi
Smdn.Reflection.ReverseGenerating.ListApi Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ SPDX-License-Identifier: MIT
1414 <RootNamespace /> <!-- empty the root namespace so that the namespace is determined only by the directory name, for code style rule IDE0030 -->
1515 <Nullable >enable</Nullable >
1616 <NoWarn >CS1591;$(NoWarn)</NoWarn > <!-- CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' -->
17+ <NoWarn >CS2002;$(NoWarn)</NoWarn > <!-- see target 'WriteConstantsFile' -->
1718 <EnableFeature_BuildProjectFile Condition =" '$(Configuration)' != 'Release' " >true</EnableFeature_BuildProjectFile >
1819 <APIListEnableGenerating >false</APIListEnableGenerating >
1920 <GeneratePackageReadmeFile >false</GeneratePackageReadmeFile >
@@ -55,4 +56,27 @@ SPDX-License-Identifier: MIT
5556 <PackageReference Include =" NuGet.ProjectModel" Version =" 5.11.0" />
5657 <PackageReference Include =" Smdn.Fundamental.Shell" Version =" 3.0.0" />
5758 </ItemGroup >
59+
60+ <Target Name =" WriteConstantsFile" BeforeTargets =" BeforeBuild" >
61+ <ItemGroup >
62+ <SourceLines Include =" internal static class Constants {" />
63+ <SourceLines Include =" public const string ToolCommandName = " $(ToolCommandName)" $([MSBuild]::Escape(';'))" />
64+ <SourceLines Include =" }" />
65+ </ItemGroup >
66+
67+ <PropertyGroup >
68+ <ConstantsFilePath >$(IntermediateOutputPath)Constants.g.cs</ConstantsFilePath >
69+ </PropertyGroup >
70+
71+ <WriteLinesToFile
72+ File =" $(ConstantsFilePath)"
73+ Overwrite =" true"
74+ Lines =" @(SourceLines)"
75+ />
76+
77+ <ItemGroup >
78+ <!-- XXX: This causes compiler warning CS2002. -->
79+ <Compile Include =" $(ConstantsFilePath)" />
80+ </ItemGroup >
81+ </Target >
5882</Project >
Original file line number Diff line number Diff line change 1212namespace Smdn . Reflection . ReverseGenerating . ListApi ;
1313
1414internal sealed class Program {
15- internal static string LoggerCategoryName => typeof ( Program ) . Assembly . GetName ( ) . Name ! ;
15+ internal static string LoggerCategoryName => Constants . ToolCommandName ;
1616
1717 private static int Main ( string [ ] args )
1818 {
You can’t perform that action at this time.
0 commit comments