use @defined :
module XXX::YYY
...
end
use @referred :
class ZZZ
include XXX::YYY
...
end
add the value to @defined and @referred both,
because build system will cut the cyclic references.
This changing will introduce:
1. When run 'rake clean', the object files of gem is not removed. To reduce the time when rebuild the project.
2. Across multiple projects that use the same gem, this changing will share the object files.
3. When update RubyMotion with 'motion update', it will remove the object files to clean up disk space.
http://hipbyte.myjetbrains.com/youtrack/issue/RM-112
1) specify file dependencies in Rakefile with `app.files_dependencies' by user.
2) detect file dependencies by build system
When merge 1) and 2), it might cause a cyclic references.
So, we will use 1) to detect cyclic references.
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'
....
We use rubymotion v1.30 with new automatically detected file dependencies. We have very slow builds (about 30 secs on not cold builds) in project with only 52 ruby files.
After investigating I found that almost all build time rubymotion spend in `Motion::Project::Config#ordered_build_files` (about 24 secs).
`Array#uniq` does exactly what `orderd_build_files` is doing but much much faster.
With this change `Motion::Project::Config#ordered_build_files` takes only about 0.06 secs on my machine.
## before
$ rake spec output=tap
ok 34 - works with Assets
ok 34 - works with hash
…
ok 34 - should work
1..34
# 34 tests, 61 assertions, 0 failures, 0 errors
## after
$ rake spec output=tap
ok 1 - works with Assets
ok 2 - works with hash
…
ok 34 - should work
1..34
# 34 tests, 61 assertions, 0 failures, 0 errors
A following spec will raise an ArgumentError.
describe "Application 'test'" do
it "has one window"
end
`instance_eval' will pass a receiver object into block.
When use a block which created by lambda, it should accept a receiver object as block parameter.
b = lambda { self.upcase }
"test".instance_eval(&b) #=> wrong number of arguments (1 for 0) (ArgumentError)
The files that contains only constants (like a configuration file) have been ignored in detection dependency.
$ cat app/config.rb
USER_NAME = "Watson"
MAIL = "watson1978@gmail.com"