Build UI & QRC files from Rakefile.

This commit is contained in:
Glenn Y. Rolland 2014-10-30 16:53:51 +01:00
parent b29c8cc6a1
commit afc6e1704f
2 changed files with 52 additions and 28 deletions

View file

@ -1,7 +1,7 @@
PATH
remote: .
specs:
qasim (0.1.11.dev.2014102922)
qasim (0.1.11.dev.2014103015)
qtbindings (~> 4.8.6)
thor (~> 0.19.1)

View file

@ -17,37 +17,40 @@ RBQRC_FILES=QRC_FILES.map{ |f| f.sub(/\.qrc$/,'_qrc.rb') }
UI_FILES=Dir.glob("lib/#{NAME}/ui/*.ui")
RBUI_FILES=UI_FILES.map{ |f| f.sub(/\.ui$/,'_ui.rb') }
require 'rake'
#Rake.application.options.trace_rules = true
desc "Do everything"
task :all => [:build, :install]
desc "Clean everything"
task :clean => [
:clean_ui,
:clean_qrc,
:clean_bin,
:clean_lib,
:clean_data,
:"ui:clean",
:"qrc:clean",
#:clean_bin,
#:clean_lib,
#:clean_data,
:"gem:clean"
]
desc "Build everything"
task :build => [
:build_ui,
:build_qrc,
:build_bin,
:build_lib,
:build_data,
:"ui:build",
:"qrc:build",
#:build_bin,
#:build_lib,
#:build_data,
:"gem:build"
]
desc "Install everything"
task :install => [
:install_ui,
:install_qrc,
:install_bin,
:install_lib,
:install_data
#:"ui:install",
#:"qrc:install",
#:install_bin,
#:install_lib,
#:install_data
]
desc "Build documentation"
@ -67,17 +70,39 @@ task :build_doc => :clean_doc do
}
end
task :clean_qrc do
rm_fr RBQRC_FILES
namespace :qrc do
desc "Clean QRC files"
task :clean do
rm_rf RBQRC_FILES
end
task :build_qrc => RBQRC_FILES do
desc "Build QRC files"
task :build => RBQRC_FILES do
puts RBQRC_FILES
end
rule "_qrc.rb" => ".qrc" do |t|
rule "_qrc.rb" => lambda{|f| f.gsub(/_qrc\.rb/,'.qrc') } do |t|
sh %Q{rbrcc #{t.source} -o #{t.name}}
end
end
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
end
namespace :gem do
require "bundler/gem_tasks"
@ -88,7 +113,6 @@ namespace :gem do
end
end
require 'rake'
require "bundler/gem_tasks"
require 'rake/testtask'