Issue Details (XML | Word | Printable)

Key: WARBLER-28
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Nick Sieger
Reporter: Cyril
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
warbler

Compile ruby 1.9 code in 'compiled' mode

Created: 13/Apr/12 08:50 PM   Updated: 15/May/12 04:24 AM
Component/s: None
Affects Version/s: 1.3.0
Fix Version/s: None

Time Tracking:
Not Specified

Environment:

MacOSX / rvm / JRuby 1.6.7


Tags:


 Description  « Hide

In 'compiled' mode, source are compiled with ruby 1.8 compatibility mode (default).

With config.webxml.jruby.compat.version = "1.9" is set in warble.jar file, compilation stay in ruby 1.8 compatibility mode.

In this case, it seems better to force the 1.9 compatibility mode with this modification in jar.rb:

def run_javac(config, compiled_ruby_files)
ruby_compatibility = config.webxml.jruby.compat.version.nil? ? "-1.8" : "-"+config.webxml.jruby.compat.version
%x{java -classpath #{config.java_libs.join(File::PATH_SEPARATOR)} org.jruby.Main #{ruby_compatibility} -S jrubyc
\"#{compiled_ruby_files.join('" "')}\"}
end



mvbrocato added a comment - 15/May/12 04:24 AM

I think you forgot the "--" preceding the ruby version in your call to javac. So it would be:

def run_javac(config, compiled_ruby_files)
ruby_compatibility = config.webxml.jruby.compat.version.nil? ? "1.8" : ""+config.webxml.jruby.compat.version
%x{java -classpath #{config.java_libs.join(File::PATH_SEPARATOR)} org.jruby.Main --#{ruby_compatibility} -S jrubyc
\"#{compiled_ruby_files.join('" "')}\"}
end

I also posted a similar proposed fix in Github: https://github.com/jruby/warbler/issues/72