module FWToolkit::Projectfile

Public Instance Methods

load!(project_root) click to toggle source
# File lib/fwtoolkit/projectfile.rb, line 10
def load!(project_root)
  load_config! projectfile_for_root(project_root)
  merge_config defaults_with_config(@config)
end
load_with_config!(config) click to toggle source
# File lib/fwtoolkit/projectfile.rb, line 15
def load_with_config!(config)
  load_config_hash! config
  merge_config defaults_with_config(config)
end
validate_config() click to toggle source
# File lib/fwtoolkit/projectfile.rb, line 20
def validate_config
  unless @config.has_key?(:project_name)
    raise NameError, "The project name has to be specified on the configuration file"
  end
end

Private Instance Methods

defaults_with_config(conf_hash) click to toggle source
# File lib/fwtoolkit/projectfile.rb, line 33
def defaults_with_config(conf_hash)
  d = Hash.new
  d[:target_name] = conf_hash[:target_name] || conf_hash[:project_name]
  d[:binary_name] = "#{conf_hash[:project_name]}"
  d[:tests_target_name] = conf_hash[:tests_target_name] || "#{conf_hash[:project_name]}Tests"
  d[:xcode_workspace] = "#{conf_hash[:project_name]}.xcworkspace" 
  d[:xcode_scheme] = { :dev => conf_hash[:project_name], 
                       :testing => "#{conf_hash[:project_name]}-Testing",
                       :release => "#{conf_hash[:project_name]}-Release" }
  d[:xcode_project] = "#{File.join(conf_hash[:project_name], conf_hash[:project_name])}.xcodeproj" 
  d[:source_root] = File.join conf_hash[:project_name], d[:target_name]  
  d[:tests_source_root] = File.join conf_hash[:project_name], d[:tests_target_name] 
  d
end
projectfile_for_root(project_root) click to toggle source
# File lib/fwtoolkit/projectfile.rb, line 29
def projectfile_for_root(project_root)
  File.join project_root, 'FWProjectFile'
end