diff --git a/fastlane/lib/fastlane/actions/spm.rb b/fastlane/lib/fastlane/actions/spm.rb index ee8df4a0194..3d9e47e0e30 100644 --- a/fastlane/lib/fastlane/actions/spm.rb +++ b/fastlane/lib/fastlane/actions/spm.rb @@ -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] @@ -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", @@ -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", @@ -116,7 +122,7 @@ def self.example_code 'spm', 'spm( command: "build", - build_path: "./build", + scratch_path: "./build", configuration: "release" )', 'spm(