From cd5f87bfac9de3e53d3b980771c310dd05751570 Mon Sep 17 00:00:00 2001 From: Watson Date: Mon, 22 Apr 2013 23:46:41 +0900 Subject: [PATCH] fix a bug in build system where it would cause "stack level too deep" error 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. --- lib/motion/project/builder.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/motion/project/builder.rb b/lib/motion/project/builder.rb index 8f21459c..5a3ecb15 100644 --- a/lib/motion/project/builder.rb +++ b/lib/motion/project/builder.rb @@ -141,8 +141,7 @@ module Motion; module Project; # Resolve file dependencies if config.detect_dependencies == true - deps = Dependency.new(config.files).run - config.dependencies = deps.merge(config.dependencies) + config.dependencies = Dependency.new(config.files, config.dependencies).run end # Feed builders with work. @@ -629,8 +628,9 @@ PLIST @file_paths = [] - def initialize(paths) + def initialize(paths, dependencies) @file_paths = paths.flatten.sort + @dependencies = dependencies end def cyclic?(dependencies, def_path, ref_path) @@ -662,7 +662,7 @@ PLIST end end - dependency = {} + dependency = @dependencies.dup consts_defined.each do |const, def_path| if consts_referred[const] consts_referred[const].each do |ref_path|