Sha256: c35a59bbe1195482a082dc909ddbb73aa22b00a463c0762a2d237e549a7d616f

Contents?: true

Size: 1.43 KB

Versions: 52

Compression:

Stored size: 1.43 KB

Contents

namespace 'gem' do
  GEM_SPEC = "#{Origen.root}/#{Origen.app.gem_name}.gemspec"
  GEM_NAME = "#{Origen.app.gem_name}-#{Origen.app.version}.gem"

  if File.exist?(GEM_SPEC)

    built_gem_path = nil

    desc "Build #{GEM_NAME} into the pkg directory"
    task :build do
      # Ensure all files are readable
      sh("chmod a+r -R #{Origen.root}")
      sh("gem build -V '#{GEM_SPEC}'") do |_ok, _res|
        outdir = File.join(Origen.root, 'pkg')
        FileUtils.mkdir_p(outdir)
        FileUtils.mv(GEM_NAME, outdir)
        built_gem_path = File.join(outdir, GEM_NAME)
        puts "#{Origen.app.name} #{Origen.app.version} built to pkg/#{GEM_NAME}".green
      end
    end

    desc "Push #{GEM_NAME} to the Origen gem server"
    task release: [:build] do
      if Origen.app.config.release_externally
        cmd = "gem push #{built_gem_path}"
      else
        url = Origen.site_config.gem_server_push || Origen.site_config.gem_server!
        if Origen.site_config.gem_push_cmd
          cmd = Origen.site_config.gem_push_cmd.gsub('+URL+', url).gsub('+GEM+', built_gem_path)
        else
          cmd = "gem push #{built_gem_path} --host #{url}"
        end
      end
      sh(cmd) do |ok, _res|
        if ok
          puts "#{Origen.app.name} #{Origen.app.version} has been released successfully".green
        else
          puts "Something went wrong releasing #{Origen.app.name} to the gem server!".red
        end
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
origen-0.60.18 lib/tasks/gem.rake
origen-0.60.17 lib/tasks/gem.rake
origen-0.60.16 lib/tasks/gem.rake
origen-0.60.14 lib/tasks/gem.rake
origen-0.60.13 lib/tasks/gem.rake
origen-0.60.12 lib/tasks/gem.rake
origen-0.60.11 lib/tasks/gem.rake
origen-0.60.10 lib/tasks/gem.rake
origen-0.60.9 lib/tasks/gem.rake
origen-0.60.8 lib/tasks/gem.rake
origen-0.60.7 lib/tasks/gem.rake
origen-0.60.6 lib/tasks/gem.rake
origen-0.60.5 lib/tasks/gem.rake
origen-0.60.4 lib/tasks/gem.rake
origen-0.60.3 lib/tasks/gem.rake
origen-0.60.2 lib/tasks/gem.rake
origen-0.60.1 lib/tasks/gem.rake
origen-0.60.0 lib/tasks/gem.rake
origen-0.59.8 lib/tasks/gem.rake
origen-0.59.7 lib/tasks/gem.rake