Skip to content

Commit

Permalink
Error out if trying to use a mvn source outside jruby
Browse files Browse the repository at this point in the history
  • Loading branch information
ANithian committed Feb 14, 2012
1 parent 6635ac7 commit 012a8c4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/bundler/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def gemspec(opts = nil)

#Influenced from https://github.com/jkutner/bundler/blob/master/lib/bundler/dsl.rb
def mvn(repo, options={}, source_options={}, &blk)
unless Bundler.java?
raise InvalidOption, "mvn can only be executed in JRuby"
end

if (options['name'].nil? || options['version'].nil?) and !block_given?
raise InvalidOption, 'Must specify a dependency name+version, or block of dependencies.'
end
Expand All @@ -63,13 +67,8 @@ def mvn(repo, options={}, source_options={}, &blk)
end
local_source
end


#TODO: ADD mvn_repo "repo" {
#mvn <group_id>,<artifact_id>,<name>
#}

#END MAVEN STUFF

def gem(name, *args)
if name.is_a?(Symbol)
raise GemfileError, %{You need to specify gem names as Strings. Use 'gem "#{name.to_s}"' instead.}
Expand Down

0 comments on commit 012a8c4

Please sign in to comment.