makit 0.0.75 → 0.0.76

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/makit/v1/makit.v1_pb.rb +35 -0
  3. data/lib/generated/makit/v1/web/link_pb.rb +20 -0
  4. data/lib/makit/apache.rb +32 -32
  5. data/lib/makit/cli/clean.rb +14 -14
  6. data/lib/makit/cli/clone.rb +59 -59
  7. data/lib/makit/cli/init.rb +38 -38
  8. data/lib/makit/cli/main.rb +33 -33
  9. data/lib/makit/cli/make.rb +54 -54
  10. data/lib/makit/cli/new.rb +37 -37
  11. data/lib/makit/cli/nuget_cache.rb +38 -38
  12. data/lib/makit/cli/pull.rb +31 -31
  13. data/lib/makit/cli/setup.rb +71 -71
  14. data/lib/makit/cli/work.rb +21 -21
  15. data/lib/makit/command_runner.rb +404 -404
  16. data/lib/makit/commands.rb +21 -21
  17. data/lib/makit/content/default_gitignore.rb +5 -5
  18. data/lib/makit/content/default_gitignore.txt +222 -222
  19. data/lib/makit/content/default_rakefile.rb +11 -11
  20. data/lib/makit/content/gem_rakefile.rb +14 -14
  21. data/lib/makit/data.rb +50 -50
  22. data/lib/makit/directories.rb +143 -144
  23. data/lib/makit/directory.rb +264 -264
  24. data/lib/makit/docs/files.rb +94 -94
  25. data/lib/makit/docs/rake.rb +106 -106
  26. data/lib/makit/dotnet.rb +212 -182
  27. data/lib/makit/environment.rb +131 -131
  28. data/lib/makit/fileinfo.rb +26 -26
  29. data/lib/makit/files.rb +47 -47
  30. data/lib/makit/git.rb +145 -145
  31. data/lib/makit/gitlab_runner.rb +60 -60
  32. data/lib/makit/humanize.rb +129 -129
  33. data/lib/makit/indexer.rb +56 -56
  34. data/lib/makit/logging.rb +106 -106
  35. data/lib/makit/markdown.rb +75 -75
  36. data/lib/makit/mp/basic_object_mp.rb +16 -16
  37. data/lib/makit/mp/command_mp.rb +13 -13
  38. data/lib/makit/mp/command_request.mp.rb +16 -16
  39. data/lib/makit/mp/project_mp.rb +210 -210
  40. data/lib/makit/mp/string_mp.rb +137 -137
  41. data/lib/makit/nuget.rb +62 -62
  42. data/lib/makit/process.rb +26 -26
  43. data/lib/makit/protoc.rb +104 -104
  44. data/lib/makit/secrets.rb +51 -51
  45. data/lib/makit/serializer.rb +115 -115
  46. data/lib/makit/show.rb +110 -110
  47. data/lib/makit/storage.rb +131 -131
  48. data/lib/makit/symbols.rb +149 -149
  49. data/lib/makit/task_info.rb +86 -86
  50. data/lib/makit/tasks.rb +137 -137
  51. data/lib/makit/tree.rb +37 -37
  52. data/lib/makit/v1/makit.v1_services_pb.rb +25 -25
  53. data/lib/makit/version.rb +65 -65
  54. data/lib/makit/wix.rb +95 -95
  55. data/lib/makit/yaml.rb +17 -17
  56. data/lib/makit/zip.rb +17 -17
  57. data/lib/makit.rb +267 -267
  58. metadata +5 -3
