forked from moonpolysoft/eventedcache
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Cliff Moon
committed
Jan 11, 2009
1 parent
c0f8aae
commit cf82df9
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
RUBY_1_9 = RUBY_VERSION =~ /^1\.9/ | ||
WIN = (RUBY_PLATFORM =~ /mswin|cygwin/) | ||
SUDO = (WIN ? "" : "sudo") | ||
|
||
require 'rake' | ||
require 'rake/clean' | ||
|
||
Dir['tasks/**/*.rake'].each { |rake| load rake } | ||
|
||
task :default => :spec | ||
|
||
ext_task :memcache_protocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
CLEAN.include %w(**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log} ext/Makefile ext/conftest.dSYM) | ||
|
||
def ext_task(name) | ||
ext_dir = "ext" | ||
ext_bundle = "#{ext_dir}/#{name}.#{Config::CONFIG['DLEXT']}" | ||
ext_files = FileList[ | ||
"#{ext_dir}/*.c", | ||
"#{ext_dir}/*.h", | ||
"#{ext_dir}/*.rl", | ||
"#{ext_dir}/extconf.rb", | ||
"#{ext_dir}/Makefile", | ||
"lib" | ||
] | ||
|
||
task "compile:#{name}" => ["#{ext_dir}/Makefile", ext_bundle] | ||
task :compile => "compile:#{name}" | ||
|
||
file "#{ext_dir}/Makefile" => ["#{ext_dir}/extconf.rb"] do | ||
cd(ext_dir) { ruby "extconf.rb" } | ||
end | ||
# | ||
file ext_bundle => ext_files do | ||
cd ext_dir do | ||
sh(WIN ? 'nmake' : 'make') | ||
end | ||
# cp ext_bundle, 'lib/' | ||
end | ||
end | ||
|
||
desc "Compile the Ragel state machines" | ||
task :ragel do | ||
Dir.chdir 'ext' do | ||
target = "protocol.c" | ||
File.unlink target if File.exist? target | ||
sh "ragel -C protocol.rl > #{target}" | ||
raise "Failed to compile Ragel state machine" unless File.exist? target | ||
end | ||
end | ||
|
||
desc "Compile the extensions" | ||
task :compile | ||
task :package => :compile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'spec/rake/spectask' | ||
|
||
Spec::Rake::SpecTask.new do |t| | ||
t.spec_files = FileList['spec/**/*_spec.rb'] | ||
end | ||
|
||
task :spec => [:compile] |