Avoid empty dependency issue in gwt addon if the attempting to gwt compile a project that has no src/main/java.
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/4aeb9a72 Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/4aeb9a72 Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/4aeb9a72 Branch: refs/heads/master Commit: 4aeb9a72d29b8ec811ac06e1b00482c069bf774d Parents: 6a8763a Author: Peter Donald <[email protected]> Authored: Sun Jan 18 11:26:09 2015 +1100 Committer: Peter Donald <[email protected]> Committed: Sun Jan 18 11:26:09 2015 +1100 ---------------------------------------------------------------------- CHANGELOG | 2 ++ addon/buildr/gwt.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/buildr/blob/4aeb9a72/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index 3a1af66..48f8b74 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ 1.4.22 (Pending) * Change: Update checkstyle to 6.1.1. Submitted by neher. +* Fixed: Avoid empty dependency issue in gwt addon if the attempting to gwt compile + a project that has no src/main/java. 1.4.21 (2014-11-28) * Change: Upgrade atoulme-Antwrap to 0.7.5 to remove deprecation warnings in http://git-wip-us.apache.org/repos/asf/buildr/blob/4aeb9a72/addon/buildr/gwt.rb ---------------------------------------------------------------------- diff --git a/addon/buildr/gwt.rb b/addon/buildr/gwt.rb index 5c50142..5a401cd 100644 --- a/addon/buildr/gwt.rb +++ b/addon/buildr/gwt.rb @@ -114,10 +114,10 @@ module Buildr def gwt(module_names, options = {}) output_key = options[:output_key] || project.id output_dir = project._(:target, :generated, :gwt, output_key) - artifacts = ([project.compile.target] + project.compile.sources + project.resources.sources).collect do |a| + artifacts = ([project.compile.target] + project.compile.sources + project.resources.sources).flatten.compact.collect do |a| a.is_a?(String) ? file(a) : a end - dependencies = options[:dependencies] ? artifacts(options[:dependencies]) : (project.compile.dependencies + [project.compile.target]).collect do |dep| + dependencies = options[:dependencies] ? artifacts(options[:dependencies]) : (project.compile.dependencies + [project.compile.target]).flatten.compact.collect do |dep| dep.is_a?(String) ? file(dep) : dep end
