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.59.6 lib/tasks/gem.rake
origen-0.59.5 lib/tasks/gem.rake
origen-0.59.4 lib/tasks/gem.rake
origen-0.59.3 lib/tasks/gem.rake
origen-0.59.2 lib/tasks/gem.rake
origen-0.59.1 lib/tasks/gem.rake
origen-0.59.0 lib/tasks/gem.rake
origen-0.58.0 lib/tasks/gem.rake
origen-0.57.2 lib/tasks/gem.rake
origen-0.57.1 lib/tasks/gem.rake
origen-0.57.0 lib/tasks/gem.rake
origen-0.56.0 lib/tasks/gem.rake
origen-0.55.5 lib/tasks/gem.rake
origen-0.55.4 lib/tasks/gem.rake
origen-0.55.3 lib/tasks/gem.rake
origen-0.55.2 lib/tasks/gem.rake
origen-0.55.1 lib/tasks/gem.rake
origen-0.55.0 lib/tasks/gem.rake
origen-0.54.6 lib/tasks/gem.rake
origen-0.54.5 lib/tasks/gem.rake