You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by "Antoine Toulme (JIRA)" <ji...@apache.org> on 2016/05/20 07:16:12 UTC
[jira] [Assigned] (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
[ https://issues.apache.org/jira/browse/BUILDR-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Antoine Toulme reassigned BUILDR-489:
-------------------------------------
Assignee: Antoine Toulme
> 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
> JRuby 1.4.0
> Reporter: Jyri Kytömäki
> Assignee: Antoine Toulme
> Fix For: 1.5
>
>
> 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
> --
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)