makit 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/makit/command_runner.rb +2 -1
- data/lib/makit/directory.rb +6 -0
- data/lib/makit/dotnet.rb +1 -1
- data/lib/makit/mp/project_mp.rb +28 -1
- data/lib/makit/v1/makit.v1_pb.rb +1 -1
- data/lib/makit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf53edb505a1689db1bfe4743d6a2e59ba8922eb5f654f03145108508b1d8ce
|
4
|
+
data.tar.gz: 1d763150671938b48fa5eb90646f1a0cc36ee0f078da8b25379acf460b6e025b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7ed4c70f7b28b8925b5adf20ad3924c7f3c686316e79a2a7c23d22c522059d11b22a7aa1f32c89f7797e00704b34407701359cf037ed5f6fb1f1408d3083ca6
|
7
|
+
data.tar.gz: cc1306cf328f50e6014bca73bdf7b0fd7899e8ae7c7e6e5738aab19b5441750fba8f96545e63daefdbc8941dc3e2806a0741993264724de8ddc8ac4cc802e7e2
|
data/lib/makit/command_runner.rb
CHANGED
@@ -76,7 +76,7 @@ module Makit
|
|
76
76
|
puts " duration: #{command.duration.seconds} seconds\n"
|
77
77
|
puts Makit::Humanize::indent_string(command.output, 2) if command.output.length > 0
|
78
78
|
puts Makit::Humanize::indent_string(command.error, 2) if command.error.length > 0
|
79
|
-
exit 1 if
|
79
|
+
#exit 1 if command.exit_on_error
|
80
80
|
else
|
81
81
|
puts Makit::CommandRunner.get_command_summary(command) + " (#{command.duration.seconds} seconds)".colorize(:cyan)
|
82
82
|
puts Makit::Humanize::indent_string(command.output, 2).colorize(:default) if show_output_on_success
|
@@ -92,6 +92,7 @@ module Makit
|
|
92
92
|
|
93
93
|
log_to_artifacts(command) if @log_to_artifacts
|
94
94
|
show_command(command)
|
95
|
+
#exit 1 if exit_on_error & command.exit_code != 1
|
95
96
|
#if command.exit_code != 0
|
96
97
|
# puts Makit::CommandRunner.get_command_summary(command) + " (exit code #{command.exit_code})".colorize(:default)
|
97
98
|
# puts " directory: #{command.directory}\n"
|
data/lib/makit/directory.rb
CHANGED
@@ -101,6 +101,12 @@ module Makit
|
|
101
101
|
get_git_tracked_files(directory_path).select { |f| File.file?(f) }.max_by { |f| File.mtime(f) }
|
102
102
|
end
|
103
103
|
|
104
|
+
def self.get_newest_file_timestamp(directory_path)
|
105
|
+
newest_file = get_git_tracked_files(directory_path).select { |f| File.file?(f) }.max_by { |f| File.mtime(f) }
|
106
|
+
newest_file.nil? ? Time.now : File.mtime(newest_file)
|
107
|
+
end
|
108
|
+
|
109
|
+
|
104
110
|
# Normalize the path by removing any leading or trailing slashes
|
105
111
|
# and replacing any backslashes with forward slashes
|
106
112
|
def self.normalize(path)
|
data/lib/makit/dotnet.rb
CHANGED
@@ -89,7 +89,7 @@ module Makit
|
|
89
89
|
else
|
90
90
|
sln_path = "#{sln_name}.sln"
|
91
91
|
sln_content = File.read(sln_path)
|
92
|
-
Dir.glob("
|
92
|
+
Dir.glob("**/*.csproj").each do |project_path|
|
93
93
|
project_name = File.basename(project_path, ".csproj")
|
94
94
|
if (sln_content.include?("\"#{project_name}\""))
|
95
95
|
puts " #{project_name}".colorize(:green) + " is in ".colorize(:grey) + "#{sln_path}".colorize(:green)
|
data/lib/makit/mp/project_mp.rb
CHANGED
@@ -104,6 +104,11 @@ module Makit
|
|
104
104
|
setup_dotnet_projects
|
105
105
|
end
|
106
106
|
|
107
|
+
def make
|
108
|
+
setup_dotnet_projects
|
109
|
+
make_dotnet_projects
|
110
|
+
end
|
111
|
+
|
107
112
|
def build
|
108
113
|
build_dotnet_projects
|
109
114
|
end
|
@@ -134,18 +139,40 @@ module Makit
|
|
134
139
|
}
|
135
140
|
end
|
136
141
|
end
|
137
|
-
Makit::DotNet.new_solution(self.name)
|
142
|
+
#Makit::DotNet.new_solution(self.name)
|
138
143
|
Makit::DotNet.sln_add_projects(self.name)
|
139
144
|
else
|
140
145
|
puts " no dotnet projects found".colorize(:yellow)
|
141
146
|
end
|
142
147
|
end
|
143
148
|
|
149
|
+
def make_dotnet_projects
|
150
|
+
self.dotnet_projects.each do |project|
|
151
|
+
if (project.os == "windows" && !Makit::Environment.is_windows?)
|
152
|
+
next
|
153
|
+
else
|
154
|
+
project.commands.each do |command|
|
155
|
+
newest_file_timestamp = Makit::Directory::get_newest_file_timestamp(project.output)
|
156
|
+
#newest_file = Makit::Directory::get_newest_file_or_now(project.output)
|
157
|
+
command_request = Makit::RUNNER::parse_command_request(command)
|
158
|
+
RUNNER.cache_run(command_request, newest_file_timestamp)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
144
164
|
def build_dotnet_projects
|
145
165
|
self.dotnet_projects.each do |project|
|
146
166
|
if (project.os == "windows" && !Makit::Environment.is_windows?)
|
147
167
|
next
|
148
168
|
else
|
169
|
+
project.commands.each do |command|
|
170
|
+
newest_file_timestamp = Makit::Directory::get_newest_file_timestamp(project.output)
|
171
|
+
#newest_file = Makit::Directory::get_newest_file_or_now(project.output)
|
172
|
+
command_request = Makit::RUNNER::parse_command_request(command)
|
173
|
+
RUNNER.cache_run(command_request, newest_file_timestamp)
|
174
|
+
|
175
|
+
end
|
149
176
|
project.build_args.each do |build_arg|
|
150
177
|
project_path = File.join(project.output, "#{project.name}.csproj")
|
151
178
|
Makit::DotNet.build(project_path, build_arg.configuration, build_arg.output)
|
data/lib/makit/v1/makit.v1_pb.rb
CHANGED
@@ -8,7 +8,7 @@ require 'google/protobuf/timestamp_pb'
|
|
8
8
|
require 'google/protobuf/duration_pb'
|
9
9
|
|
10
10
|
|
11
|
-
descriptor_data = "\n\x1blib/makit/v1/makit.v1.proto\x12\x08makit.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\"\
|
11
|
+
descriptor_data = "\n\x1blib/makit/v1/makit.v1.proto\x12\x08makit.v1\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\"\xfe\x01\n\rDotNetProject\x12\x10\n\x08template\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06output\x18\x03 \x01(\t\x12\x10\n\x08packages\x18\x04 \x03(\t\x12\n\n\x02os\x18\x05 \x01(\t\x12\x10\n\x08\x63ommands\x18\x06 \x03(\t\x12-\n\nbuild_args\x18\x07 \x03(\x0b\x32\x19.makit.v1.DotNetBuildArgs\x12\x31\n\x0cpublish_args\x18\x08 \x03(\x0b\x32\x1b.makit.v1.DotNetPublishArgs\x12+\n\ttest_args\x18\t \x03(\x0b\x32\x18.makit.v1.DotNetTestArgs\"8\n\x0f\x44otNetBuildArgs\x12\x15\n\rconfiguration\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\":\n\x11\x44otNetPublishArgs\x12\x15\n\rconfiguration\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\"7\n\x0e\x44otNetTestArgs\x12\x15\n\rconfiguration\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\"\x95\x01\n\x07Project\x12\x16\n\x0egit_remote_url\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x32\n\x10\x63ommand_requests\x18\x03 \x03(\x0b\x32\x18.makit.v1.CommandRequest\x12\x30\n\x0f\x64otnet_projects\x18\x04 \x03(\x0b\x32\x17.makit.v1.DotNetProject\"\xa5\x01\n\x0e\x43ommandRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\targuments\x18\x02 \x03(\t\x12+\n\x07timeout\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x11\n\tdirectory\x18\x04 \x01(\t\x12\x0c\n\x04task\x18\x05 \x01(\t\x12\r\n\x05input\x18\x06 \x01(\x0c\x12\x15\n\rexit_on_error\x18\x07 \x01(\x08\"\x91\x02\n\x07\x43ommand\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\targuments\x18\x03 \x03(\t\x12\x11\n\texit_code\x18\x04 \x01(\x05\x12\r\n\x05input\x18\x05 \x01(\x0c\x12\x0e\n\x06output\x18\x06 \x01(\x0c\x12\r\n\x05\x65rror\x18\x07 \x01(\x0c\x12.\n\nstarted_at\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x08\x64uration\x18\t \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04user\x18\n \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x0b \x01(\t\x12\n\n\x02os\x18\x0c \x01(\t\x12\x11\n\tdirectory\x18\r \x01(\t\"I\n\rConfiguration\x12\x0c\n\x04name\x18\x01 \x01(\t\x12*\n\x08\x63ommands\x18\x02 \x03(\x0b\x32\x18.makit.v1.CommandRequest\"3\n\rGitRepository\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x15\n\rrelative_path\x18\x02 \x01(\t\"h\n\x0bGitLogEntry\x12\x0e\n\x06\x63ommit\x18\x01 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x02 \x01(\t\x12(\n\x04\x64\x61te\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07message\x18\x04 \x01(\t\"\xc8\x01\n\nMakeResult\x12\x12\n\nrepository\x18\x01 \x01(\t\x12\x0e\n\x06\x63ommit\x18\x02 \x01(\t\x12\x0e\n\x06\x62ranch\x18\x03 \x01(\t\x12\x0b\n\x03tag\x18\x04 \x01(\t\x12\x0e\n\x06\x64\x65vice\x18\x05 \x01(\t\x12\x1a\n\x12runtime_identifier\x18\x06 \x01(\t\x12#\n\x08\x63ommands\x18\x07 \x03(\x0b\x32\x11.makit.v1.Command\x12\x14\n\x0cinitial_size\x18\x08 \x01(\x05\x12\x12\n\nfinal_size\x18\t \x01(\x05\"?\n\rDotNetNewArgs\x12\x10\n\x08template\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06output\x18\x03 \x01(\t**\n\x08Language\x12\x08\n\x04RUBY\x10\x00\x12\n\n\x06\x43SHARP\x10\x01\x12\x08\n\x04RUST\x10\x02*,\n\x0bPackageType\x12\x07\n\x03GEM\x10\x00\x12\t\n\x05NUGET\x10\x01\x12\t\n\x05\x43RATE\x10\x03\x32H\n\x0e\x43ommandService\x12\x36\n\x07\x45xecute\x12\x18.makit.v1.CommandRequest\x1a\x11.makit.v1.Commandb\x06proto3"
|
12
12
|
|
13
13
|
pool = Google::Protobuf::DescriptorPool.generated_pool
|
14
14
|
pool.add_serialized_file(descriptor_data)
|
data/lib/makit/version.rb
CHANGED