Sha256: b84c6c2c47a7581e63b27a2c330dadd12001583602c963db2e25effd35be08af

Contents?: true

Size: 897 Bytes

Versions: 2

Compression:

Stored size: 897 Bytes

Contents

require 'xcodeproj'

module Redbreast
    module Command
      class ConfigurationInstaller
        include Helper::Terminal
        include Helper::General
  
        def self.init
          new.call
        end
  
        def call
          prompt.say("Adding generation script to xcode buid phases...")
          project = fetch_project
          configure_target project.targets.first
          project.save()
          success("Build phase setup!")
        end
  
        private
  
        def fetch_project()
            path = Dir.glob("*.xcodeproj").first
            raise ".xcodeproj file not found" if path.nil?
            project = Xcodeproj::Project.open(path)
        end

        def configure_target(target)
            phase = target.new_shell_script_build_phase("Redbreast generate")
            phase.shell_script = "redbreast generate"
        end

      end
    end
  end
  

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redbreast-0.1.2 lib/redbreast/commands/configuration_installer.rb
redbreast-0.1.1 lib/redbreast/commands/configuration_installer.rb