Skip to content

Commit

Permalink
[action][spm] deprecate build_path option in favor of `scratch_path…
Browse files Browse the repository at this point in the history
…`, as recommended by Swift CLI (fastlane#20814)

* Deprecate spm's build_path option

* Add deprecated message when use build_path on spm action

Co-authored-by: Josh Holtz <me@joshholtz.com>

* Remove unnecessary warning message

---------

Co-authored-by: Josh Holtz <me@joshholtz.com>
Co-authored-by: Jerome Lacoste <jerome.lacoste@gmail.com>
  • Loading branch information
3 people authored and SubhrajyotiSen committed Jan 17, 2024
1 parent 18cb30c commit 11dcb67
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fastlane/lib/fastlane/actions/spm.rb
Expand Up @@ -5,6 +5,7 @@ def self.run(params)
cmd = ["swift"]

cmd << (package_commands.include?(params[:command]) ? "package" : params[:command])
cmd << "--scratch-path #{params[:scratch_path]}" if params[:scratch_path]
cmd << "--build-path #{params[:build_path]}" if params[:build_path]
cmd << "--package-path #{params[:package_path]}" if params[:package_path]
cmd << "--configuration #{params[:configuration]}" if params[:configuration]
Expand Down Expand Up @@ -51,6 +52,10 @@ def self.available_options
description: "Enables code coverage for the generated Xcode project when using the 'generate-xcodeproj' and the 'test' command",
type: Boolean,
optional: true),
FastlaneCore::ConfigItem.new(key: :scratch_path,
env_name: "FL_SPM_SCRATCH_PATH",
description: "Specify build/cache directory [default: ./.build]",
optional: true),
FastlaneCore::ConfigItem.new(key: :parallel,
env_name: "FL_SPM_PARALLEL",
description: "Enables running tests in parallel when using the 'test' command",
Expand All @@ -59,6 +64,7 @@ def self.available_options
FastlaneCore::ConfigItem.new(key: :build_path,
env_name: "FL_SPM_BUILD_PATH",
description: "Specify build/cache directory [default: ./.build]",
deprecated: "`build_path` option is deprecated, use `scratch_path` instead",
optional: true),
FastlaneCore::ConfigItem.new(key: :package_path,
env_name: "FL_SPM_PACKAGE_PATH",
Expand Down Expand Up @@ -116,7 +122,7 @@ def self.example_code
'spm',
'spm(
command: "build",
build_path: "./build",
scratch_path: "./build",
configuration: "release"
)',
'spm(
Expand Down

0 comments on commit 11dcb67

Please sign in to comment.