krzysztofzablocki / crafter

Crafter - Xcode project configuration CLI made easy.
twitter.com/merowing_
547 stars 35 forks source link

Trouble using Crafter script #13

Closed iCarambaa closed 9 years ago

iCarambaa commented 9 years ago

I tried using the script for Crafter, but it throws an error.

Svens-MacBook-Pro-3:ShakeHands sven$ crafter /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/lib/crafter.rb:57:in set_build_settings': wrong number of arguments (2 for 1) (ArgumentError) from /Users/sven/.crafter.rb:29:inblock in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/lib/crafter.rb:22:in instance_eval' from /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/lib/crafter.rb:22:inconfigure' from /Users/sven/.crafter.rb:4:in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/lib/crafter.rb:122:inload' from /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/lib/crafter.rb:122:in <module:Crafter>' from /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/lib/crafter.rb:13:in<top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /Library/Ruby/Gems/2.0.0/gems/crafter-0.1.39/bin/crafter:13:in <top (required)>' from /usr/bin/crafter:23:inload' from /usr/bin/crafter:23:in `

'

iCarambaa commented 9 years ago

just noticed I had the wrong project open, this issue is meant for the script in KZBootstrap

krzysztofzablocki commented 9 years ago

can you show me your ~/crafter.rb contents?

iCarambaa commented 9 years ago
# All your configuration should happen inside configure block
Crafter.configure do

    # This are projects wide instructions
    add_platform({:platform => :ios, :deployment => 7.0})
    add_git_ignore
    duplicate_configurations({:adhoc => :release})

    # set of options, warnings, static analyser and anything else normal xcode treats as build options
    set_options %w(
                   RUN_CLANG_STATIC_ANALYZER
                   GCC_TREAT_WARNINGS_AS_ERRORS
                   )

                   set_build_settings({
                                      :'WARNING_CFLAGS' => %w(
                                                              -Weverything
                                                              -Wno-objc-missing-property-synthesis
                                                              -Wno-unused-macros
                                                              -Wno-disabled-macro-expansion
                                                              -Wno-gnu-statement-expression
                                                              -Wno-language-extension-token
                                                              -Wno-overriding-method-mismatch
                                                              ).join(" ")
                                      })

                                      set_build_settings({
                                                         :'BUNDLE_ID_SUFFIX' => '.dev',
                                                         :'BUNDLE_DISPLAY_NAME_SUFFIX' => 'dev',
                                                         :'KZBEnv' => 'QA'
                                                         }, configuration: :debug)

                                                         set_build_settings({
                                                                            :'BUNDLE_ID_SUFFIX' => '.adhoc',
                                                                            :'BUNDLE_DISPLAY_NAME_SUFFIX' => 'adhoc',
                                                                            :'KZBEnv' => 'QA'
                                                                            }, configuration: :adhoc)

                                                                            set_build_settings({
                                                                                               :'BUNDLE_ID_SUFFIX' => '',
                                                                                               :'BUNDLE_DISPLAY_NAME_SUFFIX' => '',
                                                                                               :'KZBEnv' => 'PRODUCTION'
                                                                                               }, configuration: :release)

                                                                                               # CUSTOM: Modify plist file to include suffix and displayname
                                                                                               # CUSTOM: Add empty KZBootstrapUserMacros.h file to your project and .gitignore
                                                                                               # CUSTOM: Add KZBEnvironments.plist with list of your environments under KZBEnvironments key

end
krzysztofzablocki commented 9 years ago

can you try gem uninstall crafter gem install crafter gem list crafter you should have version 1.6, then try running crafter again

iCarambaa commented 9 years ago

ok now it worked, not sure what was wrong. But i had to use sudo.

krzysztofzablocki commented 9 years ago

Glad to hear it works now :+1: I forgot to yank old gem version