Revert "use a cached file dependencies in order to reduce the build time"

This reverts commit ee514286cf.

Now, detecting build order is much faster without cache by previous commit.
So, let's revert this commit.
This commit is contained in:
Watson
2014-04-12 13:49:38 +09:00
parent 0f6fe1149d
commit 506f6545f3
2 changed files with 1 additions and 53 deletions

View File

@@ -166,14 +166,7 @@ module Motion; module Project;
# Resolve file dependencies.
if config.detect_dependencies == true
deps = Dependency.new(config.files - config.exclude_from_detect_dependencies, config.dependencies)
deps.cache_path = File.join(objs_build_dir, "dependencies.rb")
config.dependencies = deps.run
unless deps.updated?
config.ordered_build_files = deps.ordered_build_files
end
deps.save_cache(config.ordered_build_files)
config.dependencies = Dependency.new(config.files - config.exclude_from_detect_dependencies, config.dependencies).run
end
parallel = ParallelBuilder.new(objs_build_dir, build_file)
@@ -616,7 +609,6 @@ EOS
require 'ripper'
end
attr_accessor :cache_path
@file_paths = []
def initialize(paths, dependencies)
@@ -671,49 +663,9 @@ EOS
end
end
@dependencies = dependency
return dependency
end
def updated?
return true unless File.exist?(@cache_path)
begin
require @cache_path
if @dependencies != cached_dependencies
return true
end
rescue
end
false
end
def ordered_build_files
return nil unless File.exist?(@cache_path)
begin
require @cache_path
cached_ordered_build_files
rescue
nil
end
end
def save_cache(ordered_build_files)
begin
File.open(@cache_path, 'w') { |io|
methods =
"module Motion; module Project; class Dependency;\n" +
"def cached_dependencies; " + @dependencies.inspect + "; end\n" +
"def cached_ordered_build_files; " + ordered_build_files.inspect + "; end\n" +
"end; end; end"
io.write(methods)
}
rescue
end
end
class Constant < Ripper::SexpBuilder
attr_accessor :defined
attr_accessor :referred

View File

@@ -254,10 +254,6 @@ module Motion; module Project
end
end
def ordered_build_files=(order)
@ordered_build_files ||= order
end
def spec_core_files
@spec_core_files ||= begin
# Core library + core helpers.