Class: Makit::Cli::Generators::Templates::Dotnet::Csproj
- Inherits:
-
Object
- Object
- Makit::Cli::Generators::Templates::Dotnet::Csproj
- Defined in:
- lib/makit/cli/generators/templates/dotnet_templates.rb
Overview
Template generator for .NET .csproj project files
Generates a basic .NET 6.0 console application project file with standard configuration including nullable reference types and implicit usings.
Instance Method Summary collapse
-
#initialize(project_name) ⇒ Csproj
constructor
Initialize a new .csproj template generator.
-
#render ⇒ String
Render the .csproj XML content.
Constructor Details
#initialize(project_name) ⇒ Csproj
Initialize a new .csproj template generator
28 29 30 |
# File 'lib/makit/cli/generators/templates/dotnet_templates.rb', line 28 def initialize(project_name) @project_name = project_name end |
Instance Method Details
#render ⇒ String
Render the .csproj XML content
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/makit/cli/generators/templates/dotnet_templates.rb', line 35 def render <<~XML <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> </Project> XML end |