makit 0.0.111 → 0.0.112
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 +320 -323
- data/lib/makit/commands/middleware/unified_logger.rb +243 -243
- data/lib/makit/commands/middleware/validator.rb +269 -269
- data/lib/makit/commands/request.rb +254 -254
- data/lib/makit/commands/result.rb +323 -323
- data/lib/makit/commands/runner.rb +337 -317
- data/lib/makit/commands/strategies/base.rb +160 -160
- data/lib/makit/commands/strategies/synchronous.rb +134 -134
- data/lib/makit/commands.rb +51 -42
- data/lib/makit/configuration/gitlab_helper.rb +60 -60
- data/lib/makit/configuration/project.rb +127 -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_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 +141 -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/project.rb +153 -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 +305 -305
- data/lib/makit/logging/formatters/base.rb +39 -39
- data/lib/makit/logging/formatters/console_formatter.rb +140 -127
- 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 +115 -115
- data/lib/makit/logging/logger.rb +163 -159
- data/lib/makit/logging/sinks/console.rb +72 -72
- data/lib/makit/logging/sinks/file_sink.rb +92 -92
- data/lib/makit/logging/sinks/unified_file_sink.rb +303 -303
- data/lib/makit/logging.rb +530 -521
- 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 +193 -348
- 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 -117
- data/lib/makit/services/builder.rb +186 -186
- data/lib/makit/services/error_handler.rb +226 -226
- data/lib/makit/services/repository_manager.rb +229 -229
- data/lib/makit/services/validator.rb +112 -112
- data/lib/makit/setup/classlib.rb +53 -53
- data/lib/makit/setup/gem.rb +30 -17
- data/lib/makit/setup/runner.rb +45 -40
- data/lib/makit/setup.rb +5 -0
- data/lib/makit/show.rb +110 -110
- data/lib/makit/storage.rb +126 -126
- data/lib/makit/symbols.rb +170 -161
- data/lib/makit/task_info.rb +128 -128
- data/lib/makit/tasks/at_exit.rb +13 -13
- data/lib/makit/tasks/build.rb +19 -18
- data/lib/makit/tasks/clean.rb +11 -11
- data/lib/makit/tasks/hook_manager.rb +393 -239
- data/lib/makit/tasks/init.rb +47 -47
- data/lib/makit/tasks/integrate.rb +17 -15
- data/lib/makit/tasks/pull_incoming.rb +11 -12
- data/lib/makit/tasks/setup.rb +6 -6
- data/lib/makit/tasks/sync.rb +12 -11
- data/lib/makit/tasks/tag.rb +15 -0
- data/lib/makit/tasks/task_monkey_patch.rb +79 -79
- data/lib/makit/tasks.rb +10 -0
- data/lib/makit/test_cache.rb +239 -239
- data/lib/makit/tree.rb +37 -37
- data/lib/makit/v1/makit.v1_pb.rb +34 -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 -0
- 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 -0
- data/lib/makit.rb +40 -8
- metadata +50 -7
- data/lib/makit/command_runner.rb +0 -463
- data/lib/makit/commands/compatibility.rb +0 -365
- data/lib/makit/task_hooks.rb +0 -125
data/lib/makit/dotnet/project.rb
CHANGED
@@ -1,153 +1,153 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Makit
|
4
|
-
class DotNet
|
5
|
-
class Project
|
6
|
-
def self.is_installed?
|
7
|
-
File.exist?(Makit::Environment.which("dotnet"))
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.installed?
|
11
|
-
is_installed?
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.version
|
15
|
-
`dotnet --version`
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.project_short_name(project_path)
|
19
|
-
File.basename(project_path, ".csproj")
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.new_project(template, name, output, args = "")
|
23
|
-
if Dir.exist? output
|
24
|
-
Makit::Logging.default_logger.info("#{output}/#{name}.csproj")
|
25
|
-
#puts " .csproj ".colorize(:grey) + name.to_s.colorize(:green)
|
26
|
-
else
|
27
|
-
"dotnet new #{template} --name #{name} --output #{output} #{args}".run
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def self.set_project_target_framework(project_hint, target_framework)
|
32
|
-
project_path = find_project(project_hint)
|
33
|
-
project_content = File.read(project_path)
|
34
|
-
project_content.gsub!(%r{<TargetFramework>.*</TargetFramework>},
|
35
|
-
"<TargetFramework>#{target_framework}</TargetFramework>")
|
36
|
-
File.write(project_path, project_content)
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.find_project(project_hint)
|
40
|
-
matches = []
|
41
|
-
Dir.glob("**/*.csproj").each do |project_path|
|
42
|
-
matches << project_path if project_path.include?(project_hint)
|
43
|
-
end
|
44
|
-
if matches.length == 1
|
45
|
-
return matches.first
|
46
|
-
elsif matches.length > 1
|
47
|
-
raise "Multiple projects found matching #{project_hint}".colorize(:red)
|
48
|
-
end
|
49
|
-
|
50
|
-
raise "No project found matching #{project_hint}".colorize(:red)
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.add_package(project_path, package_name)
|
54
|
-
unless File.exist?(project_path)
|
55
|
-
actual_project_path = Makit::DotNet::Project.find_project(project_path)
|
56
|
-
raise "Project #{project_path} does not exist".colorize(:red) unless File.exist?(actual_project_path)
|
57
|
-
|
58
|
-
project_path = actual_project_path
|
59
|
-
end
|
60
|
-
|
61
|
-
project_content = File.read(project_path)
|
62
|
-
if project_content.include?("\"#{package_name}\"")
|
63
|
-
puts " package ".colorize(:grey) + package_name.to_s.colorize(:green)
|
64
|
-
else
|
65
|
-
"dotnet add #{project_path} package #{package_name}".run
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.add_packages(project_path, packages)
|
70
|
-
packages.each do |package|
|
71
|
-
add_package(project_path, package)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def self.add_reference(project_path, reference_path)
|
76
|
-
unless File.exist?(project_path)
|
77
|
-
actual_project_path = Makit::DotNet::Project.find_project(project_path)
|
78
|
-
raise "Project #{project_path} does not exist".colorize(:red) unless File.exist?(actual_project_path)
|
79
|
-
|
80
|
-
project_path = actual_project_path
|
81
|
-
end
|
82
|
-
|
83
|
-
unless File.exist?(reference_path)
|
84
|
-
actual_reference_path = Makit::DotNet::Project.find_project(reference_path)
|
85
|
-
raise "Project #{reference_path} does not exist".colorize(:red) unless File.exist?(actual_reference_path)
|
86
|
-
|
87
|
-
reference_path = actual_reference_path
|
88
|
-
end
|
89
|
-
|
90
|
-
project_content = File.read(project_path)
|
91
|
-
if project_content.include?(File.basename(reference_path))
|
92
|
-
#puts " reference ".colorize(:grey) + reference_path.to_s.colorize(:green)
|
93
|
-
else
|
94
|
-
"dotnet add #{project_path} reference #{reference_path}".run
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def self.add_references(project_path, references)
|
99
|
-
references.each do |reference|
|
100
|
-
add_reference(project_path, reference)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
def self.build(project_path, configuration = "Release", output = "artifacts")
|
105
|
-
project_dir = File.dirname(project_path)
|
106
|
-
newest_file = Makit::Directory.get_newest_file(project_dir)
|
107
|
-
command_request = Makit::
|
108
|
-
newest_file_date = if newest_file.nil?
|
109
|
-
Time.now
|
110
|
-
else
|
111
|
-
File.mtime(newest_file)
|
112
|
-
end
|
113
|
-
RUNNER.cache_run(command_request, newest_file_date)
|
114
|
-
end
|
115
|
-
|
116
|
-
def self.publish(project_path, configuration = "Release", output = "artifacts")
|
117
|
-
project_dir = File.dirname(project_path)
|
118
|
-
newest_file = Makit::Directory.get_newest_file(project_dir)
|
119
|
-
command_request = Makit::
|
120
|
-
newest_file_date = if newest_file.nil?
|
121
|
-
Time.now
|
122
|
-
else
|
123
|
-
File.mtime(newest_file)
|
124
|
-
end
|
125
|
-
RUNNER.cache_run(command_request, newest_file_date)
|
126
|
-
end
|
127
|
-
|
128
|
-
def self.test(project_path, configuration = "Release", output = "artifacts")
|
129
|
-
project_dir = File.dirname(project_path)
|
130
|
-
newest_file = Makit::Directory.get_newest_file(project_dir)
|
131
|
-
command_request = Makit::
|
132
|
-
newest_file_date = if newest_file.nil?
|
133
|
-
Time.now
|
134
|
-
else
|
135
|
-
File.mtime(newest_file)
|
136
|
-
end
|
137
|
-
RUNNER.cache_run(command_request, newest_file_date)
|
138
|
-
end
|
139
|
-
|
140
|
-
def self.format_project(project_path)
|
141
|
-
File.basename(project_path, ".csproj")
|
142
|
-
"dotnet tool update --global dotnet-format".run
|
143
|
-
"dotnet format #{project_path}".run
|
144
|
-
end
|
145
|
-
|
146
|
-
def self.upgrade_project(project_path)
|
147
|
-
File.basename(project_path, ".csproj")
|
148
|
-
"dotnet tool install --global dotnet-outdated-tool".run
|
149
|
-
"dotnet outdated #{project_path} --upgrade:Auto".run
|
150
|
-
end
|
151
|
-
end
|
152
|
-
end
|
153
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Makit
|
4
|
+
class DotNet
|
5
|
+
class Project
|
6
|
+
def self.is_installed?
|
7
|
+
File.exist?(Makit::Environment.which("dotnet"))
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.installed?
|
11
|
+
is_installed?
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.version
|
15
|
+
`dotnet --version`
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.project_short_name(project_path)
|
19
|
+
File.basename(project_path, ".csproj")
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.new_project(template, name, output, args = "")
|
23
|
+
if Dir.exist? output
|
24
|
+
Makit::Logging.default_logger.info("#{output}/#{name}.csproj")
|
25
|
+
#puts " .csproj ".colorize(:grey) + name.to_s.colorize(:green)
|
26
|
+
else
|
27
|
+
"dotnet new #{template} --name #{name} --output #{output} #{args}".run
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.set_project_target_framework(project_hint, target_framework)
|
32
|
+
project_path = find_project(project_hint)
|
33
|
+
project_content = File.read(project_path)
|
34
|
+
project_content.gsub!(%r{<TargetFramework>.*</TargetFramework>},
|
35
|
+
"<TargetFramework>#{target_framework}</TargetFramework>")
|
36
|
+
File.write(project_path, project_content)
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.find_project(project_hint)
|
40
|
+
matches = []
|
41
|
+
Dir.glob("**/*.csproj").each do |project_path|
|
42
|
+
matches << project_path if project_path.include?(project_hint)
|
43
|
+
end
|
44
|
+
if matches.length == 1
|
45
|
+
return matches.first
|
46
|
+
elsif matches.length > 1
|
47
|
+
raise "Multiple projects found matching #{project_hint}".colorize(:red)
|
48
|
+
end
|
49
|
+
|
50
|
+
raise "No project found matching #{project_hint}".colorize(:red)
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.add_package(project_path, package_name)
|
54
|
+
unless File.exist?(project_path)
|
55
|
+
actual_project_path = Makit::DotNet::Project.find_project(project_path)
|
56
|
+
raise "Project #{project_path} does not exist".colorize(:red) unless File.exist?(actual_project_path)
|
57
|
+
|
58
|
+
project_path = actual_project_path
|
59
|
+
end
|
60
|
+
|
61
|
+
project_content = File.read(project_path)
|
62
|
+
if project_content.include?("\"#{package_name}\"")
|
63
|
+
puts " package ".colorize(:grey) + package_name.to_s.colorize(:green)
|
64
|
+
else
|
65
|
+
"dotnet add #{project_path} package #{package_name}".run
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.add_packages(project_path, packages)
|
70
|
+
packages.each do |package|
|
71
|
+
add_package(project_path, package)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.add_reference(project_path, reference_path)
|
76
|
+
unless File.exist?(project_path)
|
77
|
+
actual_project_path = Makit::DotNet::Project.find_project(project_path)
|
78
|
+
raise "Project #{project_path} does not exist".colorize(:red) unless File.exist?(actual_project_path)
|
79
|
+
|
80
|
+
project_path = actual_project_path
|
81
|
+
end
|
82
|
+
|
83
|
+
unless File.exist?(reference_path)
|
84
|
+
actual_reference_path = Makit::DotNet::Project.find_project(reference_path)
|
85
|
+
raise "Project #{reference_path} does not exist".colorize(:red) unless File.exist?(actual_reference_path)
|
86
|
+
|
87
|
+
reference_path = actual_reference_path
|
88
|
+
end
|
89
|
+
|
90
|
+
project_content = File.read(project_path)
|
91
|
+
if project_content.include?(File.basename(reference_path))
|
92
|
+
#puts " reference ".colorize(:grey) + reference_path.to_s.colorize(:green)
|
93
|
+
else
|
94
|
+
"dotnet add #{project_path} reference #{reference_path}".run
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.add_references(project_path, references)
|
99
|
+
references.each do |reference|
|
100
|
+
add_reference(project_path, reference)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def self.build(project_path, configuration = "Release", output = "artifacts")
|
105
|
+
project_dir = File.dirname(project_path)
|
106
|
+
newest_file = Makit::Directory.get_newest_file(project_dir)
|
107
|
+
command_request = Makit::Commands::Runner.default.parse_command_request("dotnet build #{project_path} --configuration #{configuration} --output #{output}")
|
108
|
+
newest_file_date = if newest_file.nil?
|
109
|
+
Time.now
|
110
|
+
else
|
111
|
+
File.mtime(newest_file)
|
112
|
+
end
|
113
|
+
RUNNER.cache_run(command_request, newest_file_date)
|
114
|
+
end
|
115
|
+
|
116
|
+
def self.publish(project_path, configuration = "Release", output = "artifacts")
|
117
|
+
project_dir = File.dirname(project_path)
|
118
|
+
newest_file = Makit::Directory.get_newest_file(project_dir)
|
119
|
+
command_request = Makit::Commands::Runner.default.parse_command_request("dotnet publish #{project_path} --configuration #{configuration} --output #{output}")
|
120
|
+
newest_file_date = if newest_file.nil?
|
121
|
+
Time.now
|
122
|
+
else
|
123
|
+
File.mtime(newest_file)
|
124
|
+
end
|
125
|
+
RUNNER.cache_run(command_request, newest_file_date)
|
126
|
+
end
|
127
|
+
|
128
|
+
def self.test(project_path, configuration = "Release", output = "artifacts")
|
129
|
+
project_dir = File.dirname(project_path)
|
130
|
+
newest_file = Makit::Directory.get_newest_file(project_dir)
|
131
|
+
command_request = Makit::Commands::Runner.default.parse_command_request("dotnet test #{project_path} --configuration #{configuration} --output #{output}")
|
132
|
+
newest_file_date = if newest_file.nil?
|
133
|
+
Time.now
|
134
|
+
else
|
135
|
+
File.mtime(newest_file)
|
136
|
+
end
|
137
|
+
RUNNER.cache_run(command_request, newest_file_date)
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.format_project(project_path)
|
141
|
+
File.basename(project_path, ".csproj")
|
142
|
+
"dotnet tool update --global dotnet-format".run
|
143
|
+
"dotnet format #{project_path}".run
|
144
|
+
end
|
145
|
+
|
146
|
+
def self.upgrade_project(project_path)
|
147
|
+
File.basename(project_path, ".csproj")
|
148
|
+
"dotnet tool install --global dotnet-outdated-tool".run
|
149
|
+
"dotnet outdated #{project_path} --upgrade:Auto".run
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
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
|