Permalink
Browse files

Refactored clean task and added a default task.

  • Loading branch information...
1 parent 820497d commit e1bdc79e8f3e8df3ea17aa5e193b23fdeda184c3 @djberg96 committed Dec 9, 2010
Showing with 12 additions and 32 deletions.
  1. +12 −32 Rakefile
View
@@ -4,19 +4,16 @@ require 'rake/testtask'
require 'rbconfig'
include Config
-desc "Cleans up the C related files created during the build"
-task :clean do
- Dir.chdir('ext') do
- if File.exists?('daemon.o') || File.exists?('daemon.so')
- sh 'nmake distclean'
- end
- File.delete('win32/daemon.so') if File.exists?('win32/daemon.so')
- end
- Dir['*.gem'].each{ |f| File.delete(f) }
- File.delete('lib/win32/daemon.so') if File.exists?('lib/win32/daemon.so')
-end
-
-desc "Builds, but does not install, the win32-service library"
+CLEAN.include(
+ '**/*.gem', # Gem files
+ '**/*.rbc', # Rubinius
+ '**/*.o', # C object file
+ '**/*.log', # Ruby extension build log
+ '**/Makefile', # C Makefile
+ "**/*.so" # C shared object
+)
+
+desc "Build the win32-service library"
task :build => [:clean] do
Dir.chdir('ext') do
ruby 'extconf.rb'
@@ -25,25 +22,6 @@ task :build => [:clean] do
end
end
-desc "Install the win32-service library (non-gem)"
-task :install => [:build] do
- Dir.chdir('ext') do
- sh 'nmake install'
- end
- install_dir = File.join(CONFIG['sitelibdir'], 'win32')
- Dir.mkdir(install_dir) unless File.exists?(install_dir)
- FileUtils.cp('lib/win32/service.rb', install_dir, :verbose => true)
-end
-
-desc 'Uninstall the win32-service library (non-gem)'
-task :uninstall do
- service = File.join(CONFIG['sitelibdir'], 'win32', 'service.rb')
- FileUtils.rm(service, :verbose => true) if File.exists?(service)
-
- daemon = File.join(CONFIG['sitearchdir'], 'win32', 'daemon.so')
- FileUtils.rm(daemon, :verbose => true) if File.exists?(daemon)
-end
-
namespace 'gem' do
desc 'Build the gem'
task :create => [:clean] do
@@ -137,3 +115,5 @@ namespace 'test' do
Rake.application[:clean].execute
end
end
+
+task :default => 'test:all'

0 comments on commit e1bdc79

Please sign in to comment.