File tree Expand file tree Collapse file tree 6 files changed +24
-41
lines changed
_OpenAPIGeneratorCore/Extensions Expand file tree Collapse file tree 6 files changed +24
-41
lines changed Original file line number Diff line number Diff line change 1313//===----------------------------------------------------------------------===//
1414import Foundation
1515
16+ #if compiler(>=5.11)
17+ extension FileHandle : @retroactive TextOutputStream { }
18+ #else
19+ extension FileHandle : TextOutputStream { }
20+ #endif
21+
1622extension InMemoryInputFile {
1723 /// Creates a new in-memory file by reading the contents at the specified path.
1824 /// - Parameter url: The path to the file to read.
@@ -23,7 +29,7 @@ extension InMemoryInputFile {
2329/// File handle to stderr.
2430let stdErrHandle = FileHandle . standardError
2531
26- extension FileHandle : TextOutputStream {
32+ extension FileHandle {
2733 /// Writes the given string to the file handle.
2834 ///
2935 /// This method writes the provided string to the file handle using its UTF-8
Original file line number Diff line number Diff line change @@ -16,7 +16,17 @@ import ArgumentParser
1616import _OpenAPIGeneratorCore
1717import Yams
1818
19- extension URL : ExpressibleByArgument {
19+ #if compiler(>=5.11)
20+ extension URL : @retroactive ExpressibleByArgument { }
21+ extension GeneratorMode : @retroactive ExpressibleByArgument { }
22+ extension FeatureFlag : @retroactive ExpressibleByArgument { }
23+ #else
24+ extension URL : ExpressibleByArgument { }
25+ extension GeneratorMode : ExpressibleByArgument { }
26+ extension FeatureFlag : ExpressibleByArgument { }
27+ #endif
28+
29+ extension URL {
2030
2131 /// Creates a `URL` instance from a string argument.
2232 ///
@@ -25,9 +35,6 @@ extension URL: ExpressibleByArgument {
2535 public init ? ( argument: String ) { self . init ( fileURLWithPath: argument) }
2636}
2737
28- extension GeneratorMode : ExpressibleByArgument { }
29- extension FeatureFlag : ExpressibleByArgument { }
30-
3138extension CaseIterable where Self: RawRepresentable , Self. RawValue == String {
3239
3340 /// A string representation of the raw values of all the cases,
Original file line number Diff line number Diff line change @@ -11,10 +11,7 @@ services:
1111 image : *image
1212 environment :
1313 - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
14- # SwiftSyntax currently imports a module it does not explicitly depend
15- # on and so we must disable this for the time being.
16- # - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
14+ - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
1715 - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
18-
1916 shell :
2017 image : *image
Original file line number Diff line number Diff line change @@ -11,20 +11,8 @@ services:
1111 test :
1212 image : *image
1313 environment :
14- # Because OpenAPI supports deprecation, the generated code could include
15- # deprecated symbols, which will produce warnings.
16- #
17- # We'll disable -warnings-as-errors for now and revisit this when we
18- # refactor the compilation of the generated code into a separate
19- # pipeline.
20- #
21- # - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
22-
23- # SwiftSyntax currently imports a module it does not explicitly depend
24- # on and so we must disable this for the time being.
25- # - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
26-
14+ - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
15+ - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
2716 - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
28-
2917 shell :
3018 image : *image
Original file line number Diff line number Diff line change @@ -12,10 +12,7 @@ services:
1212 image : *image
1313 environment :
1414 - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
15- # SwiftSyntax currently imports a module it does not explicitly depend
16- # on and so we must disable this for the time being.
17- # - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
15+ - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
1816 - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
19-
2017 shell :
2118 image : *image
Original file line number Diff line number Diff line change @@ -11,20 +11,8 @@ services:
1111 test :
1212 image : *image
1313 environment :
14- # Because OpenAPI supports deprecation, the generated code could include
15- # deprecated symbols, which will produce warnings.
16- #
17- # We'll disable -warnings-as-errors for now and revisit this when we
18- # refactor the compilation of the generated code into a separate
19- # pipeline.
20- #
21- # - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
22-
23- # SwiftSyntax currently imports a module it does not explicitly depend
24- # on and so we must disable this for the time being.
25- # - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
26-
14+ - WARN_AS_ERROR_ARG=-Xswiftc -warnings-as-errors
15+ - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
2716 - STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
28-
2917 shell :
3018 image : *image
You can’t perform that action at this time.
0 commit comments