jam-cloud/pb/package_ruby

69 lines
1.5 KiB
Plaintext
Raw Normal View History

2012-08-18 18:56:16 +00:00
#!/bin/bash
echo "packaging ruby protocol buffers"
pushd target/ruby > /dev/null
rm -rf jampb
2016-04-04 14:44:07 +00:00
#bundle gem jampb > /dev/null
echo "build gem jampb"
bundle gem jampb
2012-08-18 18:56:16 +00:00
# copy over built ruby code
cp src/*.rb jampb/lib/jampb
if [ -z $BUILD_NUMBER ]; then
BUILD_NUMBER="1"
fi
VERSION="0.1.${BUILD_NUMBER}"
2012-08-18 18:56:16 +00:00
pushd jampb > /dev/null
cat > lib/jampb/version.rb << EOF
module Jampb
VERSION = "$VERSION"
end
EOF
2012-08-18 18:56:16 +00:00
# define gemspec
cat >> jampb.gemspec << EOF
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/jampb/version', __FILE__)
Gem::Specification.new do |gem|
gem.authors = ["Seth Call"]
gem.email = ["seth@jamkazam.com"]
gem.description = %q{protocol buffers for jamkazam}
gem.summary = %q{protocol buffers for jamkazam.}
gem.homepage = "http://www.jamkazam.com"
gem.files = ['Gemfile', 'Rakefile', 'README.md', 'jampb.gemspec', 'lib/jampb.rb', 'lib/jampb/client_container.pb.rb', 'lib/jampb/version.rb' ]
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.name = "jampb"
gem.require_paths = ["lib"]
gem.version = Jampb::VERSION
end
EOF
# make sure library manifest includes the generated ruby file
cat >> lib/jampb.rb << EOF
require "jampb/version"
require "jampb/client_container.pb"
module Jampb
end
EOF
2016-04-04 14:44:07 +00:00
echo "gem build jampb.gemspec"
2012-08-18 18:56:16 +00:00
gem build jampb.gemspec > /dev/null
2016-04-04 14:44:07 +00:00
#gem build jampb.gemspec > /dev/null
2012-08-18 18:56:16 +00:00
popd > /dev/null
popd > /dev/null