-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
60 lines (48 loc) · 1.23 KB
/
Rakefile
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
58
59
60
# Automate serpapi C++ library
#
task :default => [:clean, :setup, :build, :run]
task :clean do
sh('rm -rf build/')
end
desc('initialize meson build')
task :setup do
sh('meson setup --wipe build')
end
desc('build library')
task :build => FileList['src/*.hpp', 'src/*.cpp'] do
sh('meson compile -C build')
sh('cd build && ninja')
end
desc('run test suite')
task :test do
sh('ninja -C build test')
end
task readme: ['README.md.erb'] do
`erb -T '-' README.md.erb > README.md`
end
desc('generate documentation')
task doc: [:readme]
desc('run examples under build/example')
task :example do
Dir.glob('build/example/*').each do |file|
sh(file)
end
end
desc('run oobt under build/oobt')
task :oobt do
sh('./build/oobt/oobt')
end
desc('release current library')
task :release do
puts("TODO implement release")
end
namespace :install do
desc('install dependency on debian AARCH64 and x86 [tested]')
task :linux do
sh('sudo apt update -y && sudo apt install -f -y build-essential meson pkg-config curl cmake meson ninja-build libcurl4-openssl-dev rapidjson-dev googletest')
end
desc('install dependency on Apple M1 aarch64 [tested]')
task :apple do
sh('brew install meson pkg-config curl cmake meson ninja rapidjson googletest')
end
end