Permalink
Newer
100644
139 lines (119 sloc)
3.28 KB
18
COMMON_FILES = FileList[
19
'AUTHORS',
20
'CHANGES',
21
'LICENSE',
22
'README',
23
'Rakefile',
27
'test/cli/commands/*_test.rb',
28
'test/cli/**/*_test.rb']
29
# disabled until requires fixed and tests pass
30
# 'test/test-*.rb']
31
CLI_FILES = COMMON_FILES + FileList[
32
"cli/**/*",
33
'ChangeLog',
34
'bin/*',
35
'doc/rdebug.1',
36
'test/**/data/*.cmd',
37
'test/**/data/*.right',
38
'test/**/*.rb',
39
'rdbg.rb',
40
CLI_TEST_FILE_LIST
41
]
42
43
BASE_TEST_FILE_LIST = %w(
48
'ext/ruby_debug/breakpoint.c',
49
'ext/ruby_debug/extconf.rb',
50
'ext/ruby_debug/ruby_debug.c',
51
'ext/ruby_debug/ruby_debug.h',
52
'ext/win32/*',
53
'lib/**/*',
54
BASE_TEST_FILE_LIST,
55
]
56
57
desc "Test everything."
63
t.test_files = CLI_TEST_FILE_LIST
64
t.verbose = true
65
end
66
end
67
68
desc "Test ruby-debug-base."
73
t.test_files = FileList[BASE_TEST_FILE_LIST]
74
t.verbose = true
75
end
76
end
77
78
desc "Test everything - same as test."
79
task :check => :test
80
81
desc "Create the core ruby-debug shared library extension"
82
task :lib do
83
Dir.chdir("ext") do
84
system("#{Gem.ruby} extconf.rb && make")
85
end
86
end
87
88
desc "Compile Emacs code"
89
task :emacs => "emacs/rdebug.elc"
90
file "emacs/rdebug.elc" => ["emacs/elisp-comp", "emacs/rdebug.el"] do
91
Dir.chdir("emacs") do
92
system("./elisp-comp ./rdebug.el")
93
end
94
end
95
99
pkg.need_tar = true
100
end
101
102
# Windows specification
103
win_spec = base_spec.clone
104
win_spec.extensions = []
105
## win_spec.platform = Gem::Platform::WIN32 # deprecated
106
win_spec.platform = 'mswin32'
107
win_spec.files += ["lib/#{SO_NAME}"]
108
109
desc "Create Windows Gem"
110
task :win32_gem do
111
# Copy the win32 extension the top level directory
112
current_dir = File.expand_path(File.dirname(__FILE__))
113
source = File.join(current_dir, "ext", "win32", SO_NAME)
114
target = File.join(current_dir, "lib", SO_NAME)
115
cp(source, target)
116
117
# Create the gem, then move it to pkg.
118
Gem::Builder.new(win_spec).build
119
gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
120
mv(gem_file, "pkg/#{gem_file}")
121
122
# Remove win extension from top level directory.
123
rm(target)
124
end
125
126
desc "Remove built files"
127
task :clean do
128
cd "ext" do
129
if File.exists?("Makefile")
130
sh "make clean"
131
rm "Makefile"
132
end
133
derived_files = Dir.glob(".o") + Dir.glob("*.so")
134
rm derived_files unless derived_files.empty?
135
end
136
end
137