Sha256: 164b507871272b5a9a0655fd8c3fcf722158f22e14a69c3e0e229dc0a159739f
Contents?: true
Size: 1.54 KB
Versions: 11
Compression:
Stored size: 1.54 KB
Contents
require 'yaml' require 'fwtoolkit/configfile' module FWToolkit module Projectfile extend self #singleton extend FWToolkit::ConfigFile def load!(project_root) load_config! projectfile_for_root(project_root) merge_config defaults_with_config(@config) end def load_with_config!(config) load_config_hash! config merge_config defaults_with_config(config) end 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 def projectfile_for_root(project_root) File.join project_root, 'FWProjectFile' end 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 end end
Version data entries
11 entries across 11 versions & 1 rubygems