-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: Drop plugins for SwiftPM (#2649)
Co-authored-by: Anthony Miller <anthonymdev@gmail.com>
- Loading branch information
1 parent
4c4edf5
commit 69538a3
Showing
101 changed files
with
107 additions
and
845 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
Plugins/ApolloCodegenPlugin-Fetch/ApolloCodegenPluginFetch.swift
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
Plugins/ApolloCodegenPlugin-Fetch/Symbolic Links/SharedPackageFiles
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
Plugins/ApolloCodegenPlugin-Generate/ApolloCodegenPluginGenerate.swift
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
Plugins/ApolloCodegenPlugin-Generate/Symbolic Links/README.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
Plugins/ApolloCodegenPlugin-Generate/Symbolic Links/SharedPackageFiles
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
Plugins/ApolloCodegenPlugin-Initialize/ApolloCodegenPluginInitialize.swift
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
Plugins/ApolloCodegenPlugin-Initialize/Symbolic Links/README.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
Plugins/ApolloCodegenPlugin-Initialize/Symbolic Links/SharedPackageFiles
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Foundation | ||
import PackagePlugin | ||
|
||
@main | ||
struct InstallCLIPluginCommand: CommandPlugin { | ||
|
||
func performCommand(context: PackagePlugin.PluginContext, arguments: [String]) async throws { | ||
let pathToCLI = try context.tool(named: "apollo-ios-cli").path | ||
try createSymbolicLink(from: pathToCLI, to: context.package.directory) | ||
} | ||
|
||
func createSymbolicLink(from: PackagePlugin.Path, to: PackagePlugin.Path) throws { | ||
let task = Process() | ||
task.standardInput = nil | ||
task.environment = ProcessInfo.processInfo.environment | ||
task.arguments = ["-c", "ln -f -s \(from.string) \(to.string)"] | ||
task.executableURL = URL(fileURLWithPath: "/bin/zsh") | ||
try task.run() | ||
task.waitUntilExit() | ||
} | ||
|
||
} | ||
|
||
#if canImport(XcodeProjectPlugin) | ||
import XcodeProjectPlugin | ||
|
||
extension InstallCLIPluginCommand: XcodeCommandPlugin { | ||
|
||
/// 👇 This entry point is called when operating on an Xcode project. | ||
func performCommand(context: XcodePluginContext, arguments: [String]) throws { | ||
print("Installing Apollo CLI Plugin to Xcode project \(context.xcodeProject.displayName)") | ||
let pathToCLI = try context.tool(named: "apollo-ios-cli").path | ||
try createSymbolicLink(from: pathToCLI, to: context.xcodeProject.directory) | ||
} | ||
|
||
} | ||
#endif |
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
Plugins/SharedPackageFiles/PluginContext+codegenExecutableURL.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The Apollo iOS SPM package includes the Codegen CLI as an executable target. This ensures you always have a valid CLI version for your Apollo iOS version. | ||
|
||
To simplify accessing the Codegen CLI, you can run the included `InstallCLI` SPM plugin. | ||
|
||
This plugin builds the CLI and creates a symbolic link to the executable in your project root. | ||
|
||
When using a `Package.swift` file, install the CLI by running: | ||
|
||
```bash | ||
swift package --allow-writing-to-package-directory apollo-cli-install | ||
``` | ||
|
||
When using Swift packages through Xcode, right-click on your project in the Xcode file explorer and at the bottom of the menu you will find the `InstallCLI` plugin command. Clicking on this will present a dialog asking for permission for the plugin to write to your project directory. | ||
|
||
<img class="screenshot" src="../source/screenshot/apollo-xcode-plugin.png" alt="Where to find the SPM plugin commands in Xcode" /> | ||
|
||
After running the installation plugin, a symbolic link to the Codegen CLI named `apollo-ios-cli` is located in your project root folder. You can now run the CLI from the command line with `./apollo-ios-cli`. | ||
|
||
> **Note:** Because the `apollo-ios-cli` in your project root is only a symbolic link, it will only work if the compiled CLI exectuable exists. This is generally located in your Xcode Derived Data or the `.build` folder. If these are cleared, you can run the install plugin again to re-build the CLI executable. |
Oops, something went wrong.