Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 130 lines (112 sloc) 3.128 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/testtask'
2a78639 @mark-moseley rake-compiler updates
mark-moseley authored
4 require 'rake/extensiontask'
5
6 Rake::ExtensionTask.new('ruby_debug')
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
7
8 SO_NAME = "ruby_debug.so"
9
10 COMMON_FILES = FileList[
11 'AUTHORS',
12 'CHANGES',
13 'LICENSE',
14 'README',
15 'Rakefile',
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
16 ]
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
17
df78a71 @cldwalker runtime code should be in lib :cry:, close #4
authored
18 CLI_TEST_FILE_LIST = FileList['test/lib/commands/unit/*.rb',
19 'test/lib/commands/*_test.rb',
20 'test/lib/**/*_test.rb']
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
21 # disabled until requires fixed and tests pass
22 # 'test/test-*.rb']
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
23 CLI_FILES = COMMON_FILES + FileList[
df78a71 @cldwalker runtime code should be in lib :cry:, close #4
authored
24 "lib/**/*",
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
25 'ChangeLog',
26 'bin/*',
27 'doc/rdebug.1',
28 'test/**/data/*.cmd',
29 'test/**/data/*.right',
30 'test/**/*.rb',
31 'rdbg.rb',
32 CLI_TEST_FILE_LIST
33 ]
34
35 BASE_TEST_FILE_LIST = %w(
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
36 test/base/base.rb
37 test/base/binding.rb
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
38 test/base/catchpoint.rb)
39 BASE_FILES = COMMON_FILES + FileList[
4c7e0fe @mark-moseley path fix for rake-compiler
mark-moseley authored
40 'ext/ruby_debug/breakpoint.c',
41 'ext/ruby_debug/extconf.rb',
42 'ext/ruby_debug/ruby_debug.c',
43 'ext/ruby_debug/ruby_debug.h',
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
44 'ext/win32/*',
45 'lib/**/*',
46 BASE_TEST_FILE_LIST,
47 ]
48
49 desc "Test everything."
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
50 task :test => :test_base do
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
51 Rake::TestTask.new(:test) do |t|
4af2c90 @mark-moseley test fixes
mark-moseley authored
52 t.libs << './ext'
53 t.libs << './lib'
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
54 t.test_files = CLI_TEST_FILE_LIST
55 t.verbose = true
56 end
57 end
58
59 desc "Test ruby-debug-base."
587f19c @cldwalker enable rake test for travis but disable broken test/test-*.rb
authored
60 task :test_base => :lib do
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
61 Rake::TestTask.new(:test_base) do |t|
4af2c90 @mark-moseley test fixes
mark-moseley authored
62 t.libs << './ext'
63 t.libs << './lib'
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
64 t.test_files = FileList[BASE_TEST_FILE_LIST]
65 t.verbose = true
66 end
67 end
68
69 desc "Test everything - same as test."
70 task :check => :test
71
72 desc "Create the core ruby-debug shared library extension"
73 task :lib do
74 Dir.chdir("ext") do
75 system("#{Gem.ruby} extconf.rb && make")
76 end
77 end
78
79 desc "Compile Emacs code"
80 task :emacs => "emacs/rdebug.elc"
81 file "emacs/rdebug.elc" => ["emacs/elisp-comp", "emacs/rdebug.el"] do
82 Dir.chdir("emacs") do
83 system("./elisp-comp ./rdebug.el")
84 end
85 end
86
2355924 @cldwalker remove unused rake tasks + gemspecs
authored
87 base_spec = eval(File.read('debugger.gemspec'), binding, 'debugger.gemspec')
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
88 # Rake task to build the default package
110f47d @cldwalker update rake/gem_package_task to rubygems/package_task
authored
89 Gem::PackageTask.new(base_spec) do |pkg|
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
90 pkg.need_tar = true
91 end
92
93 # Windows specification
94 win_spec = base_spec.clone
95 win_spec.extensions = []
96 ## win_spec.platform = Gem::Platform::WIN32 # deprecated
97 win_spec.platform = 'mswin32'
98 win_spec.files += ["lib/#{SO_NAME}"]
99
100 desc "Create Windows Gem"
101 task :win32_gem do
102 # Copy the win32 extension the top level directory
103 current_dir = File.expand_path(File.dirname(__FILE__))
104 source = File.join(current_dir, "ext", "win32", SO_NAME)
105 target = File.join(current_dir, "lib", SO_NAME)
106 cp(source, target)
107
108 # Create the gem, then move it to pkg.
109 Gem::Builder.new(win_spec).build
110 gem_file = "#{win_spec.name}-#{win_spec.version}-#{win_spec.platform}.gem"
111 mv(gem_file, "pkg/#{gem_file}")
112
113 # Remove win extension from top level directory.
114 rm(target)
115 end
116
117 desc "Remove built files"
118 task :clean do
119 cd "ext" do
120 if File.exists?("Makefile")
121 sh "make clean"
122 rm "Makefile"
123 end
124 derived_files = Dir.glob(".o") + Dir.glob("*.so")
125 rm derived_files unless derived_files.empty?
126 end
127 end
128
2355924 @cldwalker remove unused rake tasks + gemspecs
authored
129 task :default => :test
Something went wrong with that request. Please try again.