lib/project.rb in distil-0.8.2 vs lib/project.rb in distil-0.8.4

- old
+ new

@@ -1,11 +1,12 @@ require "#{$script_dir}/target" require 'yaml' class Project < Configurable - + attr_reader :project_file + option :tasks, Array option_alias :tasks, :task option :version, String option :project_name, String @@ -17,10 +18,16 @@ option :mode option :ignore_warnings, false option :external_projects + option :distileries, Array + option_alias :distileries, :distilleries + option_alias :distileries, :distilery + option_alias :distileries, :distillery + + def initialize(project_file, settings) @@current= self @project_file= File.expand_path(project_file) Dir.chdir(File.dirname(@project_file)) @@ -46,9 +53,32 @@ end } nil end + def build + load_distileries + build_external_projects + build_targets + end + + def load_distileries + return if distileries.nil? + + distileries.each { |d| + if (File.exists?(d)) + require d + next + end + path= Gem.required_location(d, 'distilery.rb') + if (path.nil?) + puts "Missing distilery: #{d}" + end + next if path.nil? + require path + } + end + def build_external_projects projects= external_projects if (projects.nil?) @options.external_projects= [] return