vendor/buildr/lib/buildr/scala/compiler.rb
# The scalac compiler jars are added to classpath at load time,
# if you want to customize artifact versions, you must set them on the
#
#      artifact_ns['Buildr::Compiler::Scalac'].library = '2.7.5'
#
# namespace before this file is required.  This is of course, only
# if SCALA_HOME is not set or invalid.
The scalac compiler jars are added to classpath at load time,
if you want to customize artifact versions, you must set them on the



namespace before this file is required.  This is of course, only
if SCALA_HOME is not set or invalid.
The scalac compiler jars are added to classpath at load time if you want to customize artifact versions you must set them on the namespace before this file is required . This is of course only if SCALA_HOME is not set or invalid .
def compile(sources, target, dependencies) 
      check_options(options, OPTIONS + (Scala.compatible_28? ? [:make] : []))
      java_sources = java_sources(sources)
      enable_dep_tracing = Scala.compatible_28? && java_sources.empty?
      dependencies.unshift target if enable_dep_tracing
      cmd_args = []
      cmd_args << '-classpath' << dependencies.join(File::PATH_SEPARATOR)
      source_paths = sources.select { |source| File.directory?(source) }
      cmd_args << '-sourcepath' << source_paths.join(File::PATH_SEPARATOR) unless source_paths.empty?
      cmd_args << '-d' << File.expand_path(target)
      cmd_args += scalac_args
      if enable_dep_tracing
        dep_dir = File.expand_path(target)
        Dir.mkdir dep_dir unless File.exists? dep_dir
        cmd_args << '-make:' + options[:make].to_s
        cmd_args << '-dependencyfile'
        cmd_args << File.expand_path('.scala-deps', dep_dir)
      end
      cmd_args += files_from_sources(sources)
      unless Buildr.application.options.dryrun
        trace((['scalac'] + cmd_args).join(' '))
        if Scalac.use_fsc
          system(([File.expand_path('bin/fsc', Scalac.scala_home)] + cmd_args).join(' ')) or
            fail 'Failed to compile, see errors above'
        else
          Java.load
          begin
            Java.scala.tools.nsc.Main.process(cmd_args.to_java(Java.java.lang.String))
          rescue => e
            fail "Scala compiler crashed:\n#{e.inspect}"
          end
          fail 'Failed to compile, see errors above' if Java.scala.tools.nsc.Main.reporter.hasErrors
        end
        unless java_sources.empty?
          trace 'Compiling mixed Java/Scala sources'
          deps = dependencies + Scalac.dependencies + [ File.expand_path(target) ]
          @java.compile(java_sources, target, deps)
        end
      end
    end
def compile ( sources , target , dependencies ) check_options ( options , OPTIONS + ( Scala . compatible_28? ? [ :make ] : [ ] ) ) java_sources = java_sources ( sources ) enable_dep_tracing = Scala . compatible_28? && java_sources . empty? dependencies . unshift target if enable_dep_tracing cmd_args = [ ] cmd_args << '-classpath' << dependencies . join ( File :: PATH_SEPARATOR ) source_paths = sources . select { | source | File . directory? ( source ) } cmd_args << '-sourcepath' << source_paths . join ( File :: PATH_SEPARATOR ) unless source_paths . empty? cmd_args << '-d' << File . expand_path ( target ) cmd_args += scalac_args if enable_dep_tracing dep_dir = File . expand_path ( target ) Dir . mkdir dep_dir unless File . exists? dep_dir cmd_args << '-make:' + options [ :make ] . to_s cmd_args << '-dependencyfile' cmd_args << File . expand_path ( '.scala-deps' , dep_dir ) end cmd_args += files_from_sources ( sources ) unless Buildr . application . options . dryrun trace ( ( [ 'scalac' ] + cmd_args ) . join ( ' ' ) ) if Scalac . use_fsc system ( ( [ File . expand_path ( 'bin/fsc' , Scalac . scala_home ) ] + cmd_args ) . join ( ' ' ) ) or fail 'Failed to compile, see errors above' else Java . load begin Java . scala . tools . nsc . Main . process ( cmd_args . to_java ( Java . java . lang . String ) ) rescue => e fail "Scala compiler crashed:\n#{e.inspect}" end fail 'Failed to compile, see errors above' if Java . scala . tools . nsc . Main . reporter . hasErrors end unless java_sources . empty? trace 'Compiling mixed Java/Scala sources' deps = dependencies + Scalac . dependencies + [ File . expand_path ( target ) ] @java . compile ( java_sources , target , deps ) end end end
The scalac compiler jars are added to classpath at load time,
if you want to customize artifact versions, you must set them on the
The scalac compiler jars are added to classpath at load time if you want to customize artifact versions you must set them on the
#:nodoc: # TODO  includes scala-compiler.jar
sources
target
dependencies