require 'rake/extensiontask' Rake::ExtensionTask.new('P4') require 'rake/testtask' Rake::TestTask.new do |t| t.libs << "." t.libs << "test" t.warning = true t.verbose = true t.test_files = FileList[ 'test/testlib.rb', 'test/*_test.rb'] end require 'rake/packagetask' $:.push File.expand_path("../lib", __FILE__) require 'P4/version' Rake::PackageTask.new('p4api', P4::VERSION) do |p| p.need_tar = true p.need_zip = true p.package_files.include %w( Gemfile LICENSE.txt p4ruby.gemspec Rakefile README ) p.package_files.include 'ext/**/*.cpp' p.package_files.include 'ext/**/*.h' p.package_files.include 'lib/**/*.rb' p.package_files.include 'test/**/*.rb' p.package_files.include 'doc/**/*' end desc 'Create README from p4rubynotes.txt' file 'README' => 'p4-doc/user/p4rubynotes.txt' do cp 'p4-doc/user/p4rubynotes.txt', 'README' end task :package => 'README' desc 'Create build.properties' file 'build.properties' do props = <<-END.gsub(/^ {4}/, '') P4RUBY_VERSION=#{P4::VERSION} END IO.write('build.properties', props) end