---
title: "buildCommand(displayName:executable:arguments:environment:inputFiles:outputFiles:)"
framework: swift-package-manager
role: symbol
role_heading: Type Method
path: "swift-package-manager/documentation/packageplugin/command/buildcommand(displayname:executable:arguments:environment:inputfiles:outputfiles:)-swift.type.method"
---

# 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
static func buildCommand(displayName: String?, executable: Path, arguments: [any CustomStringConvertible], environment: [String : any CustomStringConvertible] = [:], inputFiles: [Path] = [], outputFiles: [Path] = []) -> Command
```

## See Also

### Types of Build Commands

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