-
Notifications
You must be signed in to change notification settings - Fork 0
/
sam.cr
57 lines (46 loc) · 1.4 KB
/
sam.cr
1
2
3
4
5
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
require "sam"
require "file_utils"
# desc "Build the library"
# task "build" do
# system `crystal build src/main.cr -o bin/main --release`
# end
ENV["LIBRARY_PATH"] ||= Path[__DIR__, "hermes-protocol", "target", "release"].normalize.to_s
namespace "test" do
desc "Run the roundtrip test suite"
task "roundtrip" do
ENV["RUST_LOG"] ||= "debug"
system "crystal spec spec/roundtrips_spec.cr --error-trace -d"
end
desc "Run the mqtt test suite"
task "mqtt" do
ENV["RUST_LOG"] ||= "debug"
system "crystal spec spec/mqtt_spec.cr --error-trace -d"
end
desc "Run the mqtt tls test suite"
task "mqtt_tls" do
ENV["RUST_LOG"] ||= "debug"
system "crystal spec spec/mqtt_tls_spec.cr --error-trace -d"
end
end
desc "Run all test suites"
task "test", ["test:roundtrip", "test:mqtt", "test:mqtt_tls"] do
end
namespace "generate" do
desc "Generate documentation files"
task "docs" do
system "rm -Rf ./docs && crystal docs"
end
desc "Generate bindings from a c header file"
task "bindings" do |_, args|
ENV["LLVM_CONFIG"] ||= args[0]?.try &.as(String) || "/usr/local/Cellar/llvm@8/8.0.1/bin/llvm-config"
system "crystal lib/crystal_lib/src/main.cr -- gen/libsnips_hermes.cr"
end
end
desc "Format code"
task "format" do
system `crystal tool format`
end
desc "Format code, test and generate documentation."
task "start", ["format", "test", "generate:docs"] do
end
Sam.help