mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
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>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
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
|
||||
Reference in New Issue
Block a user