Fill Rakefile with real rules :-)

This commit is contained in:
Glenn Y. Rolland 2014-10-29 22:35:43 +01:00
parent bc3cf3308e
commit 6f1ea23906
2 changed files with 32 additions and 16 deletions

View file

@ -1,7 +1,7 @@
PATH PATH
remote: . remote: .
specs: specs:
qasim (0.1.11.dev.2014102811) qasim (0.1.11.dev.2014102921)
qtbindings (~> 4.8.6.0) qtbindings (~> 4.8.6.0)
GEM GEM

View file

@ -1,4 +1,3 @@
require "bundler/gem_tasks"
NAME="qasim" NAME="qasim"
DESTDIR="" DESTDIR=""
@ -12,31 +11,37 @@ SHAREDIR="#{DESTDIR}/usr/share"
RUBYVERSION="2.0" RUBYVERSION="2.0"
RDOC="rdoc#{RUBYVERSION}" RDOC="rdoc#{RUBYVERSION}"
QRC_FILES=$(wildcard lib/$(NAME)/*.qrc) QRC_FILES=Dir.glob("lib/#{NAME}/*.qrc")
RBQRC_FILES=$(patsubst %.qrc,%_qrc.rb,$(QRC_FILES)) RBQRC_FILES=QRC_FILES.map{ |f| f.sub(/\.qrc$/,'_qrc.rb') }
UI_FILES=$(wildcard lib/$(NAME)/ui/*.ui)
RBUI_FILES=$(patsubst %.ui,%_ui.rb,$(UI_FILES))
UI_FILES=Dir.glob("lib/#{NAME}/ui/*.ui")
RBUI_FILES=UI_FILES.map{ |f| f.sub(/\.ui$/,'_ui.rb') }
desc "Do everything"
task :all => [:build, :install] task :all => [:build, :install]
desc "Clean everything"
task :clean => [ task :clean => [
:clean_ui, :clean_ui,
:clean_qrc, :clean_qrc,
:clean_bin, :clean_bin,
:clean_lib, :clean_lib,
:clean_data :clean_data,
:"gem:clean"
] ]
desc "Build everything"
task :build => [ task :build => [
:build_ui, :build_ui,
:build_qrc, :build_qrc,
:build_bin, :build_bin,
:build_lib, :build_lib,
:build_data :build_data,
:"gem:build"
] ]
task :doc => [:build_doc] desc "Install everything"
task :install => [ task :install => [
:install_ui, :install_ui,
:install_qrc, :install_qrc,
@ -45,12 +50,15 @@ task :install => [
:install_data :install_data
] ]
desc "Build documentation"
task :doc => [:build_doc]
task :clean_doc do task :clean_doc do
rm_rf doc rm_rf doc
end end
task :build_doc => :clean_doc do task :build_doc => :clean_doc do
sh %q{$(RDOC) sh %Q{#{RDOC}
--promiscuous --promiscuous
--inline-source --inline-source
--line-numbers --line-numbers
@ -60,14 +68,22 @@ task :build_doc => :clean_doc do
end end
task :clean_qrc do task :clean_qrc do
rm_fr $(RBQRC_FILES) rm_fr RBQRC_FILES
end end
task :build_qrc => $(RBQRC_FILES) do task :build_qrc => RBQRC_FILES do
echo $(RBQRC_FILES) puts RBQRC_FILES
end end
task %_qrc.rb: %.qrc do rule "_qrc.rb" => ".qrc" do |t|
rbrcc $< -o $@ sh %Q{rbrcc #{t.source} -o #{t.name}}
end end
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