lib/maven/tools/gemspec_dependencies.rb in maven-tools-1.0.2 vs lib/maven/tools/gemspec_dependencies.rb in maven-tools-1.0.3
- old
+ new
@@ -12,13 +12,26 @@
end
_setup
end
def java_runtime
- _deps( :java_runtime )
+ warn 'deprecated us java_dependency_artifacts instead'
+ _deps( :java ).select { |d| d[0] == :compile }.collect { |d| d[ 1..-1] }
end
+ def java_dependencies
+ warn 'deprecated us java_dependency_artifacts instead'
+ _deps( :java )
+ end
+
+ def java_dependency_artifacts
+ _deps( :java ).collect do |d|
+ scope = d.shift
+ d += [nil, nil, { :scope => scope } ][ (d.size - 4 )..2 ]
+ Maven::Tools::Artifact.new( *d )
+ end
+ end
def runtime
_deps( :runtime )
end
def development
@@ -41,11 +54,14 @@
req.collect{ |i| i.to_s }.join
end
_deps( dep.type ) << "rubygems:#{dep.name}:#{to_version( *versions )}"
end
@spec.requirements.each do |req|
- coord = to_split_coordinate( req )
- _deps( :java_runtime ) << coord if coord
+ req.sub!( /#.*^/, '' )
+ coord = to_split_coordinate_with_scope( req )
+ if coord && coord.size > 1
+ _deps( :java ) << coord
+ end
end
end
end
end
end