 	}
 }
 
+/// Configures a build with Xcode.
+public struct BuildArguments {
+	/// The project to build.
+	public let project: ProjectLocator
+
+	/// The scheme to build in the project.
+	public let scheme: String?
+
+	/// The configuration to use when building the project.
+	public let configuration: String?
+
+	/// The platform to build for.
+	public let platform: Platform?
+
+	public init(project: ProjectLocator, scheme: String? = nil, configuration: String? = nil, platform: Platform? = nil) {
+		self.project = project
+		self.scheme = scheme
+		self.configuration = configuration
+		self.platform = platform
+	}
+
+	/// The `xcodebuild` invocation corresponding to the receiver.
+	private var arguments: [String] {
+		var args = [ "xcodebuild" ] + project.arguments
+
+		if let scheme = scheme {
+			args += [ "-scheme", scheme ]
+		}
+
+		if let configuration = configuration {
+			args += [ "-configuration", configuration ]
+		}
+
+		if let platform = platform {
+			args += platform.arguments
+		}
+
+		return args
+	}
+}
+
+extension BuildArguments: Printable {
+	public var description: String {
+		return " ".join(arguments)
+	}
+}
+
 /// A candidate match for a project's canonical `ProjectLocator`.
 private struct ProjectEnumerationMatch: Comparable {
 	let locator: ProjectLocator

/// If the platform is unrecognized or could not be determined, an error will be
/// sent on the returned signal.
public func platformForScheme(scheme: String, inProject project: ProjectLocator) -> ColdSignal<Platform> {
	return valueForBuildSetting("PLATFORM_NAME", withScheme: scheme, inProject: project).tryMap(Platform.fromString)
}

/// Builds one scheme of the given project, for all supported platforms.

	}

	let buildPlatform = { (platform: Platform?) -> ColdSignal<NSData> in
		var buildScheme = xcodebuildTask("build", BuildArguments(project: project, platform: platform, scheme: scheme, configuration: configuration))
		buildScheme.workingDirectoryPath = workingDirectoryURL.path!

		return launchTask(buildScheme, standardOutput: stdoutSink)
