Skip to content
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

SwiftUI previews fix #1066

Merged
Merged
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
6 changes: 5 additions & 1 deletion Sources/ApolloCodegenLib/ApolloCLI.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Foundation

// Only available on macOS
#if os(macOS)

/// Wrapper for calling the bundled node-based Apollo CLI.
@available(OSX, message: "Only available on macOS")
public struct ApolloCLI {

/// Creates an instance of `ApolloCLI`, downloading and extracting if needed
Expand Down Expand Up @@ -47,3 +49,5 @@ public struct ApolloCLI {
return try Basher.run(command: command, from: folder)
}
}

#endif
6 changes: 5 additions & 1 deletion Sources/ApolloCodegenLib/ApolloCodegen.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Foundation

// Only available on macOS
#if os(macOS)

/// A class to facilitate running code generation
@available(OSX, message: "Only available on macOS")
public class ApolloCodegen {

/// Errors which can happen with code generation
Expand Down Expand Up @@ -42,3 +44,5 @@ public class ApolloCodegen {
return try cli.runApollo(with: options.arguments, from: folder)
}
}

#endif
6 changes: 5 additions & 1 deletion Sources/ApolloCodegenLib/ApolloSchemaDownloader.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Foundation

// Only available on macOS
#if os(macOS)

/// A wrapper to facilitate downloading a schema with the Apollo node CLI
@available(OSX, message: "Only available on macOS")
public struct ApolloSchemaDownloader {

/// Runs code generation from the given folder with the passed-in options
Expand All @@ -19,3 +21,5 @@ public struct ApolloSchemaDownloader {
return try cli.runApollo(with: options.arguments)
}
}

#endif
6 changes: 5 additions & 1 deletion Sources/ApolloCodegenLib/Basher.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Foundation

// Only available on macOS
#if os(macOS)

/// Bash command runner
@available(OSX, message: "Only available on macOS")
public struct Basher {

public enum BashError: Error, LocalizedError {
Expand Down Expand Up @@ -65,3 +67,5 @@ public struct Basher {
return output
}
}

#endif
6 changes: 5 additions & 1 deletion Sources/ApolloCodegenLib/CLIDownloader.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Foundation

// Only available on macOS
#if os(macOS)

/// Helper for downloading the CLI Zip file so we don't have to include it in the repo.
@available(OSX, message: "Only available on macOS")
struct CLIDownloader {

enum CLIDownloaderError: Error, LocalizedError {
Expand Down Expand Up @@ -118,3 +120,5 @@ struct CLIDownloader {
}
}
}

#endif
6 changes: 5 additions & 1 deletion Sources/ApolloCodegenLib/CLIExtractor.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Foundation

// Only available on macOS
#if os(macOS)

/// Helper for extracting and validating the node-based Apollo CLI from a zip.
@available(OSX, message: "Only available on macOS")
struct CLIExtractor {

// MARK: - Extracting the binary
Expand Down Expand Up @@ -122,3 +124,5 @@ struct CLIExtractor {
}
}
}

#endif