---
title: "Command.buildCommand(displayName:executable:arguments:environment:inputFiles:outputFiles:)"
framework: swift-package-manager
role: symbol
role_heading: Case
path: "swift-package-manager/documentation/packageplugin/command/buildcommand(displayname:executable:arguments:environment:inputfiles:outputfiles:)-swift.enum.case"
---

# Command.buildCommand(displayName:executable:arguments:environment:inputFiles:outputFiles:)

Returns a command that runs when any of its output files are needed by the build and are out-of-date.

## Declaration

```swift
case buildCommand(displayName: String?, executable: URL, arguments: [String], environment: [String : String] = [:], inputFiles: [URL] = [], outputFiles: [URL] = [])
```

## Parameters

- `displayName`: An optional string to show in build logs and other status areas.
- `executable`: The absolute path to the executable to invoke.
- `arguments`: The command-line arguments for the executable.
- `environment`: Any environment variable assignments visible to the executable.
- `inputFiles`: A list of files on which the contents of output files may depend. Any paths passed as arguments should typically be passed here as well.
- `outputFiles`: A list of files to be generated or updated by the executable. Any files recognizable by their extension as source files (for example, .swift) are compiled into the target for which this command was generated as if in its source directory; other files are treated as resources as if explicitly listed in Package.swift using .process(...).

## Discussion

Discussion An output file is out-of-date if it doesn’t exist, or if any input files have changed since the command was last run. note: The paths in the list of output files may depend on the list of input file paths, but must not depend on reading the contents of any input files. Use a prebuildCommandif the functionality of your plugin requires you to read the contents of an input file.

## See Also

### Types of Build Commands

- [Command.prebuildCommand(displayName:executable:arguments:environment:outputFilesDirectory:)](swift-package-manager/documentation/packageplugin/command/prebuildcommand(displayname:executable:arguments:environment:outputfilesdirectory:)-swift.enum.case.md)
- [buildCommand(displayName:executable:arguments:environment:inputFiles:outputFiles:)](swift-package-manager/documentation/packageplugin/command/buildcommand(displayname:executable:arguments:environment:inputfiles:outputfiles:)-swift.type.method.md)
- [prebuildCommand(displayName:executable:arguments:environment:outputFilesDirectory:)](swift-package-manager/documentation/packageplugin/command/prebuildcommand(displayname:executable:arguments:environment:outputfilesdirectory:)-swift.type.method.md)
