Skip to content

Commit 53b136f

Browse files
CopilotMalcolmnixon
andcommitted
Restructure package layout and convert to markdown reference links
- Move native executables to package root to avoid duplication - Update DotnetToolWrapper.json paths to use ../../../ relative paths - Convert all markdown files to use reference link format - Update folder structure examples in docs/usage.md and README.md Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 847a9ba commit 53b136f

File tree

6 files changed

+75
-56
lines changed

6 files changed

+75
-56
lines changed

AGENTS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This repository contains configuration and instructions for GitHub Copilot agent
55
## Repository Overview
66

77
**DotnetToolWrapper** is a .NET 8.0, 9.0, and 10.0 console application that serves as a wrapper for native
8-
applications packaged as [.NET Tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools).
8+
applications packaged as [.NET Tools][link1].
99

1010
## Project Structure
1111

@@ -130,3 +130,5 @@ Before committing:
130130
## Contact
131131

132132
For questions or issues, please refer to the repository's issue tracker on GitHub.
133+
134+
[link1]: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools

ARCHITECTURE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This document describes the architecture and design of the DotnetToolWrapper pro
55
## Overview
66

77
DotnetToolWrapper is a .NET console application that serves as a universal launcher for native applications packaged
8-
as [.NET Tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools). It enables developers to distribute
8+
as [.NET Tools][link1]. It enables developers to distribute
99
platform-specific native executables through the .NET tool ecosystem.
1010

1111
## Problem Statement
@@ -171,3 +171,5 @@ The project uses GitHub Actions for CI/CD:
171171
- [README.md](README.md) - Usage instructions and examples
172172
- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution guidelines
173173
- [SECURITY.md](SECURITY.md) - Security policy
174+
175+
[link1]: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools

CONTRIBUTING.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ We actively welcome pull requests! To submit a pull request:
5151

5252
### Prerequisites
5353

