Skip to content

Commit

Permalink
improve nupkg content
Browse files Browse the repository at this point in the history
  • Loading branch information
smdn committed Dec 27, 2022
1 parent 670b6ef commit 31dd842
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/Smdn.Text.Ondulish/Smdn.Text.Ondulish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SPDX-License-Identifier: MIT
<!-- <PackageValidationBaselineVersion>3.2.0</PackageValidationBaselineVersion> -->
<Nullable>enable</Nullable>
<AssemblyCLSCompliant>false</AssemblyCLSCompliant>
<GenerateNupkgReadmeFileDependsOnTargets>$(GenerateNupkgReadmeFileDependsOnTargets);GenerateReadmeFileContent</GenerateNupkgReadmeFileDependsOnTargets>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -41,6 +42,14 @@ SPDX-License-Identifier: MIT
</ItemGroup>

<ItemGroup>
<!-- Third party notice -->
<None
Include="$(MSBuildThisFileDirectory)..\..\ThirdPartyNotices.md"
Pack="true"
PackagePath="ThirdPartyNotices.md"
CopyToOutputDirectory="None"
/>

<!-- MeCab bindings source -->
<Compile Include="$(MeCabBindingsDirectory)src\*.cs" />

Expand Down Expand Up @@ -83,6 +92,36 @@ SPDX-License-Identifier: MIT
/>
</ItemGroup>

<Target Name="GenerateReadmeFileContent">
<ItemGroup>
<_SupportedRuntimeIdentifier Include="$(RuntimeIdentifiers)" />
<_SupportedRuntimeIdentifierMarkdownList Include="- `%(_SupportedRuntimeIdentifier.Identity)`" />
</ItemGroup>

<PropertyGroup>
<PackageReadmeFileContent><![CDATA[# $(AssemblyName)-$(InformationalVersion)
$(Description)
## Usage
```cs
$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\examples\hello-ondulish-world\Program.cs'))
```
## MeCab bindings for .NET
This package includes [MeCab](https://github.com/taku910/mecab.git) bindings for .NET and supports the platforms represented by the following [RID](https://learn.microsoft.com/dotnet/core/rid-catalog)s.
@(_SupportedRuntimeIdentifierMarkdownList, '%0A')
For other platforms, a wrapper library for the bindings must be built and deployed separately.
]]></PackageReadmeFileContent>
</PropertyGroup>

<!-- append licence notice to package readme -->
<PropertyGroup>
<ThirdPartyNoticesMarkdownText>$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\ThirdPartyNotices.md'))</ThirdPartyNoticesMarkdownText>
<PackageReadmeFileContentPostamble>$(PackageReadmeFileContentPostamble)$(ThirdPartyNoticesMarkdownText)</PackageReadmeFileContentPostamble>
</PropertyGroup>
</Target>

<ImportGroup>
<Import Project="$(MSBuildThisFileDirectory)MeCab.targets" />
</ImportGroup>
Expand Down

0 comments on commit 31dd842

Please sign in to comment.