File tree 6 files changed +24
-41
lines changed
_OpenAPIGeneratorCore/Extensions 6 files changed +24
-41
lines changed Original file line number Diff line number Diff line change 13
13
//===----------------------------------------------------------------------===//
14
14
import Foundation
15
15
16
+ #if compiler(>=5.11)
17
+ extension FileHandle : @retroactive TextOutputStream { }
18
+ #else
19
+ extension FileHandle : TextOutputStream { }
20
+ #endif
21
+
16
22
extension InMemoryInputFile {
17
23
/// Creates a new in-memory file by reading the contents at the specified path.
18
24
/// - Parameter url: The path to the file to read.
@@ -23,7 +29,7 @@ extension InMemoryInputFile {
23
29
/// File handle to stderr.
24
30
let stdErrHandle = FileHandle . standardError
25
31
26
- extension FileHandle : TextOutputStream {
32
+ extension FileHandle {
27
33
/// Writes the given string to the file handle.
28
34
///
29
35
/// 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
16
16
import _OpenAPIGeneratorCore
17
17
import Yams
18
18
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 {
20
30
21
31
/// Creates a `URL` instance from a string argument.
22
32
///
@@ -25,9 +35,6 @@ extension URL: ExpressibleByArgument {
25
35
public init ? ( argument: String ) { self . init ( fileURLWithPath: argument) }
26
36
}
27
37
28
- extension GeneratorMode : ExpressibleByArgument { }
29
- extension FeatureFlag : ExpressibleByArgument { }
30
-
31
38
extension CaseIterable where Self: RawRepresentable , Self. RawValue == String {
32
39
33
40
/// 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:
11
11
image : *image
12
12
environment :
13
13
- 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
17
15
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
18
-
19
16
shell :
20
17
image : *image
Original file line number Diff line number Diff line change @@ -11,20 +11,8 @@ services:
11
11
test :
12
12
image : *image
13
13
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
27
16
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
28
-
29
17
shell :
30
18
image : *image
Original file line number Diff line number Diff line change @@ -12,10 +12,7 @@ services:
12
12
image : *image
13
13
environment :
14
14
- 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
18
16
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
19
-
20
17
shell :
21
18
image : *image
Original file line number Diff line number Diff line change @@ -11,20 +11,8 @@ services:
11
11
test :
12
12
image : *image
13
13
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
27
16
- STRICT_CONCURRENCY_ARG=-Xswiftc -strict-concurrency=complete
28
-
29
17
shell :
30
18
image : *image
You can’t perform that action at this time.
0 commit comments