Uploaded image for project: 'Buildr (Retired)'
  1. Buildr (Retired)
  2. BUILDR-489

Java + Scala joint compiler fails if default encoding and source file encoding are not same and special characters have been used in source code

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.1
    • 1.5
    • Compilers
    • None
    • Windows XP
      Java 1.6
      Scala 2.8
      JRuby 1.4.0

    Description

      Scalac compiler does not pass options for javac.
      So if encoding option is set :

      compile.options.other = %w{-encoding utf-8}

      That option is not passed to javac which fails if some java source files contain special characters.

      I fixed the issue in our environment like this:

      — a/project/vendor/jruby-1.4.0/lib/ruby/gems/1.8/gems/buildr-1.4.1-java/lib/buildr/scala/compiler.rb
      +++ b/project/vendor/jruby-1.4.0/lib/ruby/gems/1.8/gems/buildr-1.4.1-java/lib/buildr/scala/compiler.rb
      @@ -152,12 +152,13 @@ module Buildr::Scala

      def initialize(project, options) #:nodoc:
      super
      + # use common options also for javac
      + options[:javac] ||= { :warnings => options[:warnings], :debug => options[:debug], :deprecation => options[:deprecation], :source => options[:source], :target => options[:target], :other => options[:other] }
      options[:debug] = Buildr.options.debug if options[:debug].nil?
      options[:warnings] = verbose if options[:warnings].nil?
      options[:deprecation] ||= false
      options[:optimise] ||= false
      options[:make] ||= :transitivenocp if Scala.compatible_28?

      • options[:javac] ||= {}

      @java = Javac.new(project, options[:javac])
      end

      Attachments

        Issue Links

          Activity

            People

              toulmean Antoine Toulme
              jkytomak Jyri Kytömäki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: