2014-10-29 08:12:55 +00:00
|
|
|
|
|
|
|
NAME="qasim"
|
|
|
|
DESTDIR=""
|
|
|
|
DEV_DESTDIR="tmp"
|
|
|
|
CONFDIR="#{DESTDIR}/etc"
|
|
|
|
BINDIR="#{DESTDIR}/usr/bin"
|
|
|
|
MANDIR="#{DESTDIR}/usr/share/man"
|
|
|
|
DOCDIR="#{DESTDIR}/usr/share/doc"
|
|
|
|
SHAREDIR="#{DESTDIR}/usr/share"
|
|
|
|
|
|
|
|
RUBYVERSION="2.0"
|
|
|
|
RDOC="rdoc#{RUBYVERSION}"
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
QRC_FILES=Dir.glob("lib/#{NAME}/*.qrc")
|
|
|
|
RBQRC_FILES=QRC_FILES.map{ |f| f.sub(/\.qrc$/,'_qrc.rb') }
|
2015-08-09 14:35:04 +00:00
|
|
|
RBQRC_TO_QRC = lambda{|f| f.gsub(/_qrc\.rb/,'.qrc') }
|
2014-10-29 08:12:55 +00:00
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
UI_FILES=Dir.glob("lib/#{NAME}/ui/*.ui")
|
|
|
|
RBUI_FILES=UI_FILES.map{ |f| f.sub(/\.ui$/,'_ui.rb') }
|
|
|
|
|
2014-10-30 15:53:51 +00:00
|
|
|
require 'rake'
|
2015-08-09 15:03:50 +00:00
|
|
|
require "bundler/gem_tasks"
|
|
|
|
require 'rake/testtask'
|
|
|
|
|
2014-10-30 15:53:51 +00:00
|
|
|
#Rake.application.options.trace_rules = true
|
|
|
|
|
2015-08-09 15:03:50 +00:00
|
|
|
Rake::TaskManager.record_task_metadata = true
|
2014-10-29 21:35:43 +00:00
|
|
|
|
2014-10-29 08:12:55 +00:00
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
desc "Clean everything"
|
2014-10-29 08:12:55 +00:00
|
|
|
task :clean => [
|
2014-10-30 15:53:51 +00:00
|
|
|
:"ui:clean",
|
|
|
|
:"qrc:clean",
|
2014-10-29 21:35:43 +00:00
|
|
|
:"gem:clean"
|
2014-10-29 08:12:55 +00:00
|
|
|
]
|
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
desc "Build everything"
|
2014-10-29 08:12:55 +00:00
|
|
|
task :build => [
|
2014-10-30 15:53:51 +00:00
|
|
|
:"ui:build",
|
|
|
|
:"qrc:build",
|
2015-08-09 14:35:04 +00:00
|
|
|
:"doc:build",
|
2014-10-29 21:35:43 +00:00
|
|
|
:"gem:build"
|
2014-10-29 08:12:55 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2015-08-09 14:35:04 +00:00
|
|
|
namespace :doc do
|
|
|
|
task :clean do
|
|
|
|
rm_rf "doc"
|
|
|
|
end
|
|
|
|
|
|
|
|
task :build => :clean do
|
2015-08-09 15:03:50 +00:00
|
|
|
sh [RDOC,
|
|
|
|
"--promiscuous",
|
|
|
|
"--inline-source",
|
|
|
|
"--line-numbers",
|
|
|
|
"-o", "doc",
|
|
|
|
"lib/#{NAME}/", "bin/"
|
|
|
|
].join(" ")
|
2015-08-09 14:35:04 +00:00
|
|
|
end
|
2014-10-29 08:12:55 +00:00
|
|
|
end
|
|
|
|
|
2015-08-09 14:35:04 +00:00
|
|
|
|
2014-10-30 15:53:51 +00:00
|
|
|
namespace :qrc do
|
|
|
|
desc "Clean QRC files"
|
|
|
|
task :clean do
|
|
|
|
rm_rf RBQRC_FILES
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Build QRC files"
|
|
|
|
task :build => RBQRC_FILES do
|
|
|
|
puts RBQRC_FILES
|
|
|
|
end
|
2014-10-29 08:12:55 +00:00
|
|
|
|
2015-08-09 14:35:04 +00:00
|
|
|
rule "_qrc.rb" => RBQRC_TO_QRC do |t|
|
2014-10-30 15:53:51 +00:00
|
|
|
sh %Q{rbrcc #{t.source} -o #{t.name}}
|
|
|
|
end
|
2014-10-29 08:12:55 +00:00
|
|
|
end
|
|
|
|
|
2015-08-09 14:35:04 +00:00
|
|
|
|
2015-08-09 15:03:50 +00:00
|
|
|
desc "UI related tasks"
|
2014-10-30 15:53:51 +00:00
|
|
|
namespace :ui do
|
|
|
|
desc "Clean UI files"
|
|
|
|
task :clean do
|
|
|
|
rm_rf RBUI_FILES
|
|
|
|
end
|
|
|
|
|
|
|
|
desc "Build UI files"
|
|
|
|
task :build => RBUI_FILES do
|
|
|
|
puts RBQRC_FILES
|
|
|
|
end
|
|
|
|
|
|
|
|
rule "_ui.rb" => lambda{|f| f.gsub(/_ui\.rb/,'.ui') } do |t|
|
|
|
|
sh %Q{rbuic4 #{t.source} -o #{t.name}}
|
|
|
|
sh %Q{sed -e '/^module Ui/,/^end # module Ui/d' -i #{t.name}}
|
|
|
|
end
|
2014-10-29 08:12:55 +00:00
|
|
|
end
|
|
|
|
|
2014-10-30 15:53:51 +00:00
|
|
|
|
2014-10-29 21:35:43 +00:00
|
|
|
namespace :gem do
|
|
|
|
require "bundler/gem_tasks"
|
|
|
|
|
|
|
|
desc "Clean stalling gem files from the pkg directory"
|
|
|
|
task :clean do
|
|
|
|
rm_rf Dir.glob('pkg/*.gem')
|
|
|
|
end
|
|
|
|
end
|
2014-10-29 22:31:11 +00:00
|
|
|
|
2015-08-09 14:35:04 +00:00
|
|
|
|
2014-10-29 22:31:11 +00:00
|
|
|
Rake::TestTask.new do |t|
|
2015-08-09 15:03:50 +00:00
|
|
|
#t.warning = true
|
|
|
|
#t.verbose = true
|
|
|
|
t.libs << "spec"
|
|
|
|
t.test_files = FileList['spec/**/*_spec.rb']
|
2014-10-29 22:31:11 +00:00
|
|
|
end
|
|
|
|
|
2015-08-09 15:03:50 +00:00
|
|
|
# Set default task to list all task
|
|
|
|
desc "Default task (build)"
|
|
|
|
task :default do
|
|
|
|
puts "Usage : rake <taskname>"
|
|
|
|
puts ""
|
|
|
|
|
|
|
|
Rake::application.options.show_tasks = :tasks # this solves sidewaysmilk problem
|
|
|
|
Rake::application.options.show_task_pattern = //
|
|
|
|
Rake::application.display_tasks_and_comments
|
|
|
|
end
|