-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile
47 lines (38 loc) · 1.06 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
require 'rake/gempackagetask'
GEM_NAME = "testrunner"
GEM_VERSION = "0.2.0"
### GEM ###################################################
spec = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = GEM_VERSION
s.author = "Kevin russ"
s.email = "[email protected]"
s.platform = Gem::Platform::RUBY
s.summary = "Run cppunit-tests within a workspace"
s.files = FileList["{bin,lib,docs}/**/*"].exclude("rdoc").to_a
s.require_path = "lib"
s.has_rdoc = false
s.extra_rdoc_files = ["README"]
s.executables = [GEM_NAME]
end
Rake::GemPackageTask.new(spec) {|pkg|}
desc "Test the gem"
task :test do
run_cmd("ruby tests/ts_main.rb")
end
desc "Install the gem"
task :install => [:test, :gem] do
run_cmd("gem install pkg/#{spec.name}-#{spec.version}.gem")
end
desc "Uninstall the gem"
task :uninstall do
run_cmd("gem uninstall #{spec.name}")
end
### TOOLS #################################################
def run_cmd(cmd)
if !system(cmd) then
puts "unable to run: "+cmd
exit(-1)
end
end
###########################################################