warbler
  1. warbler
  2. WARBLER-28

Compile ruby 1.9 code in 'compiled' mode

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      MacOSX / rvm / JRuby 1.6.7

      Description

      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

        Activity

        Hide
        mvbrocato added a comment -

        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

        Show
        mvbrocato added a comment - 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

          People

          • Assignee:
            Nick Sieger
            Reporter:
            Cyril
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: