From a79c7e3d270790f1913a73cc9245e27bd9a1ec72 Mon Sep 17 00:00:00 2001 From: Steven Webb Date: Wed, 20 Feb 2013 12:20:39 +0800 Subject: [PATCH 1/9] Include exception message in bacon error output --- lib/motion/spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/motion/spec.rb b/lib/motion/spec.rb index d1f125be..44bb31ac 100644 --- a/lib/motion/spec.rb +++ b/lib/motion/spec.rb @@ -413,10 +413,10 @@ module Bacon @error = if e.kind_of? Error Counter[e.count_as] += 1 - e.count_as.to_s.upcase + "#{e.count_as.to_s.upcase} - #{e}" else Counter[:errors] += 1 - "ERROR: #{e.class}" + "ERROR: #{e.class} - #{e}" end end end From 355cb36f1f7ad5b82b36d8530a4cf9554031d34e Mon Sep 17 00:00:00 2001 From: Dave Lee Date: Wed, 13 Mar 2013 11:46:34 -0600 Subject: [PATCH 2/9] Make _spec suffix optional when running `rake spec files=...` With this change, the following invocations are equivalent: rake spec files=integration_spec and rake spec files=integration --- lib/motion/project/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index d6d26ee8..2fd3f81f 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -379,7 +379,7 @@ EOS # Filter specs we want to run. A filter can be either the basename of a spec file or its path. files_filter = files_filter.split(',') files_filter.map! { |x| File.exist?(x) ? File.expand_path(x) : x } - specs.delete_if { |x| !files_filter.include?(File.expand_path(x)) and !files_filter.include?(File.basename(x, '.rb')) } + specs.delete_if { |x| [File.expand_path(x), File.basename(x, '.rb'), File.basename(x, '_spec.rb')].none? { |p| files_filter.include?(p) } } end core + helpers + specs end From 9e8c1fa14cef1c44fe4be22265848bf938656cda Mon Sep 17 00:00:00 2001 From: Watson Date: Thu, 14 Mar 2013 13:40:24 +0900 Subject: [PATCH 3/9] sync --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index d244a1fe..f9f21ffa 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,10 @@ * Fixed a bug in REPL which often causes an error with "quit" command. * Fixed a bug which AVPlayer#currentTime causes `{?=qiIq}@:' not precompiled' error. + * Improved `rake spec' error message to include the details. Thanks to + Steven Webb for pull request #68. + * Improved `rake spec files=...' to make _spec suffix optional. Thanks to + Dave Lee for pull request #71. = RubyMotion 1.34 = From 1f25be21f3a0ad46c4a0e178737b0debacd07072 Mon Sep 17 00:00:00 2001 From: Watson Date: Thu, 14 Mar 2013 18:31:10 +0900 Subject: [PATCH 4/9] sync --- NEWS | 1 + vm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index f9f21ffa..8d2ae0a4 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,7 @@ Steven Webb for pull request #68. * Improved `rake spec files=...' to make _spec suffix optional. Thanks to Dave Lee for pull request #71. + * Fixed a bug where it caused a crash when use AudioQueueBuffer structure. = RubyMotion 1.34 = diff --git a/vm b/vm index 650025de..16cdc9cd 160000 --- a/vm +++ b/vm @@ -1 +1 @@ -Subproject commit 650025de0abc8137b9c57fe142812f60d71eb84d +Subproject commit 16cdc9cd3ed13f74c0f4937f87a486af567f9238 From 4d5215a07c168985536330856bc29a2f531e252f Mon Sep 17 00:00:00 2001 From: Watson Date: Fri, 15 Mar 2013 11:05:17 +0900 Subject: [PATCH 5/9] add :force_load option into configuration of `app.vendor_project' There are 3rd-party library which would trigger "duplicate symbol" error at compile time. It will be useful in such libraries when specify false in :force_load option. When specify true in this option (by default), it behaves in the same manner as before. Usage: app.vendor_project('vendor/OAuth2Client', :static, :force_load => false, :headers_dir => 'Sources/OAuth2Client' .... --- lib/motion/project/builder.rb | 7 ++++++- lib/motion/project/config.rb | 1 + lib/motion/project/vendor.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/motion/project/builder.rb b/lib/motion/project/builder.rb index 8cdc675d..b2050854 100644 --- a/lib/motion/project/builder.rb +++ b/lib/motion/project/builder.rb @@ -385,7 +385,12 @@ EOS framework_search_paths = config.framework_search_paths.map { |x| "-F#{File.expand_path(x)}" }.join(' ') frameworks = config.frameworks_dependencies.map { |x| "-framework #{x}" }.join(' ') weak_frameworks = config.weak_frameworks.map { |x| "-weak_framework #{x}" }.join(' ') - sh "#{cxx} -o \"#{main_exec}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lmacruby-static -lobjc -licucore #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs.map { |x| '-force_load "' + x + '"' }.join(' ')}" + vendor_libs = config.vendor_projects.inject([]) do |libs, vendor_project| + libs << vendor_project.libs.map { |x| + (vendor_project.opts[:force_load] ? '-force_load ' : '') + "\"#{x}\"" + } + end.join(' ') + sh "#{cxx} -o \"#{main_exec}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lmacruby-static -lobjc -licucore #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}" main_exec_created = true end diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index 2fd3f81f..b1adc390 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -291,6 +291,7 @@ EOS attr_reader :vendor_projects def vendor_project(path, type, opts={}) + opts[:force_load] = true unless opts[:force_load] == false @vendor_projects << Motion::Project::Vendor.new(path, type, self, opts) end diff --git a/lib/motion/project/vendor.rb b/lib/motion/project/vendor.rb index f6887394..d7a70ae5 100644 --- a/lib/motion/project/vendor.rb +++ b/lib/motion/project/vendor.rb @@ -34,7 +34,7 @@ module Motion; module Project; @bs_files = [] end - attr_reader :path, :libs, :bs_files + attr_reader :path, :libs, :bs_files, :opts def build(platform) App.info 'Build', @path From 150cdde332b777a7b068515cc47671d6004815d3 Mon Sep 17 00:00:00 2001 From: Watson Date: Fri, 15 Mar 2013 11:17:18 +0900 Subject: [PATCH 6/9] add line in NEWS --- NEWS | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NEWS b/NEWS index 8d2ae0a4..94591d94 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,11 @@ * Improved `rake spec files=...' to make _spec suffix optional. Thanks to Dave Lee for pull request #71. * Fixed a bug where it caused a crash when use AudioQueueBuffer structure. + * Added :force_load option into configuration of `app.vendor_project'. There + are 3rd-party library which would trigger "duplicate symbol" error at + compile time. It will be useful in such libraries when specify false in + :force_load option (by default true). + EX) app.vendor_project('path/to/lib', :static, :force_load => false, ...) = RubyMotion 1.34 = From 59aca119f8136ab18c3148048ab036a2e7d932d1 Mon Sep 17 00:00:00 2001 From: Watson Date: Fri, 15 Mar 2013 17:03:04 +0900 Subject: [PATCH 7/9] add spec to relate AudioQueueBuffer (https://github.com/lrz/RubyMotionVM/commit/16cdc9cd3ed13f74c0f4937f87a486af567f9238) --- test/test/spec/boxed_spec.rb | 5 +++++ test/test/vendor/code/code.h | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 test/test/spec/boxed_spec.rb diff --git a/test/test/spec/boxed_spec.rb b/test/test/spec/boxed_spec.rb new file mode 100644 index 00000000..c89da6f1 --- /dev/null +++ b/test/test/spec/boxed_spec.rb @@ -0,0 +1,5 @@ +describe "Boxed" do + it ".type should work with structure which has field of structure pointer" do + MyStructHasStructPointer.type.should == "{MyStructHasStructPointer=^{MyStruct4C}}" + end +end diff --git a/test/test/vendor/code/code.h b/test/test/vendor/code/code.h index 6e1e8a7a..c959dd08 100644 --- a/test/test/vendor/code/code.h +++ b/test/test/vendor/code/code.h @@ -4,6 +4,10 @@ struct MyStruct4C { char a, b, c, d; }; +struct MyStructHasStructPointer { + struct MyStruct4C *field; +}; + typedef id (^MyBlock)(void); @protocol TestProtocol From 61b94316f3404e3cb75477b1c7d17e805d8b0da8 Mon Sep 17 00:00:00 2001 From: Watson Date: Sat, 16 Mar 2013 14:44:09 +0900 Subject: [PATCH 8/9] pass "-ObjC" flags to linker to load Objective-C class when "-force_load" is not used --- lib/motion/project/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/motion/project/builder.rb b/lib/motion/project/builder.rb index b2050854..d424bba4 100644 --- a/lib/motion/project/builder.rb +++ b/lib/motion/project/builder.rb @@ -387,7 +387,7 @@ EOS weak_frameworks = config.weak_frameworks.map { |x| "-weak_framework #{x}" }.join(' ') vendor_libs = config.vendor_projects.inject([]) do |libs, vendor_project| libs << vendor_project.libs.map { |x| - (vendor_project.opts[:force_load] ? '-force_load ' : '') + "\"#{x}\"" + (vendor_project.opts[:force_load] ? '-force_load ' : '-ObjC ') + "\"#{x}\"" } end.join(' ') sh "#{cxx} -o \"#{main_exec}\" #{objs_list} #{config.ldflags(platform)} -L#{File.join(datadir, platform)} -lmacruby-static -lobjc -licucore #{framework_search_paths} #{frameworks} #{weak_frameworks} #{config.libs.join(' ')} #{vendor_libs}" From a44231b0ec9ef32eb477992c73b9b60144cd826a Mon Sep 17 00:00:00 2001 From: Watson Date: Sun, 17 Mar 2013 20:13:57 +0900 Subject: [PATCH 9/9] sync --- NEWS | 1 + vm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 94591d94..be1b17e3 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,7 @@ compile time. It will be useful in such libraries when specify false in :force_load option (by default true). EX) app.vendor_project('path/to/lib', :static, :force_load => false, ...) + * Added Dir#to_path method for CRuby compatibility. = RubyMotion 1.34 = diff --git a/vm b/vm index 16cdc9cd..ab28b648 160000 --- a/vm +++ b/vm @@ -1 +1 @@ -Subproject commit 16cdc9cd3ed13f74c0f4937f87a486af567f9238 +Subproject commit ab28b6483e70a25141716a48a0969068c6d5205a