Skip to content

Improve build times #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ let package = Package(
],
dependencies: [

// Generate Swift code
.package(
url: "https://github.com/apple/swift-syntax.git",
from: "508.0.1"
),

// Format Swift code
.package(
url: "https://github.com/apple/swift-format.git",
from: "508.0.1"
),

// General algorithms
.package(
url: "https://github.com/apple/swift-algorithms",
Expand Down Expand Up @@ -87,10 +75,6 @@ let package = Package(
.product(name: "OpenAPIKit30", package: "OpenAPIKit"),
.product(name: "Algorithms", package: "swift-algorithms"),
.product(name: "Yams", package: "Yams"),
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "SwiftSyntaxBuilder", package: "swift-syntax"),
.product(name: "SwiftFormat", package: "swift-format"),
.product(name: "SwiftFormatConfiguration", package: "swift-format"),
],
swiftSettings: swiftSettings
),
Expand All @@ -109,8 +93,6 @@ let package = Package(
name: "OpenAPIGeneratorReferenceTests",
dependencies: [
"_OpenAPIGeneratorCore",
.product(name: "SwiftFormat", package: "swift-format"),
.product(name: "SwiftFormatConfiguration", package: "swift-format"),
],
resources: [
.copy("Resources")
Expand Down
25 changes: 0 additions & 25 deletions Sources/_OpenAPIGeneratorCore/Extensions/Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@
//===----------------------------------------------------------------------===//
import Foundation

extension Data {
/// A copy of the data formatted using swift-format.
///
/// Data is assumed to contain Swift code encoded using UTF-8.
///
/// - Throws: When data is not valid UTF-8.
var swiftFormatted: Data {
get throws {
let string = String(decoding: self, as: UTF8.self)
return try Self(string.swiftFormatted.utf8)
}
}
}

extension InMemoryInputFile {
/// Creates a new in-memory file by reading the contents at the specified path.
/// - Parameter url: The path to the file to read.
Expand All @@ -35,17 +21,6 @@ extension InMemoryInputFile {
}
}

extension InMemoryOutputFile {
/// A copy of the file formatted using swift-format.
public var swiftFormatted: InMemoryOutputFile {
get throws {
var new = self
new.contents = try contents.swiftFormatted
return new
}
}
}

/// File handle to stderr.
var stdErrHandle = FileHandle.standardError

Expand Down
57 changes: 0 additions & 57 deletions Sources/_OpenAPIGeneratorCore/Extensions/SwiftFormat.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Sources/_OpenAPIGeneratorCore/GeneratorPipeline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func makeGeneratorPipeline(
parser: any ParserProtocol = YamsParser(),
translator: any TranslatorProtocol = MultiplexTranslator(),
renderer: any RendererProtocol = TextBasedRenderer(),
formatter: @escaping (InMemoryOutputFile) throws -> InMemoryOutputFile = { try $0.swiftFormatted },
formatter: @escaping (InMemoryOutputFile) throws -> InMemoryOutputFile = { $0 },
config: Config,
diagnostics: any DiagnosticCollector
) -> GeneratorPipeline {
Expand Down
Loading