Sha256: 888af18d17661112516c31ac6ab652e67201428037cd20d6e9ffd9dc113fdcc0

Contents?: true

Size: 1.31 KB

Versions: 1

Compression:

Stored size: 1.31 KB

Contents

# encoding: utf-8
# vim: set shiftwidth=2 tabstop=2 expandtab:

require 'bundler/gem_tasks'
require 'bundler/setup'
require 'rake/testtask'

task :default => :test

task :"test:prerequisites" do
    raise 'Please define DELPHI_VERSION environment variable' \
		+ ' to run tests with appropriate Delphi compiler' unless ENV['DELPHI_VERSION']
end

Rake::TestTask.new('test:no:delphi') do |t|
    t.ruby_opts << '-d' if Rake.application.options.trace
    t.libs << 'test'
    t.test_files = FileList['test/test*.rb'].delete_if do |f|
      # exclude "delphi" tests
      /delphi/.match(f)
    end
    t.verbose = true
end


desc 'Test on Travis CI (with no Delphi tests)'
task 'travis' => 'test:no:delphi'

Rake::TestTask.new do |t|
    t.ruby_opts << '-d' if Rake.application.options.trace
    t.libs << 'test'
    t.verbose = true
    Rake::application[t.name].enhance([:"test:prerequisites"])
end

desc 'Increase gem version'
task :'version:inc' do
  next_version = Gem::Version.new(Rake::Delphi::VERSION + '.0').bump
  puts "Version is #{next_version} now"
  version_file = File.expand_path('../lib/rake/delphi/version.rb', __FILE__)
  file_content = File.read(version_file).gsub(/(VERSION = )(.+)$/, "\\1'#{next_version}'")
  File.open(version_file, 'w') do |f|
    f.write(file_content)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rake-delphi-0.0.34 Rakefile.rb