2011-08-27 14:48:00 +04:00
|
|
|
ENV['PATH'] = "#{ENV['PATH']}:/usr/local/bin/"
|
|
|
|
|
|
|
|
desc "Build the shit."
|
|
|
|
task :build do
|
|
|
|
project_dir = ENV['PROJECT_DIR'] || '.'
|
|
|
|
built_dir = ENV['BUILT_PRODUCTS_DIR'] || '.'
|
|
|
|
contents_dir = ENV['CONTENTS_FOLDER_PATH'].to_s
|
|
|
|
|
|
|
|
dest = File.join(built_dir, contents_dir, "Resources")
|
|
|
|
|
2012-03-01 03:14:56 +04:00
|
|
|
%w(index.html src static vendor spec).each do |dir|
|
2011-08-27 14:48:00 +04:00
|
|
|
rm_rf File.join(dest, dir)
|
|
|
|
cp_r dir, File.join(dest, dir)
|
|
|
|
end
|
|
|
|
|
2011-08-27 15:06:01 +04:00
|
|
|
`hash coffee`
|
|
|
|
if not $?.success?
|
|
|
|
abort "error: coffee is required but it's not installed - " +
|
|
|
|
"http://coffeescript.org/ - (try `npm i -g coffee-script`)"
|
|
|
|
end
|
|
|
|
|
2012-02-22 02:27:41 +04:00
|
|
|
puts contents_dir
|
2012-03-01 03:14:56 +04:00
|
|
|
sh "coffee -c #{dest}/src #{dest}/vendor #{dest}/spec"
|
2011-08-27 14:48:00 +04:00
|
|
|
end
|
|
|
|
|
|
|
|
desc "Install the app in /Applications"
|
|
|
|
task :install do
|
|
|
|
rm_rf "/Applications/Atomicity.app"
|
|
|
|
cp_r "Cocoa/build/Debug/Atomicity.app /Applications"
|
|
|
|
end
|
2011-12-24 01:56:53 +04:00
|
|
|
|
2012-01-30 23:03:09 +04:00
|
|
|
desc "Change webkit frameworks to use @rpath as install name"
|
|
|
|
task :"webkit-fix" do
|
|
|
|
for framework in FileList["frameworks/*.framework"]
|
|
|
|
name = framework[/\/([^.]+)/, 1]
|
|
|
|
executable = framework + "/" + name
|
|
|
|
|
|
|
|
`install_name_tool -id @rpath/#{name}.framework/Versions/A/#{name} #{executable}`
|
|
|
|
|
|
|
|
libs = `otool -L #{executable}`
|
|
|
|
for name in ["JavaScriptCore", "WebKit", "WebCore"]
|
|
|
|
_, path, suffix = *libs.match(/\t(\S+(#{name}.framework\S+))/i)
|
|
|
|
`install_name_tool -change #{path} @rpath/../Frameworks/#{suffix} #{executable}` if path
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-12-24 01:56:53 +04:00
|
|
|
desc "Remove any 'fit' or 'fdescribe' focus directives from the specs"
|
|
|
|
task :nof do
|
|
|
|
system %{find . -name *spec.coffee | xargs sed -E -i "" "s/f(it|describe) +(['\\"])/\\1 \\2/g"}
|
|
|
|
end
|
|
|
|
|