Class: Makit::Configuration::DotNetProject
- Inherits:
-
Object
- Object
- Makit::Configuration::DotNetProject
- Defined in:
- lib/makit/configuration/dotnet_project.rb
Overview
Project configuration management
Instance Attribute Summary collapse
-
#frameworks ⇒ Object
Returns the value of attribute frameworks.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
- #get_build_commands ⇒ Object
- #get_csproj_path ⇒ Object
- #get_publish_commands ⇒ Object
-
#initialize ⇒ DotNetProject
constructor
set the default values.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ DotNetProject
set the default values
12 13 14 15 16 17 |
# File 'lib/makit/configuration/dotnet_project.rb', line 12 def initialize @name = "MyClassLib" @output_dir = "source/MyClassLib" @frameworks = ["net8.0", "net8.0-browser"] @template = "classlib" end |
Instance Attribute Details
#frameworks ⇒ Object
Returns the value of attribute frameworks.
9 10 11 |
# File 'lib/makit/configuration/dotnet_project.rb', line 9 def frameworks @frameworks end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/makit/configuration/dotnet_project.rb', line 9 def name @name end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
9 10 11 |
# File 'lib/makit/configuration/dotnet_project.rb', line 9 def output_dir @output_dir end |
#template ⇒ Object
Returns the value of attribute template.
9 10 11 |
# File 'lib/makit/configuration/dotnet_project.rb', line 9 def template @template end |
Instance Method Details
#get_build_commands ⇒ Object
23 24 25 26 27 28 |
# File 'lib/makit/configuration/dotnet_project.rb', line 23 def get_build_commands commands = [] commands << "dotnet build #{get_csproj_path} --configuration Release" commands << "dotnet build #{get_csproj_path} --configuration Debug" commands end |
#get_csproj_path ⇒ Object
19 20 21 |
# File 'lib/makit/configuration/dotnet_project.rb', line 19 def get_csproj_path "#{@output_dir}/#{@name}.csproj" end |
#get_publish_commands ⇒ Object
30 31 32 33 34 35 |
# File 'lib/makit/configuration/dotnet_project.rb', line 30 def get_publish_commands commands = [] commands << "dotnet publish #{get_csproj_path} --configuration Release --output artifacts/Publish" commands << "dotnet publish #{get_csproj_path} --configuration Debug --output artifacts/Publish" commands end |
#to_json ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/makit/configuration/dotnet_project.rb', line 37 def to_json { name: @name, output_dir: @output_dir, frameworks: @frameworks, template: @template }.to_json end |