@@ -1,75 +1,75 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "humanize"
4
-
5
- # This module provides classes for the Makit gem.
6
- module Makit
7
- class Markdown
8
- def self.get_commands_markdown(commands)
9
- summary = ""
10
- commands.each do |command|
11
- md = Makit::Markdown.get_command_markdown(command)
12
- summary += md
13
- end
14
- summary
15
- end
16
-
17
- def self.get_command_markdown(command)
18
- md = "<details>\n"
19
- md += "<summary>#{Makit::Humanize::get_command_summary(command)}</summary>\n\n"
20
-
21
- if command.output.length > 0
22
- md += "<table><tr><th>output</th></tr><tr><td>\n\n" #<pre>\n"
23
- md += "```shell\n"
24
- md += "#{command.output}\n"
25
- md += "```\n\n"
26
- md += "</td></tr></table>\n\n"
27
- #md += "output:\n"
28
- #md += "```shell\n"
29
- #md += "#{command.output}\n"
30
- #md += "```\n\n"
31
- end
32
- if command.error.length > 0
33
- md += "error:\n"
34
- md += "```shell\n"
35
- md += "#{command.error}\n"
36
- md += "```\n\n"
37
- end
38
- md += "| exit code | started at | duration | user | device | os | directory |\n"
39
- md += "| --- | --- | --- | --- | --- | --- | --- |\n"
40
- md += "| #{command.exit_code} | #{Makit::Humanize::get_protobuf_timestamp(command.started_at)} | #{Makit::Humanize::get_protobuf_duration(command.duration)} | #{command.user} | #{command.device} | #{command.os} | #{command.directory} |\n"
41
-
42
- #md += "| Name | Value |\n"
43
- #md += "| --- | --- |\n"
44
- #md += "| exit code | #{command.exit_code} |\n"
45
- #md += "| started at | #{Makit::Humanize::get_protobuf_timestamp(command.started_at)} |\n"
46
- #md += "| duration | #{Makit::Humanize::get_protobuf_duration(command.duration)} |\n"
47
- #md += "| user | #{command.user} |\n"
48
- #md += "| device | #{command.device} |\n"
49
- #md += "| os | #{command.os} |\n"
50
- #md += "| directory | #{command.directory} |\n"
51
- md += "</details>\n"
52
- md
53
- end
54
-
55
- def self.get_make_result_markdown(make_result)
56
- md = "# Make Result\n"
57
- # display allow of the fields of the MakeResult message
58
- md += "| Name | Value |\n"
59
- md += "| --- | --- |\n"
60
- md += "| repository | #{make_result.repository} |\n"
61
- md += "| commit | #{make_result.commit} |\n"
62
- md += "| branch | #{make_result.branch} |\n"
63
- md += "| tag | #{make_result.tag} |\n"
64
- md += "| device | #{make_result.device} |\n"
65
- md += "| runtime identifier | #{make_result.runtime_identifier} |\n"
66
- md += "| initial size | #{make_result.initial_size} |\n"
67
- md += "| final size | #{make_result.final_size} |\n"
68
- md += "\n"
69
- md += "## Commands\n"
70
- make_result.commands.each do |command|
71
- md += Makit::Markdown.get_command_markdown(command)
72
- end
73
- end
74
- end
75
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "humanize"
4
+
5
+ # This module provides classes for the Makit gem.
6
+ module Makit
7
+ class Markdown
8
+ def self.get_commands_markdown(commands)
9
+ summary = ""
10
+ commands.each do |command|
11
+ md = Makit::Markdown.get_command_markdown(command)
12
+ summary += md
13
+ end
14
+ summary
15
+ end
16
+
17
+ def self.get_command_markdown(command)
18
+ md = "<details>\n"
19
+ md += "<summary>#{Makit::Humanize::get_command_summary(command)}</summary>\n\n"
20
+
21
+ if command.output.length > 0
22
+ md += "<table><tr><th>output</th></tr><tr><td>\n\n" #<pre>\n"
23
+ md += "```shell\n"
24
+ md += "#{command.output}\n"
25
+ md += "```\n\n"
26
+ md += "</td></tr></table>\n\n"
27
+ #md += "output:\n"
28
+ #md += "```shell\n"
29
+ #md += "#{command.output}\n"
30
+ #md += "```\n\n"
31
+ end
32
+ if command.error.length > 0
33
+ md += "error:\n"
34
+ md += "```shell\n"
35
+ md += "#{command.error}\n"
36
+ md += "```\n\n"
37
+ end
38
+ md += "| exit code | started at | duration | user | device | os | directory |\n"
39
+ md += "| --- | --- | --- | --- | --- | --- | --- |\n"
40
+ md += "| #{command.exit_code} | #{Makit::Humanize::get_protobuf_timestamp(command.started_at)} | #{Makit::Humanize::get_protobuf_duration(command.duration)} | #{command.user} | #{command.device} | #{command.os} | #{command.directory} |\n"
41
+
42
+ #md += "| Name | Value |\n"
43
+ #md += "| --- | --- |\n"
44
+ #md += "| exit code | #{command.exit_code} |\n"
45
+ #md += "| started at | #{Makit::Humanize::get_protobuf_timestamp(command.started_at)} |\n"
46
+ #md += "| duration | #{Makit::Humanize::get_protobuf_duration(command.duration)} |\n"
47
+ #md += "| user | #{command.user} |\n"
48
+ #md += "| device | #{command.device} |\n"
49
+ #md += "| os | #{command.os} |\n"
50
+ #md += "| directory | #{command.directory} |\n"
51
+ md += "</details>\n"
52
+ md
53
+ end
54
+
55
+ def self.get_make_result_markdown(make_result)
56
+ md = "# Make Result\n"
57
+ # display allow of the fields of the MakeResult message
58
+ md += "| Name | Value |\n"
59
+ md += "| --- | --- |\n"
60
+ md += "| repository | #{make_result.repository} |\n"
61
+ md += "| commit | #{make_result.commit} |\n"
62
+ md += "| branch | #{make_result.branch} |\n"
63
+ md += "| tag | #{make_result.tag} |\n"
64
+ md += "| device | #{make_result.device} |\n"
65
+ md += "| runtime identifier | #{make_result.runtime_identifier} |\n"
66
+ md += "| initial size | #{make_result.initial_size} |\n"
67
+ md += "| final size | #{make_result.final_size} |\n"
68
+ md += "\n"
69
+ md += "## Commands\n"
70
+ make_result.commands.each do |command|
71
+ md += Makit::Markdown.get_command_markdown(command)
72
+ end
73
+ end
74
+ end
75
+ end
@@ -1,16 +1,16 @@
1
- # frozen_string_literal: true
2
- require "json"
3
- require "yaml"
4
-
5
- # monkey patch String class with a run method
6
-
7
- class BasicObject
8
- def to_json
9
- self.to_json
10
- end
11
-
12
- def to_pretty_json
13
- json = self.to_json
14
- ::JSON.pretty_generate(::JSON.parse(json))
15
- end
16
- end # class BasicObject
1
+ # frozen_string_literal: true
2
+ require "json"
3
+ require "yaml"
4
+
5
+ # monkey patch String class with a run method
6
+
7
+ class BasicObject
8
+ def to_json
9
+ self.to_json
10
+ end
11
+
12
+ def to_pretty_json
13
+ json = self.to_json
14
+ ::JSON.pretty_generate(::JSON.parse(json))
15
+ end
16
+ end # class BasicObject
@@ -1,13 +1,13 @@
1
- # frozen_string_literal: true
2
-
3
- module Makit
4
- module V1
5
- class Command
6
- def to_markdown
7
- md = "## " + self.name + " " + self.arguments.join(" ") + "\n\n"
8
- md += "```\n" + self.output + "\n```\n"
9
- md
10
- end
11
- end # class Command
12
- end # module V1
13
- end # module Makit
1
+ # frozen_string_literal: true
2
+
3
+ module Makit
4
+ module V1
5
+ class Command
6
+ def to_markdown
7
+ md = "## " + self.name + " " + self.arguments.join(" ") + "\n\n"
8
+ md += "```\n" + self.output + "\n```\n"
9
+ md
10
+ end
11
+ end # class Command
12
+ end # module V1
13
+ end # module Makit
@@ -1,16 +1,16 @@
1
- # frozen_string_literal: true
2
- require "digest"
3
-
4
- module Makit
5
- module V1
6
- #class CommandRequest
7
- # def to_hash
8
- # int_hash = Digest::SHA256.hexdigest("{self.name}.#{self.arguments.join(" ")}")
9
- # int_hash
10
- # end
11
- # def to_hash_string
12
- # hash_string = "#{int_hash}"
13
- # end
14
- # end
15
- end
16
- end # module Makit
1
+ # frozen_string_literal: true
2
+ require "digest"
3
+
4
+ module Makit
5
+ module V1
6
+ #class CommandRequest
7
+ # def to_hash
8
+ # int_hash = Digest::SHA256.hexdigest("{self.name}.#{self.arguments.join(" ")}")
9
+ # int_hash
10
+ # end
11
+ # def to_hash_string
12
+ # hash_string = "#{int_hash}"
13
+ # end
14
+ # end
15
+ end
16
+ end # module Makit
@@ -1,210 +1,210 @@
1
- # frozen_string_literal: true
2
- require "json"
3
- require "yaml"
4
-
5
- module Makit
6
- module V1
7
- class Project
8
- #def to_yaml
9
- # data = JSON.parse(self.to_pretty_json)
10
- # data.to_yaml.sub(/^---\n/, "")
11
- #end
12
-
13
- def self.create
14
- project = Makit::V1::Project.new
15
- project.set_default_values
16
- project
17
- end
18
-
19
- def open(filename)
20
- other = Makit::Serializer.open(filename, Makit::V1::Project)
21
- #other = Makit::V1::Project::create_from_file(filename)
22
- self.name = other.name
23
- self.git_remote_url = other.git_remote_url
24
- self.dotnet_projects = other.dotnet_projects
25
- self.artifacts = other.artifacts
26
- end
27
-
28
- #def self.create_from_file(filename)
29
- # extension = File.extname(filename)
30
- # case extension
31
- # when ".yml"
32
- # yaml = File.read(filename)
33
- # create_from_yaml(yaml)
34
- # when ".json"
35
- # json = File.read(filename)
36
- # create_from_json(json)
37
- # else
38
- # raise "unsupported file extension: #{extension}"
39
- # end
40
- #end
41
-
42
- #def self.create_from_yaml(yaml)
43
- # json = JSON.pretty_generate(YAML.load(yaml))
44
- # project = Makit::V1::Project.decode_json(json)
45
- # project
46
- #end
47
-
48
- #def self.create_from_json(json)
49
- # project = Makit::V1::Project.decode_json(json)
50
- # project
51
- #end
52
-
53
- def set_default_values
54
- #self.language = "csharp"
55
- #self.primary_artifact_type = "nuget"
56
- if self.git_remote_url.nil? || self.git_remote_url.empty?
57
- self.git_remote_url = `git remote get-url origin`.strip
58
- end
59
- if self.name.nil? || self.name.empty?
60
- if (!self.git_remote_url.nil? && !self.git_remote_url.empty?)
61
- self.name = get_name(File.basename(self.git_remote_url, ".git")) # get_capitalized_name(File.basename(self.git_remote_url, ".git"))
62
- else
63
- self.name = get_name(File.basename(Dir.getwd)) # get_capitalized_name(File.basename(Dir.getwd))
64
- end
65
- end
66
- self
67
- end
68
-
69
- def get_name(name)
70
- if !self.git_remote_url.nil? && !self.git_remote_url.empty?
71
- is_dotnet = self.git_remote_url.include?("nuget")
72
- if is_dotnet
73
- get_capitalized_name(name)
74
- end
75
- end
76
- name.downcase
77
- end
78
-
79
- def get_capitalized_name(name)
80
- name.split(".").map(&:capitalize).join(".")
81
- end
82
-
83
- def save_as(filename)
84
- Makit::Serializer.save_as(filename, self)
85
- #extension = File.extname(filename)
86
- #case extension
87
- #when ".json"
88
- # File.write(filename, self.to_pretty_json)
89
- #when ".yml"
90
- # File.write(filename, self.to_yaml)
91
- #else
92
- # raise "unsupported file extension: #{extension}"
93
- #end
94
- end
95
-
96
- def with_dotnet_project(template, name, output)
97
- if !self.dotnet_projects.any? { |project| project.output == output }
98
- project = Makit::V1::DotNetProject.new
99
- project.template = template
100
- project.name = name
101
- project.output = output
102
- self.dotnet_projects << project
103
- end
104
- end
105
-
106
- def setup
107
- setup_dotnet_projects
108
- end
109
-
110
- def make
111
- setup_dotnet_projects
112
- make_dotnet_projects
113
-
114
- # verify the artifacts exist
115
- self.artifacts.each do |artifact|
116
- raise "artifact does not exist: #{artifact}" if !File.exist?(artifact)
117
- end
118
- end
119
-
120
- def build
121
- build_dotnet_projects
122
- end
123
-
124
- def test
125
- test_dotnet_projects
126
- end
127
-
128
- def setup_dotnet_projects
129
- if self.dotnet_projects.any?
130
- if (!File.exist?("#{self.name}.sln"))
131
- puts " Creating solution file: " + "#{self.name}.sln".colorize(:green)
132
- "dotnet new sln -n #{self.name}".run unless File.exist?("#{self.name}.sln")
133
- else
134
- #puts " Solution file already exists: " + "#{self.name}.sln".colorize(:yellow)
135
- end
136
- self.dotnet_projects.each do |project|
137
- add_project = true
138
- if (project.os == "windows" && !Makit::Environment.is_windows?)
139
- add_project = false
140
- end
141
- if (add_project)
142
- Makit::DotNet.new_project(project.template, project.name, project.output)
143
- # add any nuget packages to the project
144
- project_filename = "#{project.output}/#{project.name}.csproj"
145
- project.packages.each { |package|
146
- Makit::DotNet::add_package(project_filename, package)
147
- }
148
- end
149
- end
150
- #Makit::DotNet.new_solution(self.name)
151
- Makit::DotNet.sln_add_projects(self.name)
152
- else
153
- #puts " no dotnet projects found".colorize(:yellow)
154
- end
155
- end
156
-
157
- def make_dotnet_projects
158
- self.dotnet_projects.each do |project|
159
- if (project.os == "windows" && !Makit::Environment.is_windows?)
160
- next
161
- else
162
- project.commands.each do |command|
163
- newest_file_timestamp = Makit::Directory::get_newest_file_timestamp(project.output)
164
- #newest_file = Makit::Directory::get_newest_file_or_now(project.output)
165
- command_request = Makit::RUNNER::parse_command_request(command)
166
- RUNNER.cache_run(command_request, newest_file_timestamp)
167
- end
168
- end
169
- end
170
- end
171
-
172
- def build_dotnet_projects
173
- self.dotnet_projects.each do |project|
174
- if (project.os == "windows" && !Makit::Environment.is_windows?)
175
- next
176
- else
177
- project.commands.each do |command|
178
- newest_file_timestamp = Makit::Directory::get_newest_file_timestamp(project.output)
179
- #newest_file = Makit::Directory::get_newest_file_or_now(project.output)
180
- command_request = Makit::RUNNER::parse_command_request(command)
181
- RUNNER.cache_run(command_request, newest_file_timestamp)
182
- end
183
- project.build_args.each do |build_arg|
184
- project_path = File.join(project.output, "#{project.name}.csproj")
185
- Makit::DotNet.build(project_path, build_arg.configuration, build_arg.output)
186
- end
187
- project.publish_args.each do |publish_arg|
188
- project_path = File.join(project.output, "#{project.name}.csproj")
189
- Makit::DotNet.publish(project_path, publish_arg.configuration, publish_arg.output)
190
- end
191
- end
192
- end
193
- end
194
-
195
- def test_dotnet_projects
196
- self.dotnet_projects.each do |project|
197
- if (project.os == "windows" && !Makit::Environment.is_windows?)
198
- next
199
- else
200
- project.test_args.each do |test_args|
201
- project_path = File.join(project.output, "#{project.name}.csproj")
202
- Makit::DotNet.test(project_path, test_args.configuration, test_args.output)
203
- end
204
- #"dotnet test #{project.output} --configuration Release".run
205
- end
206
- end
207
- end
208
- end # class Project
209
- end # module V1
210
- end # module Makit
1
+ # frozen_string_literal: true
2
+ require "json"
3
+ require "yaml"
4
+
5
+ module Makit
6
+ module V1
7
+ class Project
8
+ #def to_yaml
9
+ # data = JSON.parse(self.to_pretty_json)
10
+ # data.to_yaml.sub(/^---\n/, "")
11
+ #end
12
+
13
+ def self.create
14
+ project = Makit::V1::Project.new
15
+ project.set_default_values
16
+ project
17
+ end
18
+
19
+ def open(filename)
20
+ other = Makit::Serializer.open(filename, Makit::V1::Project)
21
+ #other = Makit::V1::Project::create_from_file(filename)
22
+ self.name = other.name
23
+ self.git_remote_url = other.git_remote_url
24
+ self.dotnet_projects = other.dotnet_projects
25
+ self.artifacts = other.artifacts
26
+ end
27
+
28
+ #def self.create_from_file(filename)
29
+ # extension = File.extname(filename)
30
+ # case extension
31
+ # when ".yml"
32
+ # yaml = File.read(filename)
33
+ # create_from_yaml(yaml)
34
+ # when ".json"
35
+ # json = File.read(filename)
36
+ # create_from_json(json)
37
+ # else
38
+ # raise "unsupported file extension: #{extension}"
39
+ # end
40
+ #end
41
+
42
+ #def self.create_from_yaml(yaml)
43
+ # json = JSON.pretty_generate(YAML.load(yaml))
44
+ # project = Makit::V1::Project.decode_json(json)
45
+ # project
46
+ #end
47
+
48
+ #def self.create_from_json(json)
49
+ # project = Makit::V1::Project.decode_json(json)
50
+ # project
51
+ #end
52
+
53
+ def set_default_values
54
+ #self.language = "csharp"
55
+ #self.primary_artifact_type = "nuget"
56
+ if self.git_remote_url.nil? || self.git_remote_url.empty?
57
+ self.git_remote_url = `git remote get-url origin`.strip
58
+ end
59
+ if self.name.nil? || self.name.empty?
60
+ if (!self.git_remote_url.nil? && !self.git_remote_url.empty?)
61
+ self.name = get_name(File.basename(self.git_remote_url, ".git")) # get_capitalized_name(File.basename(self.git_remote_url, ".git"))
62
+ else
63
+ self.name = get_name(File.basename(Dir.getwd)) # get_capitalized_name(File.basename(Dir.getwd))
64
+ end
65
+ end
66
+ self
67
+ end
68
+
69
+ def get_name(name)
70
+ if !self.git_remote_url.nil? && !self.git_remote_url.empty?
71
+ is_dotnet = self.git_remote_url.include?("nuget")
72
+ if is_dotnet
73
+ get_capitalized_name(name)
74
+ end
75
+ end
76
+ name.downcase
77
+ end
78
+
79
+ def get_capitalized_name(name)
80
+ name.split(".").map(&:capitalize).join(".")
81
+ end
82
+
83
+ def save_as(filename)
84
+ Makit::Serializer.save_as(filename, self)
85
+ #extension = File.extname(filename)
86
+ #case extension
87
+ #when ".json"
88
+ # File.write(filename, self.to_pretty_json)
89
+ #when ".yml"
90
+ # File.write(filename, self.to_yaml)
91
+ #else
92
+ # raise "unsupported file extension: #{extension}"
93
+ #end
94
+ end
95
+
96
+ def with_dotnet_project(template, name, output)
97
+ if !self.dotnet_projects.any? { |project| project.output == output }
98
+ project = Makit::V1::DotNetProject.new
99
+ project.template = template
100
+ project.name = name
101
+ project.output = output
102
+ self.dotnet_projects << project
103
+ end
104
+ end
105
+
106
+ def setup
107
+ setup_dotnet_projects
108
+ end
109
+
110
+ def make
111
+ setup_dotnet_projects
112
+ make_dotnet_projects
113
+
114
+ # verify the artifacts exist
115
+ self.artifacts.each do |artifact|
116
+ raise "artifact does not exist: #{artifact}" if !File.exist?(artifact)
117
+ end
118
+ end
119
+
120
+ def build
121
+ build_dotnet_projects
122
+ end
123
+
124
+ def test
125
+ test_dotnet_projects
126
+ end
127
+
128
+ def setup_dotnet_projects
129
+ if self.dotnet_projects.any?
130
+ if (!File.exist?("#{self.name}.sln"))
131
+ puts " Creating solution file: " + "#{self.name}.sln".colorize(:green)
132
+ "dotnet new sln -n #{self.name}".run unless File.exist?("#{self.name}.sln")
133
+ else
134
+ #puts " Solution file already exists: " + "#{self.name}.sln".colorize(:yellow)
135
+ end
136
+ self.dotnet_projects.each do |project|
137
+ add_project = true
138
+ if (project.os == "windows" && !Makit::Environment.is_windows?)
139
+ add_project = false
140
+ end
141
+ if (add_project)
142
+ Makit::DotNet.new_project(project.template, project.name, project.output)
143
+ # add any nuget packages to the project
144
+ project_filename = "#{project.output}/#{project.name}.csproj"
145
+ project.packages.each { |package|
146
+ Makit::DotNet::add_package(project_filename, package)
147
+ }
148
+ end
149
+ end
150
+ #Makit::DotNet.new_solution(self.name)
151
+ Makit::DotNet.sln_add_projects(self.name)
152
+ else
153
+ #puts " no dotnet projects found".colorize(:yellow)
154
+ end
155
+ end
156
+
157
+ def make_dotnet_projects
158
+ self.dotnet_projects.each do |project|
159
+ if (project.os == "windows" && !Makit::Environment.is_windows?)
160
+ next
161
+ else
162
+ project.commands.each do |command|
163
+ newest_file_timestamp = Makit::Directory::get_newest_file_timestamp(project.output)
164
+ #newest_file = Makit::Directory::get_newest_file_or_now(project.output)
165
+ command_request = Makit::RUNNER::parse_command_request(command)
166
+ RUNNER.cache_run(command_request, newest_file_timestamp)
167
+ end
168
+ end
169
+ end
170
+ end
171
+
172
+ def build_dotnet_projects
173
+ self.dotnet_projects.each do |project|
174
+ if (project.os == "windows" && !Makit::Environment.is_windows?)
175
+ next
176
+ else
177
+ project.commands.each do |command|
178
+ newest_file_timestamp = Makit::Directory::get_newest_file_timestamp(project.output)
179
+ #newest_file = Makit::Directory::get_newest_file_or_now(project.output)
180
+ command_request = Makit::RUNNER::parse_command_request(command)
181
+ RUNNER.cache_run(command_request, newest_file_timestamp)
182
+ end
183
+ project.build_args.each do |build_arg|
184
+ project_path = File.join(project.output, "#{project.name}.csproj")
185
+ Makit::DotNet.build(project_path, build_arg.configuration, build_arg.output)
186
+ end
187
+ project.publish_args.each do |publish_arg|
188
+ project_path = File.join(project.output, "#{project.name}.csproj")
189
+ Makit::DotNet.publish(project_path, publish_arg.configuration, publish_arg.output)
190
+ end
191
+ end
192
+ end
193
+ end
194
+
195
+ def test_dotnet_projects
196
+ self.dotnet_projects.each do |project|
197
+ if (project.os == "windows" && !Makit::Environment.is_windows?)
198
+ next
199
+ else
200
+ project.test_args.each do |test_args|
201
+ project_path = File.join(project.output, "#{project.name}.csproj")
202
+ Makit::DotNet.test(project_path, test_args.configuration, test_args.output)
203
+ end
204
+ #"dotnet test #{project.output} --configuration Release".run
205
+ end
206
+ end
207
+ end
208
+ end # class Project
209
+ end # module V1
210
+ end # module Makit