Changeset 699
- Timestamp:
- 06/16/08 04:56:37 (5 months ago)
- Files:
-
- branches/raggi/docs (added)
- branches/raggi/docs/ChangeLog (moved) (moved from branches/raggi/ChangeLog)
- branches/raggi/docs/COPYING (moved) (moved from branches/raggi/COPYING)
- branches/raggi/docs/DEFERRABLES (moved) (moved from branches/raggi/DEFERRABLES)
- branches/raggi/docs/EPOLL (moved) (moved from branches/raggi/EPOLL)
- branches/raggi/docs/GNU (moved) (moved from branches/raggi/GNU)
- branches/raggi/docs/INSTALL (moved) (moved from branches/raggi/INSTALL)
- branches/raggi/docs/KEYBOARD (moved) (moved from branches/raggi/KEYBOARD)
- branches/raggi/docs/LEGAL (moved) (moved from branches/raggi/LEGAL)
- branches/raggi/docs/LIGHTWEIGHT_CONCURRENCY (moved) (moved from branches/raggi/LIGHTWEIGHT_CONCURRENCY)
- branches/raggi/docs/PURE_RUBY (moved) (moved from branches/raggi/PURE_RUBY)
- branches/raggi/docs/README (moved) (moved from branches/raggi/README)
- branches/raggi/docs/RELEASE_NOTES (moved) (moved from branches/raggi/RELEASE_NOTES)
- branches/raggi/docs/SMTP (moved) (moved from branches/raggi/SMTP)
- branches/raggi/docs/SPAWNED_PROCESSES (moved) (moved from branches/raggi/SPAWNED_PROCESSES)
- branches/raggi/docs/TODO (moved) (moved from branches/raggi/TODO)
- branches/raggi/.gitignore (added)
- branches/raggi/Rakefile (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/raggi/Rakefile
r694 r699 12 12 # $Id$ 13 13 #++ 14 15 ###Â OLD RAKE: ### 16 # # The tasks and external gemspecs we used to generate binary gems are now 17 # # obsolete. Use Patrick Hurley's gembuilder to build binary gems for any 18 # # desired platform. 19 # # To build a binary gem on Win32, ensure that the include and lib paths 20 # # both contain the proper references to OPENSSL. Use the static version 21 # # of the libraries, not the dynamic, otherwise we expose the user to a 22 # # runtime dependency. 23 # 24 # # To build a binary gem for win32, first build rubyeventmachine.so 25 # # using VC6 outside of the build tree (the normal way: ruby extconf.rb, 26 # # and then nmake). Then copy rubyeventmachine.so into the lib directory, 27 # # and run rake gemwin32. 28 # 29 14 30 require 'rubygems' unless defined?(Gem) 15 31 require 'rake' unless defined?(Rake) … … 17 33 18 34 Package = true # Build zips and tarballs? 35 Dir.glob('tasks/*.rake').each { |r| Rake.application.add_import r } 36 37 #Â e.g. rake EM_JAVA=true for forcing java build tasks as defaults! 38 Java = ENV['EM_JAVA'] || RUBY_PLATFORM =~ /java/ 39 40 # The default task is invoked by rubygems during install, change with caution. 41 desc "Build suitable for run & gem install." 42 task :default => [:build] 43 44 desc "Build extension and place in lib" 45 task :build => (Java ? 'java:build' : 'ext:build') do |t| 46 Dir.glob('{ext,java/src}/*.{so,bundle,dll,jar}').each do |f| 47 mv f, "lib" 48 end 49 end 50 51 # Basic clean definition, this is enhanced by imports aswell. 52 task :clean do 53 chdir 'ext' do 54 sh 'make clean' if test ?e, 'Makefile' 55 end 56 Dir.glob('**/Makefile').each { |file| rm file } 57 Dir.glob('**/*.{o,so,bundle,class,jar,dll,log}').each { |file| rm file } 58 end 19 59 20 60 Spec = Gem::Specification.new do |s| … … 24 64 25 65 s.has_rdoc = true 26 s.rdoc_options = %w(--title EventMachine --main README --line-numbers) 27 s.extra_rdoc_files = %w( 28 README RELEASE_NOTES TODO 29 LIGHTWEIGHT_CONCURRENCY SPAWNED_PROCESSES DEFERRABLES 30 PURE_RUBY EPOLL KEYBOARD SMTP 31 COPYING GNU LEGAL 32 ) 66 s.rdoc_options = %w(--title EventMachine --main docs/README --line-numbers) 67 s.extra_rdoc_files = Dir['docs/*'] 33 68 34 s.files = %w(Rakefile) + Dir .glob("{bin,tests,lib,ext,tasks}/**/*")69 s.files = %w(Rakefile) + Dir["{bin,tests,lib,ext,java,tasks}/**/*"] 35 70 36 71 s.require_path = 'lib' 37 72 38 73 s.test_file = "tests/testem.rb" 39 s.extensions = " ext/extconf.rb"74 s.extensions = "Rakefile" 40 75 41 76 s.author = "Francis Cianfrocca" … … 61 96 require 'lib/eventmachine_version' 62 97 s.version = EventMachine::VERSION 63 # s.requirements << 'Java' # TODO64 98 end 65 99 66 Dir.glob('tasks/*.rake').each { |r| Rake.application.add_import r } 100 namespace :ext do 101 desc "Build C++ extension" 102 task :build => [:clean, :make] 103 104 desc "make extension" 105 task :make => [:makefile] do 106 chdir 'ext' do 107 sh 'make' 108 end 109 end 67 110 68 desc "Compile the extension." 69 task :build do |t| 70 mkdir "nonversioned" unless File.directory?("nonversioned") 71 chdir("nonversioned") do 72 system "ruby ../ext/extconf.rb" 73 system "make clean" 74 system "make" 75 Dir.glob('*.{so,bundle,dll,jar}').each do |f| 76 cp f, "../lib" 111 desc 'Compile the makefile' 112 task :makefile do |t| 113 chdir 'ext' do 114 ruby 'extconf.rb' 77 115 end 78 116 end 79 117 end 80 81 # Basic clean definition, this is enhanced by imports aswell. 82 task :clean do 83 Dir.glob('lib/*.{so,bundle,jar,dll}').each { |file| rm file } 84 rm_rf 'nonversioned' 85 Dir.glob('java/**/*.{class,jar}').each { |file| rm file } 86 end 87 88 ###Â OLD RAKE: ### 89 # # The tasks and external gemspecs we used to generate binary gems are now 90 # # obsolete. Use Patrick Hurley's gembuilder to build binary gems for any 91 # # desired platform. 92 # # To build a binary gem on Win32, ensure that the include and lib paths 93 # # both contain the proper references to OPENSSL. Use the static version 94 # # of the libraries, not the dynamic, otherwise we expose the user to a 95 # # runtime dependency. 96 # 97 # =begin 98 # # To build a binary gem for win32, first build rubyeventmachine.so 99 # # using VC6 outside of the build tree (the normal way: ruby extconf.rb, 100 # # and then nmake). Then copy rubyeventmachine.so into the lib directory, 101 # # and run rake gemwin32. 102 # =end 103 # 104 105 106 JSpec = Spec.dup 107 JSpec.name = 'eventmachine-java' 108 JSpec.extensions = nil 109 JSpec.files << 'lib/em_reactor.jar' 110 111 Rake::GemPackageTask.new(JSpec) do end 112 desc "Build the EventMachine RubyGem for JRuby" 113 task :jgem => [:clean, :jar, "pkg/eventmachine-java-#{JSpec.version}.gem"] 114 115 namespace :jgem do 116 desc "Build and install the jruby gem" 117 task :install => :jgem do 118 sudo "gem inst pkg/#{JSpec.name}*.gem" 118 119 namespace :java do 120 # This task creates the JRuby JAR file and leaves it in the lib directory. 121 # This step is required before executing the jgem task. 122 desc "Build java extension" 123 task :build => [:jar] do |t| 124 chdir('java/src') do 125 mv 'em_reactor.jar', '../../lib/em_reactor.jar' 126 end 127 end 128 129 desc "compile .java to .class" 130 task :compile do 131 chdir('java/src') do 132 sh 'javac com/rubyeventmachine/*.java' 133 end 134 end 135 136 desc "compile .classes to .jar" 137 task :jar => [:compile] do 138 chdir('java/src') do 139 sh "jar -cf em_reactor.jar com/rubyeventmachine/*.class" 140 end 119 141 end 120 142 end 121 122 123 # This task creates the JRuby JAR file and leaves it in the lib directory.124 # This step is required before executing the jgem task.125 desc "Compile the JAR"126 task :jar do |t|127 chdir('java/src') do128 sh 'javac com/rubyeventmachine/*.java'129 sh "jar -cf em_reactor.jar com/rubyeventmachine/*.class"130 mv 'em_reactor.jar', '../../lib/em_reactor.jar'131 end132 end133 134 # The idea for using Rakefile instead of extconf: task :default => [RUBY_PLATFORM == 'java' ? :jar : :extension]
