You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2012/09/25 23:51:09 UTC
svn commit: r1390177 - in /buildr/trunk/lib/buildr/core: application.rb
generate.rb
Author: donaldp
Date: Tue Sep 25 21:51:09 2012
New Revision: 1390177
URL: http://svn.apache.org/viewvc?rev=1390177&view=rev
Log:
BUILDR-652 - Improve the handling of the CLI options
Modified:
buildr/trunk/lib/buildr/core/application.rb
buildr/trunk/lib/buildr/core/generate.rb
Modified: buildr/trunk/lib/buildr/core/application.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/application.rb?rev=1390177&r1=1390176&r2=1390177&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/application.rb (original)
+++ buildr/trunk/lib/buildr/core/application.rb Tue Sep 25 21:51:09 2012
@@ -389,7 +389,7 @@ module Buildr
def ask_generate_buildfile
source, fromEclipse = choose do |menu|
menu.header = "ngng: To use Buildr you need a buildfile. Do you want me to create one?"
- menu.choice("From eclipse .project files") { [Dir.pwd, true] } if Generate.hasEclipseProject
+ menu.choice("From eclipse .project files") { [Dir.pwd, true] } if Generate.has_eclipse_project?
menu.choice("From Maven2 POM file") { ['pom.xml', false] } if File.exist?('pom.xml')
menu.choice("From directory structure") { [Dir.pwd, false] }
menu.choice("Cancel") {}
@@ -400,7 +400,7 @@ module Buildr
end
end
- def raw_generate_buildfile(source, fromEclipse)
+ def raw_generate_buildfile(source, fromEclipse=Generate.has_eclipse_project?)
# We need rakefile to be known, for settings.build to be accessible.
@rakefile = File.expand_path(DEFAULT_BUILDFILES.first)
fail "Buildfile already exists" if File.exist?(@rakefile) && !(tty_output? && agree('Buildfile exists, overwrite?'))
Modified: buildr/trunk/lib/buildr/core/generate.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/generate.rb?rev=1390177&r1=1390176&r2=1390177&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/generate.rb (original)
+++ buildr/trunk/lib/buildr/core/generate.rb Tue Sep 25 21:51:09 2012
@@ -61,7 +61,7 @@ module Buildr
candidates = Dir.glob("**/.project")
return false if candidates.size == 0
candidates.find { |x| get_project_natures(x) }
- return false
+ return candidates.size > 0
end