Skip to content

feat: add source generator project and tooling enhancements#6

Merged
j-d-ha merged 11 commits into
mainfrom
feature/update-to-be-source-generated
Dec 20, 2025
Merged

feat: add source generator project and tooling enhancements#6
j-d-ha merged 11 commits into
mainfrom
feature/update-to-be-source-generated

Conversation

@j-d-ha

@j-d-ha j-d-ha commented Dec 20, 2025

Copy link
Copy Markdown
Collaborator

🚀 Pull Request

📋 Summary

This PR introduces the LayeredCraft.SourceGeneratorTools.Generator project along with various development tooling and project configuration improvements. The generator enables compile-time code generation for utility types like EquatableArray, reducing the need for runtime dependencies.

Key changes include:

  • New Source Generator Project: Adds the LayeredCraft.SourceGeneratorTools.Generator project that embeds source files and generates them at compile time based on user configuration
  • Example Project: Provides a basic example demonstrating source generator usage
  • Development Tooling: Configures dotnet tools (CSharpier, JetBrains ReSharper), EditorConfig, and Rider settings for consistent code formatting
  • Enhanced NuGet Packaging: Adds package icon support and updates metadata/tags for better discoverability
  • Code Refactoring: Reorganizes HashCode and EquatableArray into logical folder structures
  • Dependency Updates: Adds necessary packages for Roslyn source generation (Microsoft.CodeAnalysis.CSharp, PolySharper)

✅ Checklist

  • My changes build cleanly
  • I've added/updated relevant tests
  • I've added/updated documentation or README
  • I've followed the coding style for this project
  • I've tested the changes locally (if applicable)

🧪 Related Issues or PRs

This is foundational work to enable source generator functionality for the library.

💬 Notes for Reviewers

  • The generator project uses embedded resources to include source files from the main library project
  • GeneratorConstants.cs defines available features (currently EquatableArray) that can be generated
  • The example project demonstrates the analyzer/generator pattern by referencing the generator without output assembly
  • .DS_Store files appear in git status but are properly excluded via .gitignore updates
  • Rider settings file is quite large but provides team-wide IDE configuration consistency

- Document how to open a PR for the current branch using a pre-defined template.
- Include placeholder for command arguments.
- Introduce taskfile.yaml for task automation support.
- Provides a foundation for managing developer workflows.
- Add new project to solution: LayeredCraft.SourceGeneratorTools.Generator.
- Update .gitignore to include .env files.
- Add new package versions: Microsoft.CodeAnalysis.CSharp and Microsoft.CodeAnalysis.Analyzers.
- Add .editorconfig for consistent code formatting across editors.
- Add .config/dotnet-tools.json for managing .NET CLI tools.
- Add global.json for specifying .NET SDK version and roll-forward policy.
- Add LayeredCraft.SourceGeneratorTools.sln.DotSettings for custom code cleanup profiles.
- Include configuration for formatting, reordering, and optimizing imports for various languages.
- Ensure consistent code style across IDEs with shared settings.
- Introduce new .NET Standard 2.0 library project for source generator tools.
- Enable nullable reference types and C# preview features.
- Add dependencies for Microsoft.CodeAnalysis.CSharp and Microsoft.CodeAnalysis.Analyzers.
- Include additional project metadata and non-code assets (e.g. icon, README).
- Add IsRoslynComponent property to enable Roslyn component features.
- Enable EnforceExtendedAnalyzerRules for stricter analysis enforcement.
- Introduce `LayeredCraft.SourceGeneratorTools.BasicExample` project.
- Add a simple console application demonstrating "Hello, World!".
- Update solution file to include the new example project.
- Delete `HashCode` custom implementation in `Types` directory.
- Update `EquatableArray` to use utilities from `Utilities.HashCode`.
- Adjust namespace and declaration references in related tests.
- Include generated constants for streamlined code inclusion.
- Incorporate PolySharp for additional utility support.
…ration

- Add `ConvertPublicToInternal` method to streamline "public" to "internal" modification.
- Introduce constants for modifiers and a skip comment to improve readability.
- Replace `StreamReader` implementation for efficiency and reuse.
- Remove unused additional file processing logic for code simplification.
- Add `PackageId` and `Description` to .csproj files for NuGet packaging.
- Include output assembly as an analyzer with appropriate paths and visibility settings.
- Update `Directory.Build.props` with additional metadata like `PackageIcon`.
- Adjust `PackageTags` for consistency in NuGet listings.
@j-d-ha
j-d-ha merged commit f2a6c8f into main Dec 20, 2025
1 check passed
@j-d-ha
j-d-ha deleted the feature/update-to-be-source-generated branch December 20, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant