Skip to content

Commit 1c42279

Browse files
authored
Merge pull request #1 from dborgards/claude/cyclonedx-nuget-package-01EkX7VTfBKakXEbsnQoSXCb
feat: Implement CycloneDX.MSBuild NuGet package
2 parents e2cce7c + dcb293f commit 1c42279

File tree

16 files changed

+1016
-1
lines changed

16 files changed

+1016
-1
lines changed

.editorconfig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
# XML files (.props, .targets, .csproj, .nuspec)
13+
[*.{props,targets,csproj,nuspec,xml}]
14+
indent_style = space
15+
indent_size = 2
16+
17+
# C# files
18+
[*.cs]
19+
indent_style = space
20+
indent_size = 4
21+
22+
# Markdown files
23+
[*.md]
24+
trim_trailing_whitespace = false
25+
26+
# JSON files
27+
[*.json]
28+
indent_style = space
29+
indent_size = 2
30+
31+
# Shell scripts
32+
[*.sh]
33+
end_of_line = lf
34+
indent_style = space
35+
indent_size = 2

.gitattributes

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Source code
5+
*.cs text diff=csharp
6+
*.csproj text diff=csharp
7+
*.sln text eol=crlf
8+
9+
# MSBuild files
10+
*.props text
11+
*.targets text
12+
*.nuspec text
13+
14+
# Documentation
15+
*.md text
16+
*.txt text
17+
18+
# Scripts
19+
*.sh text eol=lf
20+
*.ps1 text eol=crlf
21+
22+
# JSON files
23+
*.json text
24+
25+
# Binary files
26+
*.dll binary
27+
*.exe binary
28+
*.nupkg binary
29+
*.snk binary

CONTRIBUTING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Contributing to CycloneDX.MSBuild
2+
3+
Thank you for your interest in contributing to CycloneDX.MSBuild! This document provides guidelines and instructions for contributing.
4+
5+
## Code of Conduct
6+
7+
This project adheres to the CycloneDX community standards. By participating, you are expected to uphold professional and respectful communication.
8+
9+
## How to Contribute
10+
11+
### Reporting Issues
12+
13+
- Use the GitHub issue tracker
14+
- Search existing issues before creating a new one
15+
- Provide detailed reproduction steps
16+
- Include environment details (OS, .NET version, MSBuild version)
17+
18+
### Suggesting Features
19+
20+
- Open a GitHub issue with the label "enhancement"
21+
- Clearly describe the use case and benefits
22+
- Consider backward compatibility
23+
24+
### Pull Requests
25+
26+
1. Fork the repository
27+
2. Create a feature branch (`git checkout -b feature/your-feature`)
28+
3. Make your changes following our coding standards
29+
4. Add tests for new functionality
30+
5. Update documentation
31+
6. Commit with clear messages
32+
7. Push to your fork
33+
8. Open a pull request
34+
35+
## Development Guidelines
36+
37+
### Security by Design
38+
39+
All contributions must follow these security principles:
40+
41+
- **No Elevated Permissions**: Code runs in build context only
42+
- **Input Validation**: Validate all MSBuild properties
43+
- **Fail-Safe Defaults**: Default to safe behavior
44+
- **No Arbitrary Code Execution**: Only execute vetted tools
45+
- **Dependency Pinning**: Use explicit versions
46+
47+
### Clean Code Principles
48+
49+
- **Separation of Concerns**: Keep configuration (.props) and logic (.targets) separate
50+
- **Single Responsibility**: Each target does one thing
51+
- **DRY**: Don't repeat yourself
52+
- **Meaningful Names**: Use clear, descriptive names
53+
- **Documentation**: Comment complex logic
54+
55+
### MSBuild Best Practices
56+
57+
- Use conditions to avoid unnecessary execution
58+
- Provide clear messages for errors and warnings
59+
- Use appropriate message importance levels
60+
- Handle multi-targeting scenarios
61+
- Test with various project types
62+
63+
### Code Style
64+
65+
- Follow existing patterns in the codebase
66+
- Use XML formatting for .props and .targets files
67+
- Indent with 2 spaces
68+
- Keep lines under 120 characters
69+
70+
## Testing
71+
72+
### Manual Testing
73+
74+
Test your changes with:
75+
76+
1. Simple single-target projects
77+
2. Multi-targeting projects
78+
3. Projects with disabled SBOM generation
79+
4. Custom configuration scenarios
80+
81+
### Test Projects
82+
83+
Use the integration test projects:
84+
85+
```bash
86+
# Build test projects
87+
dotnet build tests/Integration.Tests/SimpleProject/SimpleProject.csproj
88+
dotnet build tests/Integration.Tests/MultiTargetProject/MultiTargetProject.csproj
89+
dotnet build tests/Integration.Tests/DisabledProject/DisabledProject.csproj
90+
91+
# Verify SBOM generation
92+
ls tests/Integration.Tests/SimpleProject/bin/Debug/net8.0/bom.json
93+
```
94+
95+
## Documentation
96+
97+
Update documentation when:
98+
99+
- Adding new features
100+
- Changing configuration options
101+
- Modifying behavior
102+
- Adding examples
103+
104+
Documentation locations:
105+
- `README.md` - User-facing documentation
106+
- XML comments in `.props` and `.targets` - Property descriptions
107+
- `CONTRIBUTING.md` - Development guidelines
108+
109+
## Release Process
110+
111+
1. Update version in `CycloneDX.MSBuild.csproj`
112+
2. Update `CHANGELOG.md` (if present)
113+
3. Update `README.md` version references
114+
4. Create a pull request
115+
5. After merge, maintainers will create a release tag
116+
117+
## Questions?
118+
119+
- Open a GitHub discussion
120+
- Check existing documentation
121+
- Review similar issues
122+
123+
## License
124+
125+
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.

