-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RainbowScientist5/raindrops.ai
Rainbowbeast_Copilot_Pull_Request
- Loading branch information
Showing
12 changed files
with
192 additions
and
37 deletions.
There are no files selected for viewing
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
Copilot for Xcode.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
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,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict/> | ||
</plist> |
120 changes: 91 additions & 29 deletions
120
Copilot for Xcode.xcodeproj/project.pbxproj → ...pilot for Xcode.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ta/xcschemes/CommunicationBridge.xcscheme → ...ta/xcschemes/CommunicationBridge.xcscheme
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
2 changes: 1 addition & 1 deletion
2
...eddata/xcschemes/EditorExtension.xcscheme → ...eddata/xcschemes/EditorExtension.xcscheme
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
2 changes: 1 addition & 1 deletion
2
...ddata/xcschemes/ExtensionService.xcscheme → ...ddata/xcschemes/ExtensionService.xcscheme
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
2 changes: 1 addition & 1 deletion
2
.../xcschemes/SandboxedClientTester.xcscheme → .../xcschemes/SandboxedClientTester.xcscheme
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Development | ||
|
||
## Prerequisites | ||
|
||
Requires Node installed and `npm` available on your system path, e.g. | ||
|
||
```sh | ||
sudo ln -s `which npm` /usr/local/bin | ||
sudo ln -s `which node` /usr/local/bin | ||
``` | ||
|
||
For context, this is used by an Xcode run script as part of the build. Run | ||
scripts use a very limited path to resolve commands. | ||
|
||
## Targets | ||
|
||
### Copilot for Xcode | ||
|
||
Copilot for Xcode is the host app containing both the XPCService and the editor extension. It provides the settings UI. | ||
|
||
### EditorExtension | ||
|
||
As its name suggests, the Xcode source editor extension. Its sole purpose is to forward editor content to the XPCService for processing, and update the editor with the returned content. Due to the sandboxing requirements for editor extensions, it has to communicate with a trusted, non-sandboxed XPCService (CommunicationBridge and ExtensionService) to bypass the limitations. The XPCService service name must be included in the `com.apple.security.temporary-exception.mach-lookup.global-name` entitlements. | ||
|
||
### ExtensionService | ||
|
||
The `ExtensionService` is a program that operates in the background. All features are implemented in this target. | ||
|
||
### CommunicationBridge | ||
|
||
It's responsible for maintaining the communication between the Copilot for Xcode/EditorExtension and ExtensionService. | ||
|
||
### Core and Tool | ||
|
||
Most of the logics are implemented inside the package `Core` and `Tool`. | ||
|
||
- The `Service` contains the implementations of the ExtensionService target. | ||
- The `HostApp` contains the implementations of the Copilot for Xcode target. | ||
|
||
## Building and Archiving the App | ||
|
||
1. Update the xcconfig files, bridgeLaunchAgent.plist, and Tool/Configs/Configurations.swift. | ||
2. Build or archive the Copilot for Xcode target. | ||
3. If Xcode complains that the pro package doesn't exist, please remove the package from the project. | ||
|
||
## Testing Source Editor Extension | ||
|
||
Just run both the `ExtensionService`, `CommunicationBridge` and the `EditorExtension` Target. Read [Testing Your Source Editor Extension](https://developer.apple.com/documentation/xcodekit/testing_your_source_editor_extension) for more details. | ||
|
||
## SwiftUI Previews | ||
|
||
Looks like SwiftUI Previews are not very happy with Objective-C packages when running with app targets. To use previews, please switch schemes to the package product targets. | ||
|
||
## Unit Tests | ||
|
||
To run unit tests, just run test from the `Copilot for Xcode` target. | ||
|
||
For new tests, they should be added to the `TestPlan.xctestplan`. | ||
|
||
## Code Style | ||
|
||
We use SwiftFormat to format the code. | ||
|
||
The source code mostly follows the [Ray Wenderlich Style Guide](https://github.com/raywenderlich/swift-style-guide) very closely with the following exception: | ||
|
||
- Use the Xcode default of 4 spaces for indentation. | ||
|
||
## App Versioning | ||
|
||
The app version and all targets' version in controlled by `Version.xcconfig`. |