Skip to content

Commit df8e814

Browse files
authored
Merge pull request #1831 from shimat/nuget_readme
Add README to NuGet packages
2 parents 671ad41 + 7d86e09 commit df8e814

21 files changed

Lines changed: 224 additions & 42 deletions

.github/copilot-instructions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,23 @@ $enc = New-Object System.Text.UTF8Encoding $true
1818
$content = [System.IO.File]::ReadAllText("path\to\file", [System.Text.Encoding]::UTF8)
1919
[System.IO.File]::WriteAllText("path\to\file", $content, $enc)
2020
```
21+
22+
## NuGet README sync
23+
24+
When editing the root `README.md`, also update the NuGet-specific README files accordingly.
25+
26+
| File | Target packages |
27+
|---|---|
28+
| `nuget/README.managed.md` | `OpenCvSharp4`, `OpenCvSharp4.Windows`, `OpenCvSharp4.Windows.Slim`, `OpenCvSharp4.Extensions`, `OpenCvSharp4.WpfExtensions` |
29+
| `nuget/README.runtime.md` | `OpenCvSharp4.runtime.*`, `OpenCvSharp4.official.runtime.*` (all native runtime packages) |
30+
31+
The NuGet READMEs are a subset of the top-level README and consist of the following sections:
32+
33+
- Overview and supported platforms
34+
- Installation instructions (Quick Start)
35+
- Requirements
36+
- Slim profile module coverage table (`README.managed.md` only)
37+
- Code usage examples (`README.managed.md` only)
38+
- Links (GitHub, Samples, API Docs, Issue Tracker)
39+
40+
Do **not** include CI badges, Docker instructions, build instructions, or donation links in the NuGet READMEs.

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ If you want to use OpenCV features that are not included by default in OpenCvSha
215215
- Build OpenCV with opencv_contrib: https://docs.opencv.org/4.x/d7/d9f/tutorial_linux_install.html
216216
- Install .NET Core SDK: https://learn.microsoft.com/ja-jp/dotnet/core/install/linux-ubuntu
217217
- Get OpenCvSharp source files
218-
```
218+
```bash
219219
git clone https://github.com/shimat/opencvsharp.git
220220
cd opencvsharp
221221
git fetch --all --tags --prune && git checkout ${OPENCVSHARP_VERSION}
222222
```
223223

224224
- Build native wrapper `OpenCvSharpExtern`
225-
```
225+
```bash
226226
cd opencvsharp/src
227227
mkdir build
228228
cd build
@@ -231,17 +231,14 @@ make -j
231231
make install
232232
```
233233
You should add a reference to `opencvsharp/src/build/OpenCvSharpExtern/libOpenCvSharpExtern.so`
234-
```
234+
```bash
235235
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/home/shimat/opencvsharp/src/build/OpenCvSharpExtern"
236236
```
237237

