require 'meta_project' require 'rake' require 'rake/testtask' require 'rake/clean' require 'rake/gempackagetask' require 'rake/contrib/xforge' require '../tools/rakehelp' require 'rubygems' require 'fileutils' include FileUtils $version = IO.read('VERSION').strip $name = 'activerdf_jena' $project = MetaProject::Project::XForge::RubyForge.new('activerdf') $distdir = "#$name-#$version" # setup tests and rdoc files setup_tests setup_clean ["pkg", "lib/*.bundle", "*.gem", ".config"] # default task: install desc 'test and package gem' task :default => :install # define package task setup_gem($name, $version) do |spec| spec.summary = 'ActiveRDF adapter to the Jena RDF store' spec.description = spec.summary spec.author = 'Karsten Huneycutt and Benjamin Heitmann' spec.email = 'benjamin.heitmann@deri.org' spec.homepage = 'http://www.activerdf.org' spec.platform = Gem::Platform::RUBY spec.autorequire = 'active_rdf' spec.add_dependency('gem_plugin', '>= 0.2.1') spec.add_dependency('activerdf', '>= 1.6.4') spec.add_dependency('activerdf_sparql', '>= 1.3.3') spec.autorequire = 'init.rb' spec.files += Dir['ext/**/*.jar'] end begin require 'rcov/rcovtask' Rcov::RcovTask.new do |t| t.test_files = FileList["activerdf-*/test/**/*.rb"] t.verbose = true end rescue LoadError end # define test_all task Rake::TestTask.new do |t| t.name = :test_all t.test_files = FileList["test/**/*.rb", "activerdf-*/test/**/*.rb"] end task :verify_rubyforge do raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER'] raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD'] end desc "release #$name-#$version gem on RubyForge" task :release => [ :clean, :verify_rubyforge, :package ] do release_files = FileList["pkg/#$distdir.gem"] Rake::XForge::Release.new($project) do |release| release.user_name = ENV['RUBYFORGE_USER'] release.password = ENV['RUBYFORGE_PASSWORD'] release.files = release_files.to_a release.release_name = "#$name #$version" release.package_name = "activerdf" release.release_notes = "" changes = [] File.open("CHANGELOG") do |file| current = true file.each do |line| line.chomp! if current and line =~ /^==/ current = false; next end break if line.empty? and not current changes << line end end release.release_changes = changes.join("\n") end end