forked from hound-search/hound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
36 lines (29 loc) · 812 Bytes
/
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
require 'fileutils'
GOPATH=File.open('.gaan').map do |x|
File.absolute_path(File.join(File.dirname(__FILE__), x.strip))
end.join(':')
ENV.update({
'GOPATH' => GOPATH
})
file 'bin/hound' => FileList['src/hound/**/*', 'src/ansi/**/*'] do
host = ENV['HOST'] || 'localhost:6080'
args = ['go', 'build', '-o', 'bin/hound', '-ldflags', "-X main.defaultHost #{host}"] + FileList['src/hound/cmds/hound/*.go']
sh *args
end
file 'bin/houndd' => FileList['src/hound/**/*'] do
sh 'go', 'build', '-o', 'bin/houndd', 'src/hound/cmds/houndd/main.go'
end
task :default => [
'bin/houndd',
'bin/hound',
]
task :clean do
FileUtils::rm_rf('bin')
end
task :test do
pkgs = FileList['src/**/*_test.go'].map do |x|
File.dirname(x[4,x.length])
end.uniq
args = ['go', 'test'].concat(pkgs)
sh *args
end