-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
60 lines (48 loc) · 1.52 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
require "pathname"
@versions = {}
if File.file?("version") then
File.read("version").each_line do |line|
product,versionnumber = line.chomp.split(/=/)
@versions[product]=versionnumber
end
else
@versions["xts_version"]="1.0.0"
end
installdir = Pathname.new(__FILE__).join("..")
@xts_version = @versions['xts_version']
desc "Show rake description"
task :default do
puts
puts "Run 'rake -T' for a list of tasks."
puts
puts "1: Use 'rake build' to build the 'xts' binary. That should be\n the starting point."
puts
end
task :xtshelper do
sh "go build -ldflags \"-X main.version=#{@xts_version} -X main.basedir=#{installdir} \" -o bin/xtshelper github.com/speedata/xts/helper"
end
desc "Compile and install necessary software"
task :build do
sh "go build -ldflags \"-X github.com/speedata/xts/core.Version=#{@xts_version}\" -o bin/xts github.com/speedata/xts/xts"
end
desc "Create the schema files"
task :schema => [:xtshelper] do
sh "bin/xtshelper genschema"
end
desc "Update the version information from the latest git tag"
task :updateversion do
sh "git describe| sed s,v,xts_version=, > version"
end
desc "Run quality assurance"
task :qa do
sh "#{installdir}/bin/xts compare #{installdir}/qa"
end
desc "Clean QA intermediate files"
task :cleanqa do
FileUtils.rm Dir.glob("qa/**/pagediff-*.png")
FileUtils.rm Dir.glob("qa/**/reference-*.png")
FileUtils.rm Dir.glob("qa/**/source-*.png")
FileUtils.rm Dir.glob("qa/**/xts-aux.xml")
FileUtils.rm Dir.glob("qa/**/xts-protocol.xml")
FileUtils.rm Dir.glob("qa/**/xts.pdf")
end