[Vendor] Always clean all build dirs, including actual object files.

No need to do it differently for different types of vendoring.
This commit is contained in:
Eloy Durán
2013-10-07 14:25:22 +02:00
parent 8ccae2a80a
commit 66cd19211d
2 changed files with 11 additions and 18 deletions

2
NEWS
View File

@@ -14,6 +14,8 @@
Kazuhiro NISHIYAMA for the detective work.
* Fixed a bug where a boxed struct would incorrectly be interpreted as a
object type, leading to the dispatcher not recognizing a signature.
* Fixed a bug where compiled object files of a vendored project were not
actually being cleaned when running `rake clean.
= RubyMotion 2.10 =

View File

@@ -25,6 +25,8 @@ module Motion; module Project;
class Vendor
include Rake::DSL if Rake.const_defined?(:DSL)
XcodeBuildDir = '.build'
def initialize(path, type, config, opts)
@path = path.to_s
@type = type
@@ -45,7 +47,13 @@ module Motion; module Project;
end
def clean
send gen_method('clean')
[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
FileUtils.rm_rf build_dir
end
end
end
def build_static(platform, opts)
@@ -132,17 +140,6 @@ EOS
end
end
def clean_static
['iPhoneSimulator', 'iPhoneOS'].each do |platform|
build_dir = File.join(@path, "build-#{platform}")
if File.exist?(build_dir)
App.info 'Delete', build_dir
FileUtils.rm_rf build_dir
end
end
end
XcodeBuildDir = '.build'
def build_xcode(platform, opts)
Dir.chdir(@path) do
build_dir = "build-#{platform}"
@@ -207,12 +204,6 @@ EOS
end
end
def clean_xcode
Dir.chdir(@path) do
[XcodeBuildDir, 'build-iPhoneOS', 'build-iPhoneSimulator'].each { |x| rm_rf x }
end
end
private
def gen_method(prefix)