DeployGate / deploygate-cli

A command-line interface for DeployGate
https://deploygate.com
Other
42 stars 9 forks source link

Support manual setting of xcodeproj file path #300

Closed anoworl closed 2 years ago

anoworl commented 2 years ago

When

When the file structure is as follows...

/base_dir/Test/ALib/ALib.xcodeproj/project.xcworkspace
/base_dir/Test/Hoge/Hoge.xcodeproj/project.xcworkspace
/base_dir/Test/Test/Test.xcodeproj/project.xcworkspace -> I want to build
/base_dir/Test/Test.xcworkspace 
/base_dir/Test/ZLib/ZLib.xcodeproj/project.xcworkspace

Before

I executed dg deploy command and got error. Because /base_dir/Test/ZLib/ZLib.xcodeproj is built.

$ cd /base_dir/
$ dg deploy
[21:55:54]: Resolving Swift Package Manager dependencies...
[21:55:54]: $ xcodebuild -resolvePackageDependencies -scheme ZLib -project **/base_dir/Test/ZLib/ZLib.xcodeproj**
...
Error: undefined method `to_sym' for nil:NilClass

------------------------
DeployGate Error Report

Title: undefined method `to_sym' for nil:NilClass
dg version: 0.8.4
Xcode version: 14.0

Stack trace:
/Users/sota/.rvm/gems/ruby-2.6.9/gems/deploygate-0.8.4/lib/deploygate/xcode/analyze.rb:88:in `target_provisioning_profile'
/Users/sota/.rvm/gems/ruby-2.6.9/gems/deploygate-0.8.4/lib/deploygate/commands/deploy/build.rb:50:in `ios'
/Users/sota/.rvm/gems/ruby-2.6.9/gems/deploygate-0.8.4/lib/deploygate/commands/deploy/build.rb:22:in `run'
/Users/sota/.rvm/gems/ruby-2.6.9/gems/deploygate-0.8.4/lib/deploygate/commands/deploy.rb:16:in `run'
/Users/sota/.rvm/gems/ruby-2.6.9/gems/deploygate-0.8.4/lib/deploygate/command_builder.rb:77:in `block (2 levels) in run'
and more ...
------------------------
Do you want to this error report to DeployGate? (y/n) |y|

After

I added xcodeproj option to dg deploy and add-devices commands by this PR. I executed dg deploy command with xcodeproj option and got success!

$ cd /base_dir/
$ dg deploy --xcodeproj ./Test/Test.xcodeproj
[21:57:26]: Resolving Swift Package Manager dependencies...
[21:57:26]: $ xcodebuild -resolvePackageDependencies -scheme Test -project **./Test/Test.xcodeproj**
...
Uploading to xxx....done

Checklist

anoworl commented 2 years ago

Thank you very much!