Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 266 lines (225 sloc) 7.608 kB
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
1 # -*- Ruby -*-
110f47d @cldwalker update rake/gem_package_task to rubygems/package_task
authored
2 require 'rubygems/package_task'
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
3 require 'rake/rdoctask'
4 require 'rake/testtask'
2a78639 @mark-moseley rake-compiler updates
mark-moseley authored
5 require 'rake/extensiontask'
6
7 Rake::ExtensionTask.new('ruby_debug')
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
8
9 SO_NAME = "ruby_debug.so"
10
11 # ------- Default Package ----------
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
12 RUBY_DEBUG_VERSION = open("ext/ruby_debug/ruby_debug.c") do |f|
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
13 f.grep(/^#define DEBUG_VERSION/).first[/"(.+)"/,1]
14 end
15
7c13ece @mark-moseley "ensure" block fixes for catching uncaught exceptions
mark-moseley authored
16 RUBY_DEBUG_TEENY = ".0"
17 RUBY_DEBUG_BASE_TEENY = ".0"
18
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
19 COMMON_FILES = FileList[
20 'AUTHORS',
21 'CHANGES',
22 'LICENSE',
23 'README',
24 'Rakefile',
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
25 ]
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
26
27 CLI_TEST_FILE_LIST = FileList['test/cli/commands/unit/*.rb',
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
28 'test/cli/commands/*_test.rb',
29 'test/cli/**/*_test.rb']
30 # disabled until requires fixed and tests pass
31 # 'test/test-*.rb']
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
32 CLI_FILES = COMMON_FILES + FileList[
33 "cli/**/*",
34 'ChangeLog',
35 'bin/*',
36 'doc/rdebug.1',
37 'test/**/data/*.cmd',
38 'test/**/data/*.right',
39 'test/**/*.rb',
40 'rdbg.rb',
41 CLI_TEST_FILE_LIST
42 ]
43
44 BASE_TEST_FILE_LIST = %w(
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
45 test/base/base.rb
46 test/base/binding.rb
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
47 test/base/catchpoint.rb)
48 BASE_FILES = COMMON_FILES + FileList[
4c7e0fe @mark-moseley path fix for rake-compiler
mark-moseley authored
49 'ext/ruby_debug/breakpoint.c',
50 'ext/ruby_debug/extconf.rb',
51 'ext/ruby_debug/ruby_debug.c',
52 'ext/ruby_debug/ruby_debug.h',
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
53 'ext/win32/*',
54 'lib/**/*',
55 BASE_TEST_FILE_LIST,
56 ]
57
58 desc "Test everything."
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
59 task :test => :test_base do
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
60 Rake::TestTask.new(:test) do |t|
4af2c90 @mark-moseley test fixes
mark-moseley authored
61 t.libs << './ext'
62 t.libs << './lib'
63 t.libs << './cli'
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
64 t.test_files = CLI_TEST_FILE_LIST
65 t.verbose = true
66 end
67 end
68
69 desc "Test ruby-debug-base."
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
70 task :test_base => :lib do
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
71 Rake::TestTask.new(:test_base) do |t|
4af2c90 @mark-moseley test fixes
mark-moseley authored
72 t.libs << './ext'
73 t.libs << './lib'
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
74 t.test_files = FileList[BASE_TEST_FILE_LIST]
75 t.verbose = true
76 end
77 end
78
79 desc "Test everything - same as test."
80 task :check => :test
81
82 desc "Create the core ruby-debug shared library extension"
83 task :lib do
84 Dir.chdir("ext") do
85 system("#{Gem.ruby} extconf.rb && make")
86 end
87 end
88
89 desc "Compile Emacs code"
90 task :emacs => "emacs/rdebug.elc"
91 file "emacs/rdebug.elc" => ["emacs/elisp-comp", "emacs/rdebug.el"] do
92 Dir.chdir("emacs") do
93 system("./elisp-comp ./rdebug.el")
94 end
95 end
96
97 desc "Create a GNU-style ChangeLog via svn2cl"
98 task :ChangeLog do
99 system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk")
100 system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/ext -o ext/ChangeLog")
101 system("svn2cl --authors=svn2cl_usermap svn://rubyforge.org/var/svn/ruby-debug/trunk/lib -o lib/ChangeLog")
102 end
103
104 # Base GEM Specification
105 base_spec = Gem::Specification.new do |spec|
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
106 spec.name = "ruby-debug-base19"
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
107
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
108 spec.homepage = "http://rubyforge.org/projects/ruby-debug19/"
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
109 spec.summary = "Fast Ruby debugger - core component"
110 spec.description = <<-EOF
7c13ece @mark-moseley "ensure" block fixes for catching uncaught exceptions
mark-moseley authored
111 ruby-debug-base19 is a fast implementation of the standard Ruby debugger debug.rb.
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
112 It is implemented by utilizing a new Ruby C API hook. The core component
113 provides support that front-ends can build on. It provides breakpoint
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
114 handling, bindings for stack frames among other things.
115 EOF
116
7c13ece @mark-moseley "ensure" block fixes for catching uncaught exceptions
mark-moseley authored
117 spec.version = RUBY_DEBUG_VERSION + RUBY_DEBUG_BASE_TEENY
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
118
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
119 spec.authors = ["Kent Sibilev", "Mark Moseley"]
120 spec.email = "mark@fast-software.com"
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
121 spec.platform = Gem::Platform::RUBY
122 spec.require_path = "lib"
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
123 spec.extensions = ["ext/ruby_debug/extconf.rb"]
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
124 spec.files = BASE_FILES.to_a
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
125
126 spec.required_ruby_version = '>= 1.8.2'
127 spec.date = Time.now
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
128 spec.rubyforge_project = 'ruby-debug19'
129 spec.add_dependency('ruby_core_source', '>= 0.1.4')
130 spec.add_dependency('linecache19', '>= 0.5.11')
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
131
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
132 spec.test_files = FileList[BASE_TEST_FILE_LIST]
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
133
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
134 # rdoc
135 spec.has_rdoc = true
4c7e0fe @mark-moseley path fix for rake-compiler
mark-moseley authored
136 spec.extra_rdoc_files = ['README', 'ext/ruby_debug/ruby_debug.c']
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
137 end
138
139 cli_spec = Gem::Specification.new do |spec|
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
140 spec.name = "ruby-debug19"
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
141
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
142 spec.homepage = "http://rubyforge.org/projects/ruby-debug19/"
7c13ece @mark-moseley "ensure" block fixes for catching uncaught exceptions
mark-moseley authored
143 spec.summary = "Command line interface (CLI) for ruby-debug-base19"
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
144 spec.description = <<-EOF
145 A generic command line interface for ruby-debug.
146 EOF
147
7c13ece @mark-moseley "ensure" block fixes for catching uncaught exceptions
mark-moseley authored
148 spec.version = RUBY_DEBUG_VERSION + RUBY_DEBUG_TEENY
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
149
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
150 spec.authors = ["Kent Sibilev", "Mark Moseley"]
151 spec.email = "mark@fast-software.com"
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
152 spec.platform = Gem::Platform::RUBY
153 spec.require_path = "cli"
154 spec.bindir = "bin"
155 spec.executables = ["rdebug"]
156 spec.files = CLI_FILES.to_a
157
158 spec.required_ruby_version = '>= 1.8.2'
159 spec.date = Time.now
160 spec.rubyforge_project = 'ruby-debug'
a4f236c @mark-moseley re-incorporated ruby-debug-cli files
mark-moseley authored
161 spec.add_dependency('columnize', '>= 0.3.1')
162 spec.add_dependency('linecache19', '>= 0.5.11')
163 spec.add_dependency('ruby-debug-base19', '>= 0.12.0')
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
164
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
165 # FIXME: work out operational logistics for this
166 # spec.test_files = FileList[CLI_TEST_FILE_LIST]
167
168 # rdoc
169 spec.has_rdoc = true
170 spec.extra_rdoc_files = ['README']
171 end
172
173 # Rake task to build the default package
110f47d @cldwalker update rake/gem_package_task to rubygems/package_task
authored
174 Gem::PackageTask.new(base_spec) do |pkg|
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
175 pkg.need_tar = true
176 end
110f47d @cldwalker update rake/gem_package_task to rubygems/package_task
authored
177 Gem::PackageTask.new(cli_spec) do |pkg|
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
178 pkg.need_tar = true
179 end
180
181 task :default => [:package]
182
183 # Windows specification
184 win_spec = base_spec.clone
185 win_spec.extensions = []
186 ## win_spec.platform = Gem::Platform::WIN32 # deprecated
187 win_spec.platform = 'mswin32'
188 win_spec.files += ["lib/#{SO_NAME}"]
189
190 desc "Create Windows Gem"
191 task :win32_gem do
192 # Copy the win32 extension the top level directory
193 current_dir = File.expand_path(File.dirname(__FILE__))
194 source = File.join(current_dir, "ext", "win32", SO_NAME)
195 target = File.join(current_dir, "lib", SO_NAME)
196 cp(source, target)
197
198 # Create the gem, then move it to pkg.
199 Gem::Builder.new(win_spec).build
200 gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
201 mv(gem_file, "pkg/#{gem_file}")
202
203 # Remove win extension from top level directory.
204 rm(target)
205 end
206
207 desc "Publish ruby-debug to RubyForge."
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
208 task :publish do
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
209 require 'rake/contrib/sshpublisher'
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
210
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
211 # Get ruby-debug path.
212 ruby_debug_path = File.expand_path(File.dirname(__FILE__))
213
214 Rake::SshDirPublisher.new("kent@rubyforge.org",
215 "/var/www/gforge-projects/ruby-debug", ruby_debug_path)
216 end
217
218 desc "Remove built files"
219 task :clean do
220 cd "ext" do
221 if File.exists?("Makefile")
222 sh "make clean"
223 rm "Makefile"
224 end
225 derived_files = Dir.glob(".o") + Dir.glob("*.so")
226 rm derived_files unless derived_files.empty?
227 end
228 end
229
230 # --------- RDoc Documentation ------
231 desc "Generate rdoc documentation"
232 Rake::RDocTask.new("rdoc") do |rdoc|
233 rdoc.rdoc_dir = 'doc/rdoc'
234 rdoc.title = "ruby-debug"
235 # Show source inline with line numbers
236 rdoc.options << "--inline-source" << "--line-numbers"
237 # Make the readme file the start page for the generated html
238 rdoc.options << '--main' << 'README'
239 rdoc.rdoc_files.include('bin/**/*',
240 'cli/ruby-debug/commands/*.rb',
241 'lib/**/*.rb',
242 'ext/**/ruby_debug.c',
243 'README',
244 'LICENSE')
245 end
246
247 desc "Publish the release files to RubyForge."
248 task :rubyforge_upload do
249 `rubyforge login`
250 release_command = "rubyforge add_release #{PKG_NAME} #{PKG_NAME} '#{PKG_NAME}-#{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem"
251 puts release_command
252 system(release_command)
253 end
254
255 PKG_NAME = 'ruby-debug'
256 desc "Publish the release files to RubyForge."
257 task :rubyforge_upload do
258 `rubyforge login`
259 for pkg_name in ['ruby-debug', 'ruby-debug-base'] do
260 pkg_file_name = "#{pkg_name}-#{pkg_version}"
261 release_command = "rubyforge add_release ruby-debug #{pkg_name} '#{pkg_file_name}' pkg/#{pkg_file_name}.gem"
262 puts release_command
263 system(release_command)
264 end
265 end
Something went wrong with that request. Please try again.