 	}
 }
 
+/// Determines whether the given scheme should be built automatically.
+private func shouldBuildScheme(buildArguments: BuildArguments) -> ColdSignal<Bool> {
+	precondition(buildArguments.scheme != nil)
+
+	return buildSettings(buildArguments)
+		.map(productType)
+		.merge(identity)
+		.map { type in
+			switch type {
+			case let .Framework:
+				return true
+
+			default:
+				return false
+			}
+		}
+		// If we don't know what type of product is being built, we probably
+		// don't want to build it automatically.
+		.catch { _ in .single(false) }
+}
+
 /// Builds one scheme of the given project, for all supported platforms.
 ///
 /// Returns a signal of all standard output from `xcodebuild`, and a signal


	// TODO: This should probably return a signal-of-signals, so callers can
	// track the starting and stopping of each scheme individually.
	//
	// This will also allow us to remove the event logging from
	// buildInDirectory().
	let buildSignal: ColdSignal<NSURL> = platformForScheme(scheme, inProject: project)
		.map { (platform: Platform) in
			switch platform {

		.merge(identity)
		.combineLatestWith(locatorSignal.take(1))
		.map { (scheme: String, project: ProjectLocator) -> ColdSignal<(ProjectLocator, String)> in
			let buildArguments = BuildArguments(project: project, scheme: scheme, configuration: configuration)

			return shouldBuildScheme(buildArguments)
				.filter { $0 }
				.map { _ in
					let (buildOutput, productURLs) = buildScheme(scheme, withConfiguration: configuration, inProject: project, workingDirectoryURL: directoryURL)

					return ColdSignal.lazy {
						let outputDisposable = buildOutput.observe(stdoutSink)

						return ColdSignal.single((project, scheme))
							.concat(productURLs.then(.empty()))
							.on(disposed: {
								outputDisposable.dispose()
							})
					}
				}
				.merge(identity)
		}

	return (stdoutSignal, schemeSignals)
