Files
gitx/Rakefile
T
dbr 8eb76f1386 Add Rakefile tasks for (un)install
Added Rakefile that does install and uninstall.

Also providded are sub-tasks that do things like build GitX, copy it to
~/Applications/ or /Applications/, cleaning the build and removing GitX.app

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
2008-08-14 20:57:29 +02:00

49 lines
1.2 KiB
Ruby

require 'ftools'
target_locations = [
File::expand_path("~/Applications/"),
"/Applications/"
]
desc "Build and install (or upgrade) GitX"
task :install => [:uninstall_app, :build_app, :install_app]
desc "Clean build directory, uninstall application"
task :uninstall => [:clean_app, :uninstall_app]
desc "Clean build directory"
task :clean => [:clean_app]
desc "Build gitX using XCode"
task :build_app do
system("xcodebuild")
end
task :clean_app do
system("xcodebuild -alltargets clean OBJROOT=build/ SYMROOT=build/")
end
desc "Copies the built GitX.app to the application folder"
task :install_app do
target_locations.each do |loc|
if File.directory?(loc)
puts "Copying to (#{loc})"
File.copy("build/Release/GitX.app/", loc)
break
end
end
end
desc "Remove GitX.app from ~/Applications/ or /Applications/"
task :uninstall_app do
found = false
target_locations.each do |loc|
cur_path = File.join(loc, "GitX.app")
puts "Checking #{cur_path}"
if File.exists?( cur_path )
puts "Removing GitX.app from #{cur_path}"
system("rm", "-rf", cur_path)
found = true
break
end
end
puts "Couldn't find installed GitX.app" unless found
end