lib/maven/tools/dsl.rb in maven-tools-0.34.4 vs lib/maven/tools/dsl.rb in maven-tools-0.34.5

- old
+ new

@@ -131,10 +131,13 @@ @has_path = nil @has_git = nil end def setup_gem_support( options, spec = nil, config = {} ) + unless model.properties.member?( 'project.build.sourceEncoding' ) + properties( 'project.build.sourceEncoding' => 'utf-8' ) + end if spec.nil? require_path = '.' name = File.basename( File.expand_path( '.' ) ) else require_path = spec.require_path @@ -263,13 +266,10 @@ self.spec( spec, name, options ) end def spec( spec, name = nil, options = {} ) name ||= "#{spec.name}-#{spec.version}.gemspec" - unless model.properties.member?( 'project.build.sourceEncoding' ) - properties( 'project.build.sourceEncoding' => 'utf-8' ) - end @gemfile_options = nil if @context == :project build.directory = '${basedir}/pkg' @@ -940,10 +940,15 @@ unless args[ 0 ].match( /:/ ) args[ 0 ] = "rubygems:#{args[ 0 ] }" end if args.last.is_a?(Hash) options = args.last + elsif @group + options = {} + args << options + end + if options # on ruby-maven side we ignore the require option options.delete( :require ) options.delete( 'require' ) @@ -951,18 +956,18 @@ @has_git = true elsif options.key?( :path ) @has_path = true else platform = options.delete( :platform ) || options.delete( 'platform' ) - group = options.delete( :group ) || options.delete( 'group' ) || @group || nil - if group + group = options.delete( :group ) || options.delete( 'group' ) || @group + if group case group.to_sym when :test options[ :scope ] = :test when :development options[ :scope ] = :provided end - end + end if platform.nil? || is_jruby_platform( platform ) options[ :version ] = '[0,)' if args.size == 2 && options[ :version ].nil? && options[ 'version' ].nil? do_dependency( bang, :gem, *args ) end end