Permalink
Browse files

rearrange rakefiles a bit

  • Loading branch information...
1 parent 50253ab commit 8f5f584a6f8b601de18e0e389dd1038202976155 @rsanders committed Sep 24, 2009
Showing with 93 additions and 79 deletions.
  1. +13 −64 Rakefile
  2. +67 −0 lib/dottocore/tasks/install.rake
  3. +13 −15 zsh/tasks/zshbuild.rake
View
77 Rakefile
@@ -6,8 +6,10 @@ require 'dotto'
BUILDDIR=Dotto::BUILD_DIR
-Dir['lib/tasks/**/*.rake', 'zsh/tasks/*.rake', 'apps/*/tasks/*.rake'].each do |taskfile|
- load taskfile
+Dir['tasks/**/*.rake', 'zsh/tasks/**/*.rake', 'apps/*/tasks/**/*.rake',
+ 'lib/*/tasks/**/*.rake', 'external/*/tasks/**/*.rake',
+ 'external/*/lib/*/tasks/**/*.rake'].each do |taskfile|
+ import taskfile
end
task :default => :help do
@@ -18,66 +20,13 @@ task :help do
system %Q{rake -T}
end
-desc "Pull and update from repository"
-task :update => [:pull, :updatelocal]
+# desc "Clean compiled zwc files"
+# task :clean do
+# puts "Doing clean..."
+# end
+#
+# desc "Clean all junk"
+# task :realclean => [:clean, :clearlog] do
+# puts "Doing realclean..."
+# end
-desc "Pull latest from repository"
-task :pull do
- system %Q{git pull}
- Dir.glob("external/*/.git").each do |gitdir|
- dir=File.dirname gitdir
- puts "Pulling external dir #{dir} with Git"
- system %Q{cd #{dir} && git pull}
- end
- Dir.glob("external/*/.svn").each do |gitdir|
- dir=File.dirname gitdir
- puts "Pulling external dir #{dir} with Subversion"
- system %Q{cd #{dir} && svn update}
- end
- Dir.glob("external/*/.hg").each do |gitdir|
- dir=File.dirname gitdir
- puts "Pulling external dir #{dir} with Mercurial"
- system %Q{cd #{dir} && hg pull}
- end
-end
-
-desc "Push external dir changes into upstream repository"
-task :push do
- Dir.glob("external/*/.git").each do |gitdir|
- dir=File.dirname gitdir
- puts "Pushing external dir #{dir} upstream with Git"
- system %Q{cd #{dir} && git push}
- end
- Dir.glob("external/*/.hg").each do |gitdir|
- dir=File.dirname gitdir
- puts "Pushing external dir #{dir} upstream with Mercurial"
- system %Q{cd #{dir} && hg push}
- end
-end
-
-desc "Install in home directory"
-task :install do
- system %Q{yes n | ./setup/install.zsh}
-end
-
-desc "Update installation from local files"
-task :updatelocal => [:clean, :install, :compile]
-
-desc "Clean compiled zwc files"
-task :clean do
- puts "Doing clean..."
-end
-
-desc "Clean all junk"
-task :realclean => [:clean, :clearlog] do
- puts "Doing realclean..."
-end
-
-file Dotto.build_dir do |t|
- FileUtils.mkdir_p Dotto.build_dir
-end
-
-desc "Compile all files"
-task :compile do
- puts "Compile done"
-end
View
67 lib/dottocore/tasks/install.rake
@@ -0,0 +1,67 @@
+$:.unshift File.join(File.dirname(__FILE__), 'lib', 'ruby')
+
+require 'rake'
+require 'rubygems'
+require 'dotto'
+
+desc "Pull and update from repository"
+task :update => [:pull, :updatelocal]
+
+desc "Pull latest from repository"
+task :pull do
+ system %Q{git pull}
+ Dir.glob("external/*/.git").each do |gitdir|
+ dir=File.dirname gitdir
+ puts "Pulling external dir #{dir} with Git"
+ system %Q{cd #{dir} && git pull}
+ end
+ Dir.glob("external/*/.svn").each do |gitdir|
+ dir=File.dirname gitdir
+ puts "Pulling external dir #{dir} with Subversion"
+ system %Q{cd #{dir} && svn update}
+ end
+ Dir.glob("external/*/.hg").each do |gitdir|
+ dir=File.dirname gitdir
+ puts "Pulling external dir #{dir} with Mercurial"
+ system %Q{cd #{dir} && hg pull}
+ end
+end
+
+desc "Push external dir changes into upstream repository"
+task :push do
+ Dir.glob("external/*/.git").each do |gitdir|
+ dir=File.dirname gitdir
+ puts "Pushing external dir #{dir} upstream with Git"
+ system %Q{cd #{dir} && git push}
+ end
+ Dir.glob("external/*/.hg").each do |gitdir|
+ dir=File.dirname gitdir
+ puts "Pushing external dir #{dir} upstream with Mercurial"
+ system %Q{cd #{dir} && hg push}
+ end
+end
+
+desc "Install in home directory"
+task :install do
+ system %Q{yes n | ./setup/install.zsh}
+end
+
+desc "Update installation from local files"
+task :updatelocal => [:clean, :install, :compile]
+
+# desc "Clean compiled zwc files"
+# task :clean do
+# puts "Doing clean..."
+# end
+#
+# desc "Clean all junk"
+# task :realclean => [:clean, :clearlog] do
+# puts "Doing realclean..."
+# end
+
+directory Dotto.build_dir
+
+desc "Compile all files"
+task :compile do
+ puts "Compile done"
+end
View
28 zsh/tasks/zshbuild.rake
@@ -1,20 +1,20 @@
require 'fileutils'
require 'dotto/zsh'
-ZSH_VERSION=Dotto::Zsh.system("echo $ZSH_VERSION")
-ZCONFIGDIR = "#{Dotto::DIR}/zsh"
-ZSHBUILDDIR = "#{BUILDDIR}/zsh/#{ZSH_VERSION}"
-ZSH=Dotto::Zsh.path
+def zsh_version; Dotto::Zsh.system("echo $zsh_version"); end
+def zconfigdir; "#{Dotto::DIR}/zsh"; end
+def zsh_build_dir; "#{BUILDDIR}/zsh/#{zsh_version}"; end
+def zsh_path; Dotto::Zsh.path; end
namespace :zsh do
def zsh(commandline)
Dotto::Zsh.system commandline
end
- desc "Show ZSH versions and variables"
+ desc "Show zsh_path versions and variables"
task :info do
- puts "Z-Shell located at #{ZSH}, version #{ZSH_VERSION}"
- puts "Build directory is #{ZSHBUILDDIR}"
+ puts "Z-Shell located at #{zsh_path}, version #{zsh_version}"
+ puts "Build directory is #{zsh_build_dir}"
end
desc "Clean compiled zwc files"
@@ -24,22 +24,20 @@ namespace :zsh do
system %Q{rm -rf "./local/build/*"}
end
- file ZSHBUILDDIR => BUILDDIR do |t|
- FileUtils.mkdir_p ZSHBUILDDIR
- end
+ directory zsh_build_dir
desc "Compile all files"
- task :compile => [ZSHBUILDDIR,"#{ZSHBUILDDIR}/functions.zwc", "#{ZSHBUILDDIR}/libfunctions.zwc"] do
- puts "ZSH compile done"
+ task :compile => [zsh_build_dir,"#{zsh_build_dir}/functions.zwc", "#{zsh_build_dir}/libfunctions.zwc"] do
+ puts "zsh_path compile done"
end
- file "#{ZSHBUILDDIR}/functions.zwc" => Dir.glob("#{ZCONFIGDIR}/functions/*") do |t|
+ file "#{zsh_build_dir}/functions.zwc" => Dir.glob("#{zconfigdir}/functions/*") do |t|
zsh "zcompile #{t} #{t.prerequisites.join(" ")}"
end
- ZSHFUNCDIRS = ["#{ZCONFIGDIR}/lib/*/functions/*", "#{Dotto::DIR}/external/*/zsh/functions/*"]
+ ZSHFUNCDIRS = ["#{zconfigdir}/lib/*/functions/*", "#{Dotto::DIR}/external/*/zsh/functions/*"]
- file "#{ZSHBUILDDIR}/libfunctions.zwc" => Dir.glob(ZSHFUNCDIRS) do |t|
+ file "#{zsh_build_dir}/libfunctions.zwc" => Dir.glob(ZSHFUNCDIRS) do |t|
zsh "zcompile -U #{t} #{t.prerequisites.join(" ")}"
end
end

0 comments on commit 8f5f584

Please sign in to comment.