238-
- Add `OpenCvSharp4` NuGet package to your project
239-
```
240-
dotnet new console -n ConsoleApp01
241-
cd ConsoleApp01
242-
dotnet add package OpenCvSharp4
243-
# -- edit Program.cs --- #
244-
dotnet run
238+
- Build the managed OpenCvSharp library
239+
```bash
240+
cd opencvsharp
241+
dotnet build src/OpenCvSharp/OpenCvSharp.csproj
245242
```
246243
## Customizing OpenCV and OpenCvSharp for embedded (ARM) Platforms
247244

nuget/OpenCvSharp4.Windows.Slim.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>
1919
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
20+
<PackageReadmeFile>README.managed.md</PackageReadmeFile>
2021
</PropertyGroup>
2122

2223
<ItemGroup>
@@ -33,5 +34,6 @@
3334

3435
<ItemGroup>
3536
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
37+
<None Include="README.managed.md" Pack="true" PackagePath="" />
3638
</ItemGroup>
3739
</Project>

nuget/OpenCvSharp4.Windows.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1919
<RepositoryType>git</RepositoryType>
2020
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
21+
<PackageReadmeFile>README.managed.md</PackageReadmeFile>
2122
</PropertyGroup>
2223

2324
<!-- This is a meta-package that depends on other packages -->
@@ -36,5 +37,6 @@
3637

3738
<ItemGroup>
3839
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
40+
<None Include="README.managed.md" Pack="true" PackagePath="" />
3941
</ItemGroup>
4042
</Project>

nuget/OpenCvSharp4.official.runtime.linux-x64.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1919
<RepositoryType>git</RepositoryType>
2020
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
21+
<PackageReadmeFile>README.runtime.md</PackageReadmeFile>
2122
</PropertyGroup>
2223

2324
<ItemGroup>
2425
<None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/linux-x64/native/" />
2526
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
27+
<None Include="README.runtime.md" Pack="true" PackagePath="" />
2628
</ItemGroup>
2729
</Project>

nuget/OpenCvSharp4.official.runtime.linux-x64.slim.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>
1919
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
20+
<PackageReadmeFile>README.runtime.md</PackageReadmeFile>
2021
</PropertyGroup>
2122

2223
<ItemGroup>
2324
<None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/linux-x64/native/" />
2425
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
26+
<None Include="README.runtime.md" Pack="true" PackagePath="" />
2527
</ItemGroup>
2628
</Project>

nuget/OpenCvSharp4.official.runtime.ubuntu.22.04-x64.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1919
<RepositoryType>git</RepositoryType>
2020
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
21+
<PackageReadmeFile>README.runtime.md</PackageReadmeFile>
2122
</PropertyGroup>
2223

2324
<ItemGroup>
2425
<None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/ubuntu.22.04-x64/native/" />
25-
<None Include="icon\opencvsharp.png" Pack="true" PackagePath="" />
26+
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
27+
<None Include="README.runtime.md" Pack="true" PackagePath="" />
2628
</ItemGroup>
2729
</Project>

nuget/OpenCvSharp4.official.runtime.ubuntu.22.04-x64.slim.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>
1919
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
20+
<PackageReadmeFile>README.runtime.md</PackageReadmeFile>
2021
</PropertyGroup>
2122

2223
<ItemGroup>
2324
<None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/ubuntu.22.04-x64/native/" />
24-
<None Include="icon\opencvsharp.png" Pack="true" PackagePath="" />
25+
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
26+
<None Include="README.runtime.md" Pack="true" PackagePath="" />
2527
</ItemGroup>
2628
</Project>

nuget/OpenCvSharp4.official.runtime.ubuntu.24.04-x64.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1919
<RepositoryType>git</RepositoryType>
2020
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
21+
<PackageReadmeFile>README.runtime.md</PackageReadmeFile>
2122
</PropertyGroup>
2223

2324
<ItemGroup>
2425
<None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/ubuntu.24.04-x64/native/" />
25-
<None Include="icon\opencvsharp.png" Pack="true" PackagePath="" />
26+
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
27+
<None Include="README.runtime.md" Pack="true" PackagePath="" />
2628
</ItemGroup>
2729
</Project>

nuget/OpenCvSharp4.official.runtime.ubuntu.24.04-x64.slim.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
<RepositoryUrl>https://github.com/shimat/opencvsharp.git</RepositoryUrl>
1818
<RepositoryType>git</RepositoryType>
1919
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
20+
<PackageReadmeFile>README.runtime.md</PackageReadmeFile>
2021
</PropertyGroup>
2122

2223
<ItemGroup>
2324
<None Include="libOpenCvSharpExtern.so" Pack="true" PackagePath="runtimes/ubuntu.24.04-x64/native/" />
24-
<None Include="icon\opencvsharp.png" Pack="true" PackagePath="" />
25+
<None Include="icon/opencvsharp.png" Pack="true" PackagePath="" />
26+
<None Include="README.runtime.md" Pack="true" PackagePath="" />
2527
</ItemGroup>
2628
</Project>

0 commit comments

Comments
 (0)