File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import Foundation
22
3+ // Only available on macOS
4+ #if os(macOS)
5+
36/// Wrapper for calling the bundled node-based Apollo CLI.
4- @available ( OSX, message: " Only available on macOS " )
57public struct ApolloCLI {
68
79 /// Creates an instance of `ApolloCLI`, downloading and extracting if needed
@@ -47,3 +49,5 @@ public struct ApolloCLI {
4749 return try Basher . run ( command: command, from: folder)
4850 }
4951}
52+
53+ #endif
Original file line number Diff line number Diff line change 11import Foundation
22
3+ // Only available on macOS
4+ #if os(macOS)
5+
36/// A class to facilitate running code generation
4- @available ( OSX, message: " Only available on macOS " )
57public class ApolloCodegen {
68
79 /// Errors which can happen with code generation
@@ -42,3 +44,5 @@ public class ApolloCodegen {
4244 return try cli. runApollo ( with: options. arguments, from: folder)
4345 }
4446}
47+
48+ #endif
Original file line number Diff line number Diff line change 11import Foundation
22
3+ // Only available on macOS
4+ #if os(macOS)
5+
36/// A wrapper to facilitate downloading a schema with the Apollo node CLI
4- @available ( OSX, message: " Only available on macOS " )
57public struct ApolloSchemaDownloader {
68
79 /// Runs code generation from the given folder with the passed-in options
@@ -19,3 +21,5 @@ public struct ApolloSchemaDownloader {
1921 return try cli. runApollo ( with: options. arguments)
2022 }
2123}
24+
25+ #endif
Original file line number Diff line number Diff line change 11import Foundation
22
3+ // Only available on macOS
4+ #if os(macOS)
5+
36/// Bash command runner
4- @available ( OSX, message: " Only available on macOS " )
57public struct Basher {
68
79 public enum BashError : Error , LocalizedError {
@@ -65,3 +67,5 @@ public struct Basher {
6567 return output
6668 }
6769}
70+
71+ #endif
Original file line number Diff line number Diff line change 11import Foundation
22
3+ // Only available on macOS
4+ #if os(macOS)
5+
36/// Helper for downloading the CLI Zip file so we don't have to include it in the repo.
4- @available ( OSX, message: " Only available on macOS " )
57struct CLIDownloader {
68
79 enum CLIDownloaderError : Error , LocalizedError {
@@ -118,3 +120,5 @@ struct CLIDownloader {
118120 }
119121 }
120122}
123+
124+ #endif
Original file line number Diff line number Diff line change 11import Foundation
22
3+ // Only available on macOS
4+ #if os(macOS)
5+
36/// Helper for extracting and validating the node-based Apollo CLI from a zip.
4- @available ( OSX, message: " Only available on macOS " )
57struct CLIExtractor {
68
79 // MARK: - Extracting the binary
@@ -122,3 +124,5 @@ struct CLIExtractor {
122124 }
123125 }
124126}
127+
128+ #endif
You can’t perform that action at this time.
0 commit comments