lib/project.rb in distil-0.8.0 vs lib/project.rb in distil-0.8.1
- old
+ new
@@ -18,18 +18,38 @@
option :ignore_warnings, false
option :external_projects
def initialize(project_file, settings)
+ @@current= self
@project_file= File.expand_path(project_file)
Dir.chdir(File.dirname(@project_file))
project_info= YAML.load_file(@project_file)
settings.merge!(project_info)
super(settings)
end
-
+
+ @@current=nil
+ def self.current
+ @@current
+ end
+
+ def find_file(file)
+ return nil if external_projects.nil?
+
+ external_projects.each { |project|
+ path= File.expand_path(File.join(project["include"], file))
+ if (File.exists?(path))
+ source_file= SourceFile.from_path(path)
+ source_file.file_path= file
+ return source_file
+ end
+ }
+ nil
+ end
+
def build_external_projects
projects= external_projects
if (projects.nil?)
@options.external_projects= []
return
@@ -92,11 +112,9 @@
system(build)
Dir.chdir(wd)
}
@options.external_projects= projects
-
- puts "external_projects=#{external_projects.inspect}"
end
def build_targets
@extras.each { |section, value|