[ 
https://issues.apache.org/jira/browse/BUILDR-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jyri Kytömäki updated BUILDR-489:
---------------------------------

    Summary: Java + Scala joint compiler fails if  default encoding and source 
file encoding are not same and special characters have been used in source code 
 (was: Java + scalac joint compiler fails if  default encoding and source file 
encoding are not same and special characters have been used in source code)

> Java + Scala joint compiler fails if  default encoding and source file 
> encoding are not same and special characters have been used in source code
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BUILDR-489
>                 URL: https://issues.apache.org/jira/browse/BUILDR-489
>             Project: Buildr
>          Issue Type: Bug
>          Components: Compilers
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> java 1.6
> scala 2.8
>            Reporter: Jyri Kytömäki
>
> Scalac compiler does not pass options for javac.
> So if encoding option is set . For isntance:
> compile.options.other = %w{-encoding utf-8}
> That option is not passed to javac which failes if java source contains 
> 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
> --

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to