func generateSwiftcContext()

in Sources/XCRemoteCache/Commands/SwiftFrontend/SwiftFrontendArgInput.swift [215:243]


    func generateSwiftcContext(config: XCRemoteCacheConfig) throws -> SwiftcContext {
        guard compile != emitModule else {
            throw SwiftFrontendArgInputError.bothCompilationAndEmitAction
        }
        let inputPathsCount = inputPaths.count
        guard inputPathsCount > 0 else {
            throw SwiftFrontendArgInputError.noCompilationInputs
        }
        guard let target = target else {
            throw SwiftFrontendArgInputError.emitMissingTarget
        }
        guard let moduleName = moduleName else {
            throw SwiftFrontendArgInputError.emitMissingModuleName
        }

        if compile {
            return try generateForCompilation(
                config: config,
                target: target,
                moduleName: moduleName
            )
        } else {
            return try generateForEmitModule(
                config: config,
                target: target,
                moduleName: moduleName
            )
        }
    }