Rakefile in libyajl2-0.0.4 vs Rakefile in libyajl2-0.1.0
- old
+ new
@@ -3,10 +3,11 @@
require 'rubygems'
require 'rake'
require 'rubygems/package_task'
require 'rspec/core/rake_task'
+require 'rake/extensiontask'
GEM_NAME = "libyajl2"
gemspec = eval(File.read('libyajl2.gemspec'))
@@ -16,33 +17,38 @@
#
# build tasks
#
-desc "repackage and install #{GEM_NAME}-#{Libyajl2::VERSION}.gem"
-task :install => :repackage do
- sh %{gem install pkg/#{GEM_NAME}-#{Libyajl2::VERSION}.gem --no-rdoc --no-ri}
-end
+#desc "repackage and install #{GEM_NAME}-#{Libyajl2::VERSION}.gem"
+#task :install => :repackage do
+# sh %{gem install pkg/#{GEM_NAME}-#{Libyajl2::VERSION}.gem --no-rdoc --no-ri}
+#end
+#
+#desc "uninstall #{GEM_NAME}-#{Libyajl2::VERSION}.gem"
+#task :uninstall do
+# sh %{gem uninstall #{GEM_NAME} -x -v #{Libyajl2::VERSION} }
+#end
+#
+#desc "compile native gem"
+#task :compile do
+# cd "ext/libyajl2"
+# ruby "extconf.rb"
+#end
+#
+#desc "clean the git repo"
+#task :clean do
+# sh "git clean -fdx"
+# cd "ext/libyajl2/vendor/yajl"
+# sh "git clean -fdx"
+#end
-desc "uninstall #{GEM_NAME}-#{Libyajl2::VERSION}.gem"
-task :uninstall do
- sh %{gem uninstall #{GEM_NAME} -x -v #{Libyajl2::VERSION} }
+Rake::ExtensionTask.new('libyajl', gemspec) do |ext|
+ ext.lib_dir = 'lib/libyajl2/vendored-libyajl2/lib'
+ ext.ext_dir = 'ext/libyajl2'
end
-desc "compile native gem"
-task :compile do
- cd "ext/libyajl2"
- ruby "extconf.rb"
-end
-
-desc "clean the git repo"
-task :clean do
- sh "git clean -fdx"
- cd "ext/libyajl2/vendor/yajl"
- sh "git clean -fdx"
-end
-
# FIXME: need a rake task to update the git submodule and need to do that before shipping
desc "Build it and ship it"
task :ship => [:clean, :gem] do
sh("git tag #{Libyajl2::VERSION}")
sh("git push --tags")
@@ -136,11 +142,11 @@
desc 'Run all style checks'
task :style => ['style:rubocop', 'style:reek']
desc 'Run style + spec tests by default on travis'
-task :travis => ['style', 'spec']
+task :travis => ['compile', 'spec', 'style']
desc 'Run style, spec and test kichen on travis'
-task :travis_all => ['style', 'spec', 'integration:cloud']
+task :travis_all => ['compile', 'spec', 'integration:cloud', 'style']
-task :default => ['style', 'spec', 'integration:vagrant']
+task :default => ['compile', 'spec', 'integration:vagrant', 'style']