Skip to content

Commit e5d26f7

Browse files
committed
No-op compile for JRuby in Rakefile
1 parent c472feb commit e5d26f7

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

Rakefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@ Rake::TestTask.new(:test) do |t|
77
t.test_files = FileList["test/**/test_*.rb"]
88
end
99

10-
require 'rake/extensiontask'
11-
Rake::ExtensionTask.new("syslog_ext") do |ext|
12-
ext.ext_dir = 'ext/syslog'
10+
if RUBY_ENGINE == 'jruby'
11+
# nothing to compile for JRuby
12+
task :compile do end
13+
else
14+
require 'rake/extensiontask'
15+
Rake::ExtensionTask.new("syslog_ext") do |ext|
16+
ext.ext_dir = 'ext/syslog'
1317

14-
# In contrast to "gem install" a "rake compile" is expecting the C-ext file even on Windows.
15-
# Work around by creating a dummy so file.
16-
task "#{ext.tmp_dir}/#{ext.platform}/stage/lib" do |t|
17-
touch "#{ext.tmp_dir}/#{ext.platform}/#{ext.name}/#{RUBY_VERSION}/#{ext.name}.so"
18+
# In contrast to "gem install" a "rake compile" is expecting the C-ext file even on Windows.
19+
# Work around by creating a dummy so file.
20+
task "#{ext.tmp_dir}/#{ext.platform}/stage/lib" do |t|
21+
touch "#{ext.tmp_dir}/#{ext.platform}/#{ext.name}/#{RUBY_VERSION}/#{ext.name}.so"
22+
end
1823
end
1924
end
25+
2026
task :default => :test

0 commit comments

Comments
 (0)