-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
60 lines (48 loc) · 1.58 KB
/
Rakefile
File metadata and controls
60 lines (48 loc) · 1.58 KB
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"
# Get version from git tag (e.g., "v1.0.0" or "v1.0.0-3-g1a2b3c4")
def git_version
version = `git describe --tags --always --match 'v*' 2>/dev/null`.strip
version.empty? ? "dev" : version.sub(/^v/, "")
end
INSTALDIR = Pathname.new(__dir__).freeze
@xts_version = git_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=#{INSTALDIR} \" -o bin/xtshelper github.com/speedata/xts/helper"
end
desc "Create markdown reference"
task :doc => [:xtshelper] do
sh "bin/xtshelper doc"
end
desc "Build the 'xts' binary"
task :build do
sh "go build -ldflags \"-s -w -X github.com/speedata/xts/core.Version=#{@xts_version}\" -o bin/xts github.com/speedata/xts/xts"
end
desc "Install 'xts' into $GOBIN"
task :install do
sh "go install -ldflags \"-s -w -X github.com/speedata/xts/core.Version=#{@xts_version}\" github.com/speedata/xts/xts"
end
desc "Create the schema files"
task :schema => [:xtshelper] do
sh "bin/xtshelper genschema"
end
desc "Run quality assurance"
task :qa do
sh "xts compare #{INSTALDIR}/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