You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/testtask'
spec = Gem::Specification.new do |s|
s.name = 'qmp_client'
s.version = '0.0.1'
s.has_rdoc = true
s.extra_rdoc_files = ['README', 'LICENSE']
s.summary = 'QMP client library '
s.description = "Library that interfaces with running QEMU processes over QMP"
s.author = 'Nicholas Thomas'
s.email = 'nick@lupine.me.uk'
s.files = %w(LICENSE README Rakefile) + Dir.glob("{bin,lib,test}/**/*")
s.require_path = "lib"
end
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end
Rake::RDocTask.new do |rdoc|
files =['README', 'LICENSE', 'lib/**/*.rb']
rdoc.rdoc_files.add(files)
rdoc.main = "README" # page to start on
rdoc.title = "qmp-client Docs"
rdoc.rdoc_dir = 'doc/rdoc' # rdoc output folder
rdoc.options << '--line-numbers'
end
Rake::TestTask.new do |t|
t.libs << ["test/unit"]
t.test_files = FileList['test/unit/**/test_*.rb']
t.options="-v"
t.name = "test:unit"
end
SCHEMA_HOST = 'http://git.kernel.org/'
SCHEMA_QUERY = 'p=virt/kvm/qemu-kvm.git;a=blob_plain;f=qapi-schema.json'
SCHEMA_LOC = [SCHEMA_HOST, SCHEMA_QUERY].join('?')
SCHEMA_OUTPUT = File.join(
Rake::application.original_dir,
'lib', 'qmp_client', 'qapi-schema.json'
)
namespace :dev do
desc "Download the QMP schema file"
task :fetch_schema do
`wget '#{SCHEMA_LOC}' -O '#{SCHEMA_OUTPUT}'`
end
end