CycloneDX.MSBuild.sln

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31903.59
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CycloneDX.MSBuild", "src\CycloneDX.MSBuild\CycloneDX.MSBuild.csproj", "{C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleProject", "tests\Integration.Tests\SimpleProject\SimpleProject.csproj", "{D4E5F6A7-B8C9-4D5E-1F2A-3B4C5D6E7F8A}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiTargetProject", "tests\Integration.Tests\MultiTargetProject\MultiTargetProject.csproj", "{E5F6A7B8-C9D0-4E5F-2A3B-4C5D6E7F8A9B}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DisabledProject", "tests\Integration.Tests\DisabledProject\DisabledProject.csproj", "{F6A7B8C9-D0E1-4F5A-3B4C-5D6E7F8A9B0C}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Release|Any CPU = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{D4E5F6A7-B8C9-4D5E-1F2A-3B4C5D6E7F8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{D4E5F6A7-B8C9-4D5E-1F2A-3B4C5D6E7F8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{D4E5F6A7-B8C9-4D5E-1F2A-3B4C5D6E7F8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{D4E5F6A7-B8C9-4D5E-1F2A-3B4C5D6E7F8A}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{E5F6A7B8-C9D0-4E5F-2A3B-4C5D6E7F8A9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{E5F6A7B8-C9D0-4E5F-2A3B-4C5D6E7F8A9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{E5F6A7B8-C9D0-4E5F-2A3B-4C5D6E7F8A9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{E5F6A7B8-C9D0-4E5F-2A3B-4C5D6E7F8A9B}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{F6A7B8C9-D0E1-4F5A-3B4C-5D6E7F8A9B0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{F6A7B8C9-D0E1-4F5A-3B4C-5D6E7F8A9B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{F6A7B8C9-D0E1-4F5A-3B4C-5D6E7F8A9B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{F6A7B8C9-D0E1-4F5A-3B4C-5D6E7F8A9B0C}.Release|Any CPU.Build.0 = Release|Any CPU
40+
EndGlobalSection
41+
GlobalSection(NestedProjects) = preSolution
42+
{C3D4E5F6-A7B8-4C5D-0E1F-2A3B4C5D6E7F} = {A1B2C3D4-E5F6-4A5B-8C9D-0E1F2A3B4C5D}
43+
{D4E5F6A7-B8C9-4D5E-1F2A-3B4C5D6E7F8A} = {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}
44+
{E5F6A7B8-C9D0-4E5F-2A3B-4C5D6E7F8A9B} = {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}
45+
{F6A7B8C9-D0E1-4F5A-3B4C-5D6E7F8A9B0C} = {B2C3D4E5-F6A7-4B5C-9D0E-1F2A3B4C5D6E}
46+
EndGlobalSection
47+
EndGlobal

0 commit comments

Comments
 (0)