Sha256: ef1669cf01a931dc65146f5fb36156ef420b5e9ee0462851a49691560618de4b

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/version'


PROJECT_NAME='BitStructEx'
PROJECT_FORGE_ID='bit-struct-ex'

SRC_DIR='src/ruby'
TEST_DIR='test/ruby'

PKG_VERSION = Rake::Version.new
PKG_FILES = FileList[
    'lib/**/*.rb', 
    'src/**/*.rb', 
    'test/**/*.rb',
    'Rakefile',
    'Version'
]

CLOBBER.include 'pkg'


desc "Run all tests, update build number and build gem"
task :default => [ :run_tests, :increment_build_number, :build_gem ]

desc "Execute the unit tests using the specialized test runner"
task :run_tests do
    sh "ruby -I#{TEST_DIR} #{TEST_DIR}/runner.rb --verbose=v"
end

desc "Increment the build number and upate the Version file"
task :increment_build_number => [ :run_tests ] do
    src = Dir.glob "#{SRC_DIR}/**/*"
    test = Dir.glob "#{TEST_DIR}/**/*"
    files = src + test
    target = 'Version'
    unless uptodate?( target, files )
        new_version = PKG_VERSION.increment( :build )
        puts "Version: #{new_version}"
    end
end

desc "Build the gem package"
task :build_gem => [ :run_tests, :define_gem, :gem ]

desc "Define the Gem specification and associated task(s)"
task :define_gem do
    PKG_SPEC = eval IO.read( 'GemSpec' ), binding
    Rake::GemPackageTask.new( PKG_SPEC ) do |pkg|
        pkg.need_zip = true
        pkg.need_tar = true
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
BitStructEx-0.0.64 Rakefile