54-
- [.NET SDK 8.0 or higher](https://dotnet.microsoft.com/download)
54+
- [.NET SDK 8.0 or higher][link1]
5555
- Git
5656
- A code editor (Visual Studio, Visual Studio Code, Rider, etc.)
5757

@@ -232,9 +232,15 @@ See [LICENSE](LICENSE) for details.
232232

233233
## Additional Resources
234234

235-
- [.NET Tool Documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools)
236-
- [NuGet Package Documentation](https://learn.microsoft.com/en-us/nuget/)
237-
- [GitHub Flow](https://guides.github.com/introduction/flow/)
238-
- [Writing Good Commit Messages](https://chris.beams.io/posts/git-commit/)
235+
- [.NET Tool Documentation][link2]
236+
- [NuGet Package Documentation][link3]
237+
- [GitHub Flow][link4]
238+
- [Writing Good Commit Messages][link5]
239239

240240
Thank you for contributing to DotnetToolWrapper! 🎉
241+
242+
[link1]: https://dotnet.microsoft.com/download
243+
[link2]: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools
244+
[link3]: https://learn.microsoft.com/en-us/nuget/
245+
[link4]: https://guides.github.com/introduction/flow/
246+
[link5]: https://chris.beams.io/posts/git-commit/

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![GitHub](https://img.shields.io/github/license/demaconsulting/DotnetToolWrapper?style=plastic)
77

88
A .NET console application that enables native executables to be distributed as
9-
[.NET Tools](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools).
9+
[.NET Tools][link1].
1010

1111
## Overview
1212

@@ -34,7 +34,7 @@ dotnet tool install -g YourTool.Package
3434
your-tool --help
3535
```
3636

37-
Create your own wrapped tool by following the [Usage](#usage) section below.
37+
Create your own wrapped tool by following the [Usage][link2] section below.
3838

3939
## Usage
4040

@@ -54,6 +54,9 @@ Here's a minimal folder structure:
5454
```text
5555
root
5656
|- tool.nuspec
57+
|- win-x64/my-tool.exe
58+
|- linux-x64/my-tool
59+
|- osx-arm64/my-tool
5760
|- tools
5861
|- net8.0/any
5962
|- net9.0/any
@@ -62,9 +65,6 @@ root
6265
|- DotnetToolWrapper.json
6366
|- DemaConsulting.DotnetToolWrapper.dll
6467
|- (other wrapper files)
65-
|- win-x64/my-tool.exe
66-
|- linux-x64/my-tool
67-
|- osx-arm64/my-tool
6868
```
6969

7070
Package and install:
@@ -135,7 +135,7 @@ dotnet build --configuration Release
135135

136136
For real-world examples of tools using DotnetToolWrapper, see:
137137

138-
- Check the [GitHub topic](https://github.com/topics/dotnettoolwrapper) for projects using this wrapper
138+
- Check the [GitHub topic][link3] for projects using this wrapper
139139

140140
## Contributing
141141

@@ -153,6 +153,12 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
153153

154154
## Support
155155

156-
- **Issues**: Report bugs or request features via [GitHub Issues](https://github.com/demaconsulting/DotnetToolWrapper/issues)
157-
- **Discussions**: Ask questions via [GitHub Discussions](https://github.com/demaconsulting/DotnetToolWrapper/discussions)
156+
- **Issues**: Report bugs or request features via [GitHub Issues][link4]
157+
- **Discussions**: Ask questions via [GitHub Discussions][link5]
158158
- **Security**: Report vulnerabilities per [SECURITY.md](SECURITY.md)
159+
160+
[link1]: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools
161+
[link2]: #usage
162+
[link3]: https://github.com/topics/dotnettoolwrapper
163+
[link4]: https://github.com/demaconsulting/DotnetToolWrapper/issues
164+
[link5]: https://github.com/demaconsulting/DotnetToolWrapper/discussions

SECURITY.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ report it to us as described below.
2222

2323
Instead, please report them via GitHub's private vulnerability reporting feature:
2424

25-
1. Navigate to the [Security tab](https://github.com/demaconsulting/DotnetToolWrapper/security) of the repository
25+
1. Navigate to the [Security tab][link1] of the repository
2626
2. Click "Report a vulnerability"
2727
3. Fill out the vulnerability report form with as much detail as possible
2828

@@ -175,9 +175,9 @@ For security-related questions that are not vulnerability reports:
175175

176176
This security policy is based on security best practices from:
177177

178-
- [Microsoft Security Development Lifecycle](https://www.microsoft.com/en-us/securityengineering/sdl/)
179-
- [OWASP Secure Coding Practices](https://owasp.org/www-project-secure-coding-practices-quick-reference-guide/)
180-
- [GitHub Security Advisories](https://docs.github.com/en/code-security/security-advisories)
178+
- [Microsoft Security Development Lifecycle][link2]
179+
- [OWASP Secure Coding Practices][link3]
180+
- [GitHub Security Advisories][link4]
181181

182182
## Updates to This Policy
183183

@@ -188,3 +188,8 @@ We may update this security policy from time to time. We will notify users of ma
188188
- Creating a GitHub discussion for significant changes
189189

190190
Last updated: December 2024
191+
192+
[link1]: https://github.com/demaconsulting/DotnetToolWrapper/security
193+
[link2]: https://www.microsoft.com/en-us/securityengineering/sdl/
194+
[link3]: https://owasp.org/www-project-secure-coding-practices-quick-reference-guide/
195+
[link4]: https://docs.github.com/en/code-security/security-advisories

docs/usage.md

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ target .NET frameworks (net8.0, net9.0, and net10.0) to ensure compatibility:
3333
root
3434
|- tool.nuspec Nuspec file
3535
|- README.md README file
36+
|- win-x64
37+
| |- my-tool.exe Windows x64 executable
38+
|- linux-x64
39+
| |- my-tool Linux x64 executable
40+
|- osx-x64
41+
| |- my-tool macOS x64 executable
3642
|- tools
3743
|- net8.0
3844
| |- any
@@ -41,38 +47,20 @@ root
4147
| |- DemaConsulting.DotnetToolWrapper.deps.json DotnetToolWrapper dependencies
4248
| |- DemaConsulting.DotnetToolWrapper.dll DotnetToolWrapper application
4349
| |- DemaConsulting.DotnetToolWrapper.runtimeconfig.json DotnetToolWrapper runtime
44-
| |- win-x64
45-
| | |- my-tool.exe Windows x64 executable
46-
| |- linux-x64
47-
| | |- my-tool Linux x64 executable
48-
| |- osx-x64
49-
| |- my-tool macOS x64 executable
5050
|- net9.0
5151
| |- any
5252
| |- DotnetToolSettings.xml Dotnet tool settings
5353
| |- DotnetToolWrapper.json DotnetToolWrapper application settings
5454
| |- DemaConsulting.DotnetToolWrapper.deps.json DotnetToolWrapper dependencies
5555
| |- DemaConsulting.DotnetToolWrapper.dll DotnetToolWrapper application
5656
| |- DemaConsulting.DotnetToolWrapper.runtimeconfig.json DotnetToolWrapper runtime
57-
| |- win-x64
58-
| | |- my-tool.exe Windows x64 executable
59-
| |- linux-x64
60-
| | |- my-tool Linux x64 executable
61-
| |- osx-x64
62-
| |- my-tool macOS x64 executable
6357
|- net10.0
6458
|- any
6559
|- DotnetToolSettings.xml Dotnet tool settings
6660
|- DotnetToolWrapper.json DotnetToolWrapper application settings
6761
|- DemaConsulting.DotnetToolWrapper.deps.json DotnetToolWrapper dependencies
6862
|- DemaConsulting.DotnetToolWrapper.dll DotnetToolWrapper application
6963
|- DemaConsulting.DotnetToolWrapper.runtimeconfig.json DotnetToolWrapper runtime
70-
|- win-x64
71-
| |- my-tool.exe Windows x64 executable
72-
|- linux-x64
73-
| |- my-tool Linux x64 executable
74-
|- osx-x64
75-
|- my-tool macOS x64 executable
7664
```
7765

7866
**Note**: While the example above shows net8.0, net9.0, and net10.0 folders, you can choose to include only
@@ -117,7 +105,7 @@ Create a `.nuspec` file that defines your package metadata:
117105
- Include `<packageType name="DotnetTool" />` to mark this as a .NET tool
118106
- Adjust file paths in the `<files>` section to match your structure
119107

120-
Refer to the [.nuspec File Reference](https://learn.microsoft.com/en-us/nuget/reference/nuspec) for more details.
108+
Refer to the [.nuspec File Reference][link1] for more details.
121109

122110
### 2. Create DotnetToolSettings.xml
123111

@@ -145,22 +133,22 @@ Create a `DotnetToolWrapper.json` file in each framework folder that maps platfo
145133
```json
146134
{
147135
"win-x64": {
148-
"program": "win-x64/my-tool.exe"
136+
"program": "../../../win-x64/my-tool.exe"
149137
},
150138
"win-x86": {
151-
"program": "win-x86/my-tool.exe"
139+
"program": "../../../win-x86/my-tool.exe"
152140
},
153141
"linux-x64": {
154-
"program": "linux-x64/my-tool"
142+
"program": "../../../linux-x64/my-tool"
155143
},
156144
"linux-arm64": {
157-
"program": "linux-arm64/my-tool"
145+
"program": "../../../linux-arm64/my-tool"
158146
},
159147
"osx-x64": {
160-
"program": "osx-x64/my-tool"
148+
"program": "../../../osx-x64/my-tool"
161149
},
162150
"osx-arm64": {
163-
"program": "osx-arm64/my-tool"
151+
"program": "../../../osx-arm64/my-tool"
164152
}
165153
}
166154
```
@@ -203,15 +191,15 @@ into your `tools/{framework}/any/` folder:
203191

204192
You can obtain these files by:
205193

206-
1. Downloading from the [releases page](https://github.com/demaconsulting/DotnetToolWrapper/releases)
207-
2. Building from source (see [Building from Source](#building-from-source))
194+
1. Downloading from the [releases page][link2]
195+
2. Building from source (see [Building from Source][link3])
208196

209197
### 5. Add Your Native Executables
210198

211-
Place your native executables in subdirectories matching the platform identifiers. For example:
199+
Place your native executables at the root of the package in subdirectories matching the platform identifiers. For example:
212200

213201
```text
214-
tools/net8.0/any/
202+
root/
215203
├── win-x64/
216204
│ └── my-tool.exe
217205
├── linux-x64/
@@ -298,7 +286,7 @@ If you want to support multiple .NET framework versions:
298286

299287
1. Create separate folders for each framework: `net8.0`, `net9.0`, `net10.0`
300288
2. Copy the appropriate DotnetToolWrapper binaries for each framework
301-
3. Copy your native executables to each framework folder (they can be the same binaries)
289+
3. Place your native executables at the root of the package (they are shared across all frameworks)
302290
4. Update your .nuspec to include all framework folders
303291

304292
Users with different .NET SDK versions will automatically use the appropriate framework version.
@@ -404,20 +392,30 @@ dotnet build --configuration Release
404392

405393
For real-world examples of tools using DotnetToolWrapper:
406394

407-
- Browse repositories on GitHub with the [dotnettoolwrapper topic](https://github.com/topics/dotnettoolwrapper)
395+
- Browse repositories on GitHub with the [dotnettoolwrapper topic][link4]
408396
- Check the examples in the DotnetToolWrapper repository (if available)
409397

410398
## Support
411399

412-
- **Issues**: Report bugs or request features via [GitHub Issues](https://github.com/demaconsulting/DotnetToolWrapper/issues)
413-
- **Discussions**: Ask questions via [GitHub Discussions](https://github.com/demaconsulting/DotnetToolWrapper/discussions)
400+
- **Issues**: Report bugs or request features via [GitHub Issues][link5]
401+
- **Discussions**: Ask questions via [GitHub Discussions][link6]
414402
- **Documentation**: See [README.md](../README.md) for project overview
415403
- **Architecture**: See [ARCHITECTURE.md](../ARCHITECTURE.md) for design details
416404
- **Contributing**: See [CONTRIBUTING.md](../CONTRIBUTING.md) for contribution guidelines
417405

418406
## Additional Resources
419407

420-
- [.NET Tool Documentation](https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools)
421-
- [.nuspec File Reference](https://learn.microsoft.com/en-us/nuget/reference/nuspec)
422-
- [NuGet Package Creation](https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package)
423-
- [NuGet CLI Reference](https://learn.microsoft.com/en-us/nuget/reference/nuget-exe-cli-reference)
408+
- [.NET Tool Documentation][link7]
409+
- [.nuspec File Reference][link1]
410+
- [NuGet Package Creation][link8]
411+
- [NuGet CLI Reference][link9]
412+
413+
[link1]: https://learn.microsoft.com/en-us/nuget/reference/nuspec
414+
[link2]: https://github.com/demaconsulting/DotnetToolWrapper/releases
415+
[link3]: #building-from-source
416+
[link4]: https://github.com/topics/dotnettoolwrapper
417+
[link5]: https://github.com/demaconsulting/DotnetToolWrapper/issues
418+
[link6]: https://github.com/demaconsulting/DotnetToolWrapper/discussions
419+
[link7]: https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools
420+
[link8]: https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package
421+
[link9]: https://learn.microsoft.com/en-us/nuget/reference/nuget-exe-cli-reference

0 commit comments

Comments
 (0)