igor-makarov / xcake

:cake: Describe Xcode projects in a human readable format and (re)generate one on demand.
MIT License
634 stars 48 forks source link

Shell script build phase broke (0.8.0) #134

Closed eiditakahashi closed 7 years ago

eiditakahashi commented 7 years ago

I have this script in my Cakefile that was working fine with 0.6.25 and 0.7.1

target.shell_script_build_phase "Run SwiftLint script", <<-SCRIPT
      if which swiftlint >/dev/null; then
        swiftlint
      else
        echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
      fi
  SCRIPT

after updating to 0.8.0 xcake make fail:

- Adding "BuildPhase<Run SwiftLint script>" to Target<testTests>
/Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/build_phase/shell_script_build_phase.rb:16:in `configure_native_build_phase': undefined method `name=' for <PBXFrameworksBuildPhase UUID=`23E7F839D935E0B6456C482E`>:Xcodeproj::Project::Object::PBXFrameworksBuildPhase (NoMethodError)
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/generator/target_build_phase_generator.rb:19:in `block in visit_target'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/generator/target_build_phase_generator.rb:15:in `each'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/generator/target_build_phase_generator.rb:15:in `visit_target'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/visitor.rb:45:in `visit'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/project.rb:83:in `block in accept'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/project.rb:82:in `each'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/project.rb:82:in `accept'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/command/make.rb:25:in `block in run'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/command/make.rb:23:in `each'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/lib/xcake/command/make.rb:23:in `run'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
    from /Users/user/.rvm/gems/ruby-2.2.1/gems/xcake-0.8.0/bin/xcake:6:in `<top (required)>'
    from /Users/user/.rvm/gems/ruby-2.2.1/bin/xcake:23:in `load'
    from /Users/user/.rvm/gems/ruby-2.2.1/bin/xcake:23:in `<main>'
    from /Users/user/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/user/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Do I have to set another configuration with 0.8.0 ? If you need a test project you can use this https://www.dropbox.com/s/4i0h4jv580mps7c/test.zip?dl=0 just need to update version in Gemfile

jcampbell05 commented 7 years ago

@eiditakahashi Good catch, this should be fixed in 0.8.1, let me know if this fixes it

eiditakahashi commented 7 years ago

@jcampbell05 Fixed! Thanks!