Print relative paths when cleaning targets and vendor_projects inside targets

This commit is contained in:
Mark Villacampa
2014-09-01 13:01:48 +02:00
committed by Watson
parent 649fc6d6c2
commit 4023bc4a78
2 changed files with 20 additions and 4 deletions

View File

@@ -296,14 +296,22 @@ EOS
paths.concat(Dir.glob(self.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
App.info 'Delete', relative_path(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."
App.fail "Failed to remove `#{relative_path(p)}'. Please remove this path manually."
end
end
end
def relative_path(path)
if ENV['RM_TARGET_HOST_APP_PATH']
Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(ENV['RM_TARGET_HOST_APP_PATH'])).to_s
else
path
end
end
end
end; end

View File

@@ -51,12 +51,12 @@ module Motion; module Project;
[XcodeBuildDir, 'build', 'build-iPhoneSimulator', 'build-iPhoneOS'].each do |build_dir|
build_dir = File.join(@path, build_dir)
if File.exist?(build_dir)
App.info 'Delete', build_dir
App.info 'Delete', relative_path(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."
App.fail "Failed to remove `#{relative_path(build_dir)}'. Please remove this path manually."
end
end
end
@@ -262,5 +262,13 @@ EOS
end
bs_file
end
def relative_path(path)
if ENV['RM_TARGET_HOST_APP_PATH']
Pathname.new(File.expand_path(path)).relative_path_from(Pathname.new(ENV['RM_TARGET_HOST_APP_PATH'])).to_s
else
path
end
end
end
end; end