@@ -76,10 +76,11 @@ type Inputs struct {
7676 ExportMethod string `env:"distribution_method,opt[app-store,ad-hoc,enterprise,development]"`
7777
7878 // xcodebuild configuration
79- Configuration string `env:"configuration"`
80- XcconfigContent string `env:"xcconfig_content"`
81- PerformCleanAction bool `env:"perform_clean_action,opt[yes,no]"`
82- XcodebuildOptions string `env:"xcodebuild_options"`
79+ Configuration string `env:"configuration"`
80+ ShouldLockSwiftPackages bool `env:"lock_swift_packages,opt[yes,no]"`
81+ XcconfigContent string `env:"xcconfig_content"`
82+ PerformCleanAction bool `env:"perform_clean_action,opt[yes,no]"`
83+ XcodebuildOptions string `env:"xcodebuild_options"`
8384
8485 // xcodebuild log formatting
8586 LogFormatter string `env:"log_formatter,opt[xcbeautify,xcodebuild,xcpretty]"`
@@ -319,6 +320,8 @@ type RunOpts struct {
319320 XcodeMajorVersion int
320321 ArtifactName string
321322
323+ ShouldLockSwiftPackages bool
324+
322325 // Code signing, nil if automatic code signing is "off"
323326 CodesignManager * codesign.Manager
324327
@@ -361,6 +364,13 @@ func (s XcodebuildArchiver) Run(opts RunOpts) (RunResult, error) {
361364 s .logger .Println ()
362365
363366 if opts .XcodeMajorVersion >= 11 {
367+ if opts .ShouldLockSwiftPackages {
368+ s .logger .Infof ("Swift package dependencies are locked, disabling automatic updates" )
369+ if err := lockSwiftPackages (s .logger , s .cmdFactory ); err != nil {
370+ return out , fmt .Errorf ("failed to lock swift packages: %w" , err )
371+ }
372+ }
373+
364374 s .logger .Infof ("Running resolve Swift package dependencies" )
365375 // Resolve Swift package dependencies, so running -showBuildSettings later is faster later
366376 // Specifying a scheme is required for workspaces
0 commit comments