makit 0.0.112 → 0.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +41 -41
- data/exe/makit +5 -5
- data/lib/makit/apache.rb +28 -28
- data/lib/makit/cli/build_commands.rb +500 -500
- data/lib/makit/cli/generators/base_generator.rb +74 -74
- data/lib/makit/cli/generators/dotnet_generator.rb +50 -50
- data/lib/makit/cli/generators/generator_factory.rb +49 -49
- data/lib/makit/cli/generators/node_generator.rb +50 -50
- data/lib/makit/cli/generators/ruby_generator.rb +77 -77
- data/lib/makit/cli/generators/rust_generator.rb +50 -50
- data/lib/makit/cli/generators/templates/dotnet_templates.rb +167 -167
- data/lib/makit/cli/generators/templates/node_templates.rb +161 -161
- data/lib/makit/cli/generators/templates/ruby/gemfile.rb +26 -26
- data/lib/makit/cli/generators/templates/ruby/gemspec.rb +40 -40
- data/lib/makit/cli/generators/templates/ruby/main_lib.rb +33 -33
- data/lib/makit/cli/generators/templates/ruby/rakefile.rb +35 -35
- data/lib/makit/cli/generators/templates/ruby/readme.rb +63 -63
- data/lib/makit/cli/generators/templates/ruby/test.rb +39 -39
- data/lib/makit/cli/generators/templates/ruby/test_helper.rb +29 -29
- data/lib/makit/cli/generators/templates/ruby/version.rb +29 -29
- data/lib/makit/cli/generators/templates/rust_templates.rb +128 -128
- data/lib/makit/cli/main.rb +62 -62
- data/lib/makit/cli/project_commands.rb +868 -868
- data/lib/makit/cli/repository_commands.rb +661 -661
- data/lib/makit/cli/utility_commands.rb +521 -521
- data/lib/makit/commands/factory.rb +359 -359
- data/lib/makit/commands/middleware/base.rb +73 -73
- data/lib/makit/commands/middleware/cache.rb +248 -248
- data/lib/makit/commands/middleware/command_logger.rb +311 -320
- data/lib/makit/commands/middleware/validator.rb +269 -269
- data/lib/makit/commands/request.rb +316 -254
- data/lib/makit/commands/result.rb +323 -323
- data/lib/makit/commands/runner.rb +368 -337
- data/lib/makit/commands/strategies/base.rb +171 -160
- data/lib/makit/commands/strategies/synchronous.rb +139 -134
- data/lib/makit/commands.rb +50 -51
- data/lib/makit/configuration/gitlab_helper.rb +58 -60
- data/lib/makit/configuration/project.rb +167 -127
- data/lib/makit/configuration/rakefile_helper.rb +43 -43
- data/lib/makit/configuration/step.rb +34 -34
- data/lib/makit/configuration.rb +14 -14
- data/lib/makit/content/default_gitignore.rb +7 -7
- data/lib/makit/content/default_gitignore.txt +226 -0
- data/lib/makit/content/default_rakefile.rb +13 -13
- data/lib/makit/content/gem_rakefile.rb +16 -16
- data/lib/makit/context.rb +1 -1
- data/lib/makit/data.rb +49 -49
- data/lib/makit/directories.rb +140 -141
- data/lib/makit/directory.rb +262 -262
- data/lib/makit/docs/files.rb +89 -89
- data/lib/makit/docs/rake.rb +102 -102
- data/lib/makit/dotnet/cli.rb +69 -65
- data/lib/makit/dotnet/project.rb +217 -153
- data/lib/makit/dotnet/solution.rb +38 -38
- data/lib/makit/dotnet/solution_classlib.rb +239 -239
- data/lib/makit/dotnet/solution_console.rb +264 -264
- data/lib/makit/dotnet/solution_maui.rb +354 -354
- data/lib/makit/dotnet/solution_wasm.rb +275 -275
- data/lib/makit/dotnet/solution_wpf.rb +304 -304
- data/lib/makit/dotnet.rb +102 -102
- data/lib/makit/email.rb +90 -90
- data/lib/makit/environment.rb +142 -142
- data/lib/makit/examples/runner.rb +370 -370
- data/lib/makit/exceptions.rb +45 -45
- data/lib/makit/fileinfo.rb +24 -24
- data/lib/makit/files.rb +43 -43
- data/lib/makit/gems.rb +40 -40
- data/lib/makit/git/cli.rb +54 -54
- data/lib/makit/git/repository.rb +90 -90
- data/lib/makit/git.rb +98 -98
- data/lib/makit/gitlab_runner.rb +59 -59
- data/lib/makit/humanize.rb +137 -137
- data/lib/makit/indexer.rb +47 -47
- data/lib/makit/logging/configuration.rb +308 -305
- data/lib/makit/logging/format_registry.rb +84 -84
- data/lib/makit/logging/formatters/base.rb +39 -39
- data/lib/makit/logging/formatters/console_formatter.rb +140 -140
- data/lib/makit/logging/formatters/json_formatter.rb +65 -65
- data/lib/makit/logging/formatters/plain_text_formatter.rb +71 -71
- data/lib/makit/logging/formatters/text_formatter.rb +64 -64
- data/lib/makit/logging/log_request.rb +119 -115
- data/lib/makit/logging/logger.rb +199 -163
- data/lib/makit/logging/sinks/base.rb +91 -91
- data/lib/makit/logging/sinks/console.rb +72 -72
- data/lib/makit/logging/sinks/file_sink.rb +92 -92
- data/lib/makit/logging/sinks/structured.rb +123 -129
- data/lib/makit/logging/sinks/unified_file_sink.rb +296 -303
- data/lib/makit/logging.rb +565 -530
- data/lib/makit/markdown.rb +75 -75
- data/lib/makit/mp/basic_object_mp.rb +17 -17
- data/lib/makit/mp/command_mp.rb +13 -13
- data/lib/makit/mp/command_request.mp.rb +17 -17
- data/lib/makit/mp/project_mp.rb +199 -199
- data/lib/makit/mp/string_mp.rb +191 -193
- data/lib/makit/nuget.rb +74 -74
- data/lib/makit/port.rb +32 -32
- data/lib/makit/process.rb +163 -163
- data/lib/makit/protoc.rb +107 -107
- data/lib/makit/rake/cli.rb +196 -196
- data/lib/makit/rake.rb +25 -25
- data/lib/makit/ruby/cli.rb +185 -185
- data/lib/makit/ruby.rb +25 -25
- data/lib/makit/secrets.rb +51 -51
- data/lib/makit/serializer.rb +130 -130
- data/lib/makit/services/builder.rb +186 -186
- data/lib/makit/services/error_handler.rb +226 -226
- data/lib/makit/services/repository_manager.rb +231 -229
- data/lib/makit/services/validator.rb +112 -112
- data/lib/makit/setup/classlib.rb +90 -53
- data/lib/makit/setup/gem.rb +268 -263
- data/lib/makit/setup/razorclasslib.rb +91 -0
- data/lib/makit/setup/runner.rb +54 -45
- data/lib/makit/setup.rb +5 -5
- data/lib/makit/show.rb +110 -110
- data/lib/makit/storage.rb +126 -126
- data/lib/makit/symbols.rb +170 -170
- data/lib/makit/task_info.rb +128 -128
- data/lib/makit/tasks/at_exit.rb +15 -13
- data/lib/makit/tasks/build.rb +22 -19
- data/lib/makit/tasks/clean.rb +13 -11
- data/lib/makit/tasks/configure.rb +10 -0
- data/lib/makit/tasks/format.rb +10 -0
- data/lib/makit/tasks/hook_manager.rb +391 -393
- data/lib/makit/tasks/init.rb +49 -47
- data/lib/makit/tasks/integrate.rb +29 -17
- data/lib/makit/tasks/pull_incoming.rb +13 -11
- data/lib/makit/tasks/setup.rb +13 -6
- data/lib/makit/tasks/sync.rb +17 -12
- data/lib/makit/tasks/tag.rb +16 -15
- data/lib/makit/tasks/task_monkey_patch.rb +81 -79
- data/lib/makit/tasks/test.rb +22 -0
- data/lib/makit/tasks/update.rb +18 -0
- data/lib/makit/tasks.rb +20 -15
- data/lib/makit/test_cache.rb +239 -239
- data/lib/makit/tree.rb +37 -37
- data/lib/makit/v1/makit.v1_pb.rb +35 -34
- data/lib/makit/v1/makit.v1_services_pb.rb +27 -27
- data/lib/makit/version.rb +5 -5
- data/lib/makit/version_util.rb +21 -21
- data/lib/makit/wix.rb +95 -95
- data/lib/makit/yaml.rb +29 -29
- data/lib/makit/zip.rb +17 -17
- data/lib/makit copy.rb +44 -44
- data/lib/makit.rb +39 -40
- metadata +69 -7
- data/lib/makit/commands/middleware/unified_logger.rb +0 -243
data/lib/makit/dotnet/project.rb
CHANGED
@@ -1,153 +1,217 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Makit
|
4
|
-
class DotNet
|
5
|
-
class Project
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
project_content
|
62
|
-
|
63
|
-
|
64
|
-
else
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
File.
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Makit
|
4
|
+
class DotNet
|
5
|
+
class Project
|
6
|
+
attr_accessor :filename
|
7
|
+
|
8
|
+
def initialize(filename)
|
9
|
+
@filename = filename
|
10
|
+
end
|
11
|
+
|
12
|
+
def set_version(version)
|
13
|
+
# set the <Version> tag to the version
|
14
|
+
project_content = File.read(filename)
|
15
|
+
if project_content.include?("<Version>")
|
16
|
+
project_content.gsub!(%r{<Version>.*</Version>},
|
17
|
+
"<Version>#{version}</Version>")
|
18
|
+
else
|
19
|
+
# add the <Version> tag to the next line after the <PropertyGroup> tag
|
20
|
+
project_content.gsub!("<PropertyGroup>",
|
21
|
+
"<PropertyGroup>\n <Version>#{version}</Version>")
|
22
|
+
end
|
23
|
+
File.write(filename, project_content)
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_version
|
27
|
+
# get the <Version> tag
|
28
|
+
project_content = File.read(filename)
|
29
|
+
raise "Version not found in #{filename}".colorize(:red) unless project_content.include?("<Version>")
|
30
|
+
|
31
|
+
project_content.match(%r{<Version>(.*)</Version>})[1]
|
32
|
+
end
|
33
|
+
|
34
|
+
# <TargetFramework>net8.0</TargetFramework>
|
35
|
+
# <TargetFrameworks>net8.0;net8.0-browser</TargetFrameworks>
|
36
|
+
def set_target_frameworks(target_frameworks)
|
37
|
+
project_content = File.read(filename)
|
38
|
+
target_frameworks = target_frameworks.join(";") if target_frameworks.is_a?(Array)
|
39
|
+
if target_frameworks.include?(";")
|
40
|
+
# use <TargetFrameworks> tag
|
41
|
+
if project_content.include?("<TargetFrameworks>")
|
42
|
+
project_content.gsub!(%r{<TargetFrameworks>.*</TargetFrameworks>},
|
43
|
+
"<TargetFrameworks>#{target_frameworks}</TargetFrameworks>")
|
44
|
+
else
|
45
|
+
project_content.gsub!(%r{<TargetFramework>.*</TargetFramework>},
|
46
|
+
"<TargetFrameworks>#{target_frameworks}</TargetFrameworks>")
|
47
|
+
end
|
48
|
+
elsif project_content.include?("<TargetFramework>")
|
49
|
+
# use <TargetFramework> tag
|
50
|
+
project_content.gsub!(%r{<TargetFramework>.*</TargetFramework>},
|
51
|
+
"<TargetFramework>#{target_frameworks}</TargetFramework>")
|
52
|
+
else
|
53
|
+
project_content.gsub!(%r{<TargetFrameworks>.*</TargetFrameworks>},
|
54
|
+
"<TargetFramework>#{target_frameworks}</TargetFramework>")
|
55
|
+
end
|
56
|
+
File.write(filename, project_content)
|
57
|
+
end
|
58
|
+
|
59
|
+
def set_nuget_metadata(package_id, authors, description, license_expression)
|
60
|
+
project_content = File.read(filename)
|
61
|
+
if project_content.include?("<PropertyGroup Label=\"NuGet Metadata\">")
|
62
|
+
project_content.gsub!(%r{<PropertyGroup Label="NuGet Metadata">.*</PropertyGroup>},
|
63
|
+
" <PropertyGroup Label=\"NuGet Metadata\">\n <IsPackable>true</IsPackable>\n <PackageId>#{package_id}</PackageId>\n <Authors>#{authors}</Authors>\n <Description>#{description}</Description>\n <PackageLicenseExpression>#{license_expression}</PackageLicenseExpression>\n\n</PropertyGroup>")
|
64
|
+
else
|
65
|
+
# add the <PropertyGroup Label=\"NuGet Metadata\"> tag before the </Project> closing tag
|
66
|
+
project_content.gsub!(%r{</Project>},
|
67
|
+
" <PropertyGroup Label=\"NuGet Metadata\">\n <IsPackable>true</IsPackable>\n <PackageId>#{package_id}</PackageId>\n <Authors>#{authors}</Authors>\n <Description>#{description}</Description>\n <PackageLicenseExpression>#{license_expression}</PackageLicenseExpression>\n </PropertyGroup>\n\n</Project>")
|
68
|
+
end
|
69
|
+
|
70
|
+
File.write(filename, project_content)
|
71
|
+
end
|
72
|
+
|
73
|
+
# consider move some of the methods to the CLI class
|
74
|
+
def self.installed?
|
75
|
+
is_installed?
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.version
|
79
|
+
`dotnet --version`
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.project_short_name(project_path)
|
83
|
+
File.basename(project_path, ".csproj")
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.new_project(template, name, output, args = "")
|
87
|
+
if Dir.exist? output
|
88
|
+
Makit::Logging.default_logger.info("#{output}/#{name}.csproj")
|
89
|
+
# puts " .csproj ".colorize(:grey) + name.to_s.colorize(:green)
|
90
|
+
else
|
91
|
+
"dotnet new #{template} --name #{name} --output #{output} #{args}".run
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.set_project_target_framework(project_hint, target_framework)
|
96
|
+
project_path = find_project(project_hint)
|
97
|
+
project_content = File.read(project_path)
|
98
|
+
project_content.gsub!(%r{<TargetFramework>.*</TargetFramework>},
|
99
|
+
"<TargetFramework>#{target_framework}</TargetFramework>")
|
100
|
+
File.write(project_path, project_content)
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.find_project(project_hint)
|
104
|
+
matches = []
|
105
|
+
Dir.glob("**/*.csproj").each do |project_path|
|
106
|
+
matches << project_path if project_path.include?(project_hint)
|
107
|
+
end
|
108
|
+
if matches.length == 1
|
109
|
+
return matches.first
|
110
|
+
elsif matches.length > 1
|
111
|
+
raise "Multiple projects found matching #{project_hint}".colorize(:red)
|
112
|
+
end
|
113
|
+
|
114
|
+
raise "No project found matching #{project_hint}".colorize(:red)
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.add_package(project_path, package_name)
|
118
|
+
unless File.exist?(project_path)
|
119
|
+
actual_project_path = Makit::DotNet::Project.find_project(project_path)
|
120
|
+
raise "Project #{project_path} does not exist".colorize(:red) unless File.exist?(actual_project_path)
|
121
|
+
|
122
|
+
project_path = actual_project_path
|
123
|
+
end
|
124
|
+
|
125
|
+
project_content = File.read(project_path)
|
126
|
+
if project_content.include?("\"#{package_name}\"")
|
127
|
+
puts " package ".colorize(:grey) + package_name.to_s.colorize(:green)
|
128
|
+
else
|
129
|
+
"dotnet add #{project_path} package #{package_name}".run
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.add_packages(project_path, packages)
|
134
|
+
packages.each do |package|
|
135
|
+
add_package(project_path, package)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.add_reference(project_path, reference_path)
|
140
|
+
unless File.exist?(project_path)
|
141
|
+
actual_project_path = Makit::DotNet::Project.find_project(project_path)
|
142
|
+
raise "Project #{project_path} does not exist".colorize(:red) unless File.exist?(actual_project_path)
|
143
|
+
|
144
|
+
project_path = actual_project_path
|
145
|
+
end
|
146
|
+
|
147
|
+
unless File.exist?(reference_path)
|
148
|
+
actual_reference_path = Makit::DotNet::Project.find_project(reference_path)
|
149
|
+
raise "Project #{reference_path} does not exist".colorize(:red) unless File.exist?(actual_reference_path)
|
150
|
+
|
151
|
+
reference_path = actual_reference_path
|
152
|
+
end
|
153
|
+
|
154
|
+
project_content = File.read(project_path)
|
155
|
+
if project_content.include?(File.basename(reference_path))
|
156
|
+
# puts " reference ".colorize(:grey) + reference_path.to_s.colorize(:green)
|
157
|
+
else
|
158
|
+
"dotnet add #{project_path} reference #{reference_path}".run
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def self.add_references(project_path, references)
|
163
|
+
references.each do |reference|
|
164
|
+
add_reference(project_path, reference)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def self.build(project_path, configuration = "Release", output = "artifacts")
|
169
|
+
project_dir = File.dirname(project_path)
|
170
|
+
newest_file = Makit::Directory.get_newest_file(project_dir)
|
171
|
+
command_request = Makit::Commands::Runner.default.parse_command_request("dotnet build #{project_path} --configuration #{configuration} --output #{output}")
|
172
|
+
newest_file_date = if newest_file.nil?
|
173
|
+
Time.now
|
174
|
+
else
|
175
|
+
File.mtime(newest_file)
|
176
|
+
end
|
177
|
+
RUNNER.cache_run(command_request, newest_file_date)
|
178
|
+
end
|
179
|
+
|
180
|
+
def self.publish(project_path, configuration = "Release", output = "artifacts")
|
181
|
+
project_dir = File.dirname(project_path)
|
182
|
+
newest_file = Makit::Directory.get_newest_file(project_dir)
|
183
|
+
command_request = Makit::Commands::Runner.default.parse_command_request("dotnet publish #{project_path} --configuration #{configuration} --output #{output}")
|
184
|
+
newest_file_date = if newest_file.nil?
|
185
|
+
Time.now
|
186
|
+
else
|
187
|
+
File.mtime(newest_file)
|
188
|
+
end
|
189
|
+
RUNNER.cache_run(command_request, newest_file_date)
|
190
|
+
end
|
191
|
+
|
192
|
+
def self.test(project_path, configuration = "Release", output = "artifacts")
|
193
|
+
project_dir = File.dirname(project_path)
|
194
|
+
newest_file = Makit::Directory.get_newest_file(project_dir)
|
195
|
+
command_request = Makit::Commands::Runner.default.parse_command_request("dotnet test #{project_path} --configuration #{configuration} --output #{output}")
|
196
|
+
newest_file_date = if newest_file.nil?
|
197
|
+
Time.now
|
198
|
+
else
|
199
|
+
File.mtime(newest_file)
|
200
|
+
end
|
201
|
+
RUNNER.cache_run(command_request, newest_file_date)
|
202
|
+
end
|
203
|
+
|
204
|
+
def self.format_project(project_path)
|
205
|
+
File.basename(project_path, ".csproj")
|
206
|
+
"dotnet tool update --global dotnet-format".run
|
207
|
+
"dotnet format #{project_path}".run
|
208
|
+
end
|
209
|
+
|
210
|
+
def self.upgrade_project(project_path)
|
211
|
+
File.basename(project_path, ".csproj")
|
212
|
+
"dotnet tool install --global dotnet-outdated-tool".run
|
213
|
+
"dotnet outdated #{project_path} --upgrade:Auto".run
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
end
|
@@ -1,38 +1,38 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "solution_classlib"
|
4
|
-
require_relative "solution_console"
|
5
|
-
require_relative "solution_wasm"
|
6
|
-
require_relative "solution_maui"
|
7
|
-
require_relative "solution_wpf"
|
8
|
-
|
9
|
-
module Makit
|
10
|
-
class DotNet
|
11
|
-
class SolutionType
|
12
|
-
ClassLibrary = "classlib"
|
13
|
-
ConsoleApplication = "console"
|
14
|
-
Wasm = "wasm"
|
15
|
-
Maui = "maui"
|
16
|
-
Wpf = "wpf"
|
17
|
-
end
|
18
|
-
|
19
|
-
class Solution
|
20
|
-
def self.setup(solution_type, name)
|
21
|
-
case solution_type
|
22
|
-
when SolutionType::ClassLibrary
|
23
|
-
SolutionClassLib.setup(name)
|
24
|
-
when SolutionType::ConsoleApplication
|
25
|
-
SolutionConsole.setup(name)
|
26
|
-
when SolutionType::Wasm
|
27
|
-
SolutionWasm.setup(name)
|
28
|
-
when SolutionType::Maui
|
29
|
-
SolutionMaui.setup(name)
|
30
|
-
when SolutionType::Wpf
|
31
|
-
SolutionWpf.setup(name)
|
32
|
-
else
|
33
|
-
raise ArgumentError, "Unsupported solution type: #{solution_type}"
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "solution_classlib"
|
4
|
+
require_relative "solution_console"
|
5
|
+
require_relative "solution_wasm"
|
6
|
+
require_relative "solution_maui"
|
7
|
+
require_relative "solution_wpf"
|
8
|
+
|
9
|
+
module Makit
|
10
|
+
class DotNet
|
11
|
+
class SolutionType
|
12
|
+
ClassLibrary = "classlib"
|
13
|
+
ConsoleApplication = "console"
|
14
|
+
Wasm = "wasm"
|
15
|
+
Maui = "maui"
|
16
|
+
Wpf = "wpf"
|
17
|
+
end
|
18
|
+
|
19
|
+
class Solution
|
20
|
+
def self.setup(solution_type, name)
|
21
|
+
case solution_type
|
22
|
+
when SolutionType::ClassLibrary
|
23
|
+
SolutionClassLib.setup(name)
|
24
|
+
when SolutionType::ConsoleApplication
|
25
|
+
SolutionConsole.setup(name)
|
26
|
+
when SolutionType::Wasm
|
27
|
+
SolutionWasm.setup(name)
|
28
|
+
when SolutionType::Maui
|
29
|
+
SolutionMaui.setup(name)
|
30
|
+
when SolutionType::Wpf
|
31
|
+
SolutionWpf.setup(name)
|
32
|
+
else
|
33
|
+
raise ArgumentError, "Unsupported solution type: #{solution_type}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|