mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-03-29 22:43:28 +08:00
[rake] Raise error if cleaning does not succeed.
Fixes https://hipbyte.freshdesk.com/helpdesk/tickets/1359.
This commit is contained in:
1
NEWS
1
NEWS
@@ -18,6 +18,7 @@
|
||||
released.
|
||||
* Fixed a bug in dispatcher where #super cannot look up the shortcut method.
|
||||
(ie #foo=)
|
||||
* Raise error if cleaning a build artefact fails.
|
||||
* [iOS] Fixed a bug where `rake device' would no longer print the application
|
||||
logs from the device.
|
||||
* [OSX] Fixed a bug on OSX platform where compiler flags for iOS are passed
|
||||
|
||||
@@ -40,14 +40,19 @@ system("/usr/bin/ruby \"#{motion_bin_path}\" update --check")
|
||||
|
||||
desc "Clear local build objects"
|
||||
task :clean do
|
||||
App.info 'Delete', App.config.build_dir
|
||||
rm_rf(App.config.build_dir)
|
||||
App.config.vendor_projects.each { |vendor| vendor.clean }
|
||||
Dir.glob(App.config.resources_dirs.flatten.map{ |x| x + '/**/*.{nib,storyboardc,momd}' }).each do |p|
|
||||
paths = [App.config.build_dir]
|
||||
paths.concat(Dir.glob(App.config.resources_dirs.flatten.map{ |x| x + '/**/*.{nib,storyboardc,momd}' }))
|
||||
paths.each do |p|
|
||||
next if File.extname(p) == ".nib" && !File.exist?(p.sub(/\.nib$/, ".xib"))
|
||||
App.info 'Delete', p
|
||||
rm_rf p
|
||||
if File.exist?(p)
|
||||
# It can happen that because of file permissions a dir/file is not
|
||||
# actually removed, which can lead to confusing issues.
|
||||
App.fail "Failed to remove `#{p}'. Please remove this path manually."
|
||||
end
|
||||
end
|
||||
App.config.vendor_projects.each { |vendor| vendor.clean }
|
||||
end
|
||||
|
||||
namespace :clean do
|
||||
|
||||
@@ -52,6 +52,11 @@ module Motion; module Project;
|
||||
if File.exist?(build_dir)
|
||||
App.info 'Delete', build_dir
|
||||
FileUtils.rm_rf build_dir
|
||||
if File.exist?(build_dir)
|
||||
# It can happen that because of file permissions a dir/file is not
|
||||
# actually removed, which can lead to confusing issues.
|
||||
App.fail "Failed to remove `#{build_dir}'. Please remove this path manually."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user