class FWToolkit::Xcode

Public Instance Methods

build(project_dir) click to toggle source
# File lib/fwtoolkit/cli/xcode.rb, line 61
def build(project_dir)
  build_types = ['dev', 'testing', 'release']
  raise Thor::Error, 'Build type should be one of the following: dev, testing, release' unless build_types.include?(options[:type].downcase) 

  Projectfile.load! project_dir
  output_dir = File.join artifacts_dir_for_project(Config.project_name), Projectfile.project_name
  say_status :run, "Compiling the project and putting the output in: #{output_dir}", :blue

  t = XcodeBuild::Tasks::BuildTask.new
  t.invoke_from_within = 'project_dir'
  t.sdk = options[:sdk]
  t.workspace = Projectfile.xcode_workspace
  t.scheme = Projectfile.xcode_scheme[options[:type].to_sym]
  t.formatter = XcodeBuild::Formatters::ProgressFormatter.new
  t.add_build_setting 'CONFIGURATION_BUILD_DIR', output_dir

  if options[:clean]
    FileUtils.rm_rf output_dir
    t.clean!
  end
  options[:archive] ? t.archive! : t.build!
end
new(project_language, project_name, class_prefix, root_dir=File.join(Dir.pwd, project_name)) click to toggle source
# File lib/fwtoolkit/cli/xcode.rb, line 29
def new(project_language, project_name, class_prefix, root_dir=File.join(Dir.pwd, project_name))
  say 'Creating Xcode project'
  destination_root = root_dir

  #raise Thor::Error, "Can't create the project. The directory #{destination_root} already exists" if Dir.exist?(destination_root)

  Projectfile.load_with_config! :project_name => project_name, :class_prefix => class_prefix.upcase

  template_config = { :target_platform => Config.target_platform,
                      :organization_name => Config.organization_name,
                      :project_creator => Config.developer_name } 
  template_config.merge! Projectfile.config 
  template_directory "templates/#{project_language}_project/xcode", destination_root, template_config
end

Private Instance Methods

artifacts_dir_for_project(project_name) click to toggle source
# File lib/fwtoolkit/cli/xcode.rb, line 86
def artifacts_dir_for_project(project_name)
  File.join  Config.artifacts_tmp_dir, project_name
end