Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ task :check_env do
end

desc "Testing library (pure ruby)"
task :test_pure => [ :clean, :check_env, :do_test_pure ]
task :test_pure => [ :set_env_pure, :check_env, :do_test_pure ]
task(:set_env_pure) { ENV['JSON'] = 'pure' }

UndocumentedTestTask.new do |t|
t.name = 'do_test_pure'
Expand All @@ -187,10 +188,7 @@ UndocumentedTestTask.new do |t|
end

desc "Testing library (pure ruby and extension)"
task :test do
sh "env JSON=pure #{BUNDLE} exec rake test_pure" or exit 1
sh "env JSON=ext #{BUNDLE} exec rake test_ext" or exit 1
end
task :test => [ :test_pure, :test_ext ]

namespace :gems do
desc 'Install all development gems'
Expand Down Expand Up @@ -238,7 +236,7 @@ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
classpath = (Dir['java/lib/*.jar'] << 'java/src' << JRUBY_JAR) * ':'
obj = src.sub(/\.java\Z/, '.class')
file obj => src do
sh 'javac', '-classpath', classpath, '-source', '1.5', '-target', '1.5', src
sh 'javac', '-classpath', classpath, '-source', '1.6', '-target', '1.6', src
end
JAVA_CLASSES << obj
end
Expand All @@ -257,7 +255,8 @@ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
end

desc "Testing library (jruby)"
task :test_ext => [ :check_env, :create_jar, :do_test_ext ]
task :test_ext => [ :set_env_ext, :create_jar, :check_env, :do_test_ext ]
task(:set_env_ext) { ENV['JSON'] = 'ext' }

UndocumentedTestTask.new do |t|
t.name = 'do_test_ext'
Expand Down