spm

Runs Swift Package Manager on your project

spm
Supported platforms ios, android, mac
Author @fjcaetano, @nxtstep

6 Examples

spm
spm(
  command: "build",
  scratch_path: "./build",
  configuration: "release"
)
spm(
  command: "generate-xcodeproj",
  xcconfig: "Package.xcconfig"
)
spm(
  command: "test",
  parallel: true
)
spm(
  simulator: "iphonesimulator"
)
spm(
  simulator: "macosx",
  simulator_arch: "arm64"
)

Parameters

Key Description Default
command The swift command (one of: build, test, clean, reset, update, resolve, generate-xcodeproj, init) build
enable_code_coverage Enables code coverage for the generated Xcode project when using the 'generate-xcodeproj' and the 'test' command
scratch_path Specify build/cache directory [default: ./.build]
parallel Enables running tests in parallel when using the 'test' command false
build_path DEPRECATED! build_path option is deprecated, use scratch_path instead - Specify build/cache directory [default: ./.build]
package_path Change working directory before any other operation
xcconfig Use xcconfig file to override swift package generate-xcodeproj defaults
configuration Build with configuration (debug|release) [default: debug]
disable_sandbox Disable using the sandbox when executing subprocesses false
xcpretty_output Specifies the output type for xcpretty. eg. 'test', or 'simple'
xcpretty_args Pass in xcpretty additional command line arguments (e.g. '--test --no-color' or '--tap --no-utf'), requires xcpretty_output to be specified also
verbose Increase verbosity of informational output false
simulator Specifies the simulator to pass for Swift Compiler (one of: iphonesimulator, macosx)
simulator_arch Specifies the architecture of the simulator to pass for Swift Compiler (one of: x86_64, arm64). Requires the simulator option to be specified also, otherwise, it's ignored arm64

* = default value is dependent on the user's system


Documentation

To show the documentation in your terminal, run

fastlane action spm

CLI

It is recommended to add the above action into your Fastfile, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal

fastlane run spm

To pass parameters, make use of the : symbol, for example

fastlane run spm parameter1:"value1" parameter2:"value2"

It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. param:"1,2,3"). Hashes are not currently supported.

It is recommended to add all fastlane actions you use to your Fastfile.


Source code

This action, just like the rest of fastlane, is fully open source, view the source code on GitHub


Back to actions