lib/buildr4osgi/compile/external.rb in buildr4osgi-0.9.3 vs lib/buildr4osgi/compile/external.rb in buildr4osgi-0.9.4
- old
+ new
@@ -30,16 +30,18 @@
cmd_args << '-classpath' << dependencies.join(File::PATH_SEPARATOR) unless dependencies.empty?
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 += externalc_args
- cmd_args += files_from_sources(sources)
+ Tempfile.open("external") {|tmp|
+ tmp.write files_from_sources(sources).join(' ')
+ cmd_args << "@#{tmp.path}"
+ }
unless Buildr.application.options.dryrun
fail "ENV['EXTERNAL_COMPILER'] is not defined" if ENV['EXTERNAL_COMPILER'].nil?
- javac_path = "#{ENV['EXTERNAL_COMPILER']}#{File::SEPARATOR}bin#{File::SEPARATOR}java"
- ecj_path = File.expand_path(File.join(File.dirname(__FILE__), "ecj-#{Buildr4OSGi::CompilerSupport::OSGiC::CURRENT_JDT_COMPILER}.jar"))
- final_args = ([javac_path,"-classpath", ecj_path, "org.eclipse.jdt.internal.compiler.batch.Main"] + cmd_args).join(' ')
+ javac_path = File.join(ENV['EXTERNAL_COMPILER'], "bin", "javac")
+ final_args = cmd_args.insert(0, javac_path).push('2>&1').join(' ')
trace(final_args)
info %x[#{final_args}]
fail 'Failed to compile, see errors above' unless $?.success?
end
end
@@ -47,10 +49,10 @@
private
# See arg list here: http://publib.boulder.ibm.com/infocenter/rsahelp/v7r0m0/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm
def externalc_args #:nodoc:
args = []
- args << '-warn:none' unless options[:warnings]
+ args << '-nowarn' unless options[:warnings]
args << '-verbose' if Buildr.application.options.trace
args << '-g' if options[:debug]
args << '-deprecation' if options[:deprecation]
args << '-source' << options[:source].to_s if options[:source]
args << '-target' << options[:target].to_s if options[:target]
\ No newline at end of file