Changeset 148
- Timestamp:
- 06/04/2007 23:57:42 (18 months ago)
- Files:
-
- 1 modified
-
trunk/Rakefile (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Rakefile
r133 r148 12 12 PKG = "#{NAME}-#{VERS}" 13 13 BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}" 14 CLEAN.include ["ext/hpricot_scan/#{BIN}", "lib/#{BIN}", 'ext/hpricot_scan/Makefile', 14 ARCHLIB = "lib/#{::Config::CONFIG['arch']}" 15 CLEAN.include ["ext/hpricot_scan/#{BIN}", "lib/**/#{BIN}", 'ext/hpricot_scan/Makefile', 15 16 '**/.*.sw?', '*.gem', '.config'] 16 17 RDOC_OPTS = ['--quiet', '--title', 'The Hpricot Reference', '--main', 'README', '--inline-source'] … … 33 34 s.homepage = 'http://code.whytheluckystiff.net/hpricot/' 34 35 s.files = PKG_FILES 35 s.require_path = "lib"36 s.require_paths = [ARCHLIB, "lib"] 36 37 s.extensions = FileList["ext/**/extconf.rb"].to_a 37 38 s.bindir = "bin" … … 49 50 desc "Run all the tests" 50 51 Rake::TestTask.new do |t| 51 t.libs << "test" 52 t.libs << "test" << ARCHLIB 52 53 t.test_files = FileList['test/test_*.rb'] 53 54 t.verbose = true … … 84 85 desc "Compiles the Ruby extension" 85 86 task :compile => [:hpricot_scan] do 86 if Dir.glob(File.join( "lib","hpricot_scan.*")).length == 087 if Dir.glob(File.join(ARCHLIB,"hpricot_scan.*")).length == 0 87 88 STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" 88 89 STDERR.puts "Gem actually failed to build. Your system is" … … 105 106 sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') 106 107 end 107 cp ext_so, "lib" 108 mkdir_p ARCHLIB 109 cp ext_so, ARCHLIB 108 110 end 109 111 … … 127 129 Win32Spec = SPEC.dup 128 130 Win32Spec.platform = Gem::Platform::WIN32 129 Win32Spec.files = PKG_FILES + [ 'lib/hpricot_scan.so']131 Win32Spec.files = PKG_FILES + ["#{ARCHLIB}/hpricot_scan.so"] 130 132 Win32Spec.extensions = [] 131 133 … … 142 144 cp "extras/mingw-rbconfig.rb", "#{WIN32_PKG_DIR}/ext/hpricot_scan/rbconfig.rb" 143 145 sh "cd #{WIN32_PKG_DIR}/ext/hpricot_scan/ && ruby -I. extconf.rb && make" 144 mv "#{WIN32_PKG_DIR}/ext/hpricot_scan/hpricot_scan.so", "#{WIN32_PKG_DIR}/ lib"146 mv "#{WIN32_PKG_DIR}/ext/hpricot_scan/hpricot_scan.so", "#{WIN32_PKG_DIR}/#{ARCHLIB}" 145 147 end 146 148 … … 171 173 JRubySpec = SPEC.dup 172 174 JRubySpec.platform = 'jruby' 173 JRubySpec.files = PKG_FILES + [ 'lib/hpricot_scan.jar']175 JRubySpec.files = PKG_FILES + ["#{ARCHLIB}/hpricot_scan.jar"] 174 176 JRubySpec.extensions = [] 175 177 … … 185 187 file "hpricot_scan_jruby" => [JRUBY_PKG_DIR] do 186 188 Dir.chdir("#{JRUBY_PKG_DIR}/ext/hpricot_scan", &compile_java) 187 mv "#{JRUBY_PKG_DIR}/ext/hpricot_scan/hpricot_scan.jar", "#{JRUBY_PKG_DIR}/ lib"189 mv "#{JRUBY_PKG_DIR}/ext/hpricot_scan/hpricot_scan.jar", "#{JRUBY_PKG_DIR}/#{ARCHLIB}" 188 190 end 189 191
