Sha256: 85a6477f29f149bd7c51629d9e57c3714acd83c77110e6d05bd8276aeb11cd80

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

desc 'Build release package for RubyGems.'
task :gem do
  Rake::Task[:@project].invoke
  Rake::Task[:@ann_nfo_text].invoke
  Rake::Task[:@project_authors_text].invoke

  # ensure that project version matches release notes
  Rake::Task[:@ann_rel_html_body_nodes].invoke

  version_from_notes = @ann_rel_html_title_node.inner_text
  version_from_project = "Version #{@project_module::VERSION} (#{@project_module::RELDATE})"

  unless version_from_notes == version_from_project
    raise "Project version #{version_from_project.inspect} does not match "\
      "the #{version_from_notes.inspect} version listed in the release notes."
  end

  # build gemspec
  gem             = Gem::Specification.new
  gem.name        = @project_package_name
  gem.date        = @project_module::RELDATE
  gem.version     = @project_module::VERSION
  gem.summary     = @project_module::TAGLINE
  gem.description = @ann_nfo_text
  gem.homepage    = @project_module::WEBSITE
  gem.authors     = @project_authors_text.split(/\s*,\s*/)
  gem.executables = FileList['bin/*'].pathmap('%f')

  Rake::Task[:man].invoke
  gem.files = FileList[
    '{bin,lib,ext}/**/*',
    'LICENSE',
    'CREDITS',
    @man_html_dst,
    @man_roff_dst_glob
  ]

  @project_module::DEVTIME.each do |gem_name, gem_version|
    gem.add_development_dependency gem_name, *Array(gem_version)
  end

  @project_module::RUNTIME.each do |gem_name, gem_version|
    gem.add_dependency gem_name, *Array(gem_version)
  end

  # allow user to configure the gem before it is built
  if logic = @project_options[:gem_spec_logic] and not logic.empty?
    eval logic, binding, "#{@project_options_file} in :gem_spec_logic"
  end

  # emit gemspec
  File.write @project_gem_file + 'spec', gem.to_ruby

  # build gem
  Gem::Builder.new(gem).build
end

CLOBBER.include '*.gem', '*.gemspec'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inochi-4.0.1 lib/inochi/tasks/5-gem.rake
inochi-4.0.0 lib/inochi/tasks/5-gem.rake