File tree Expand file tree Collapse file tree 10 files changed +59
-21
lines changed
Copilot for Xcode.xcodeproj Expand file tree Collapse file tree 10 files changed +59
-21
lines changed Original file line number Diff line number Diff line change 11#include "Version.xcconfig"
22SLASH = /
33
4- PRODUCT_NAME = Copilot for Xcode Dev
54HOST_APP_NAME = Copilot for Xcode Dev
65BUNDLE_IDENTIFIER_BASE = dev.com.intii.CopilotForXcode
7- EXTENSION_BUNDLE_NAME = Copilot Dev
86SPARKLE_FEED_URL = http:$(SLASH)$(SLASH)127.0.0.1:9433/appcast.xml
97SPARKLE_PUBLIC_KEY = WDzm5GHnc6c8kjeJEgX5GuGiPpW6Lc/ovGjLnrrZvPY=
108APPLICATION_SUPPORT_FOLDER = dev.com.intii.CopilotForXcode
9+ EXTENSION_BUNDLE_NAME = Copilot
10+ EXTENSION_BUNDLE_DISPLAY_NAME = Copilot Dev
11+ EXTENSION_SERVICE_NAME = CopilotForXcodeExtensionService
12+
13+ // see also target Configs
Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ SLASH = /
33
44HOST_APP_NAME = Copilot for Xcode
55BUNDLE_IDENTIFIER_BASE = com.intii.CopilotForXcode
6- EXTENSION_BUNDLE_NAME = Copilot
76SPARKLE_FEED_URL = https:$(SLASH)$(SLASH)raw.githubusercontent.com/intitni/CopilotForXcode/main/appcast.xml
87SPARKLE_PUBLIC_KEY = WDzm5GHnc6c8kjeJEgX5GuGiPpW6Lc/ovGjLnrrZvPY=
98APPLICATION_SUPPORT_FOLDER = com.intii.CopilotForXcode
9+ EXTENSION_BUNDLE_NAME = Copilot
10+ EXTENSION_BUNDLE_DISPLAY_NAME = Copilot
11+ EXTENSION_SERVICE_NAME = CopilotForXcodeExtensionService
12+
13+ // see also target Configs
Original file line number Diff line number Diff line change 754754 MARKETING_VERSION = "$(APP_VERSION)";
755755 PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE)";
756756 PRODUCT_MODULE_NAME = Copilot_for_Xcode;
757- PRODUCT_NAME = "Copilot for Xcode Dev ";
757+ PRODUCT_NAME = "$(HOST_APP_NAME) ";
758758 SWIFT_EMIT_LOC_STRINGS = YES;
759759 SWIFT_VERSION = 5.0;
760760 };
785785 MACOSX_DEPLOYMENT_TARGET = 12.0;
786786 MARKETING_VERSION = "$(APP_VERSION)";
787787 PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE)";
788- PRODUCT_NAME = "Copilot for Xcode ";
788+ PRODUCT_NAME = "$(HOST_APP_NAME) ";
789789 SWIFT_EMIT_LOC_STRINGS = YES;
790790 SWIFT_VERSION = 5.0;
791791 };
842842 MACOSX_DEPLOYMENT_TARGET = 12.0;
843843 MARKETING_VERSION = "$(APP_VERSION)";
844844 PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).ExtensionService";
845- PRODUCT_NAME = "CopilotForXcode$(TARGET_NAME )";
845+ PRODUCT_NAME = "$(EXTENSION_SERVICE_NAME )";
846846 SKIP_INSTALL = YES;
847847 SWIFT_EMIT_LOC_STRINGS = YES;
848848 SWIFT_VERSION = 5.0;
874874 MACOSX_DEPLOYMENT_TARGET = 12.0;
875875 MARKETING_VERSION = "$(APP_VERSION)";
876876 PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_IDENTIFIER_BASE).ExtensionService";
877- PRODUCT_NAME = "CopilotForXcode$(TARGET_NAME )";
877+ PRODUCT_NAME = "$(EXTENSION_SERVICE_NAME )";
878878 SKIP_INSTALL = YES;
879879 SWIFT_EMIT_LOC_STRINGS = YES;
880880 SWIFT_VERSION = 5.0;
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ let package = Package(
115115 " SuggestionService " ,
116116 ]
117117 ) ,
118- . target( name: " Preferences " ) ,
118+ . target( name: " Preferences " , dependencies : [ " Configs " ] ) ,
119119
120120 // MARK: - Host App
121121
@@ -202,6 +202,7 @@ let package = Package(
202202
203203 // MARK: - Helpers
204204
205+ . target( name: " Configs " ) ,
205206 . target( name: " CGEventObserver " ) ,
206207 . target( name: " Logger " ) ,
207208 . target( name: " FileChangeChecker " ) ,
@@ -261,7 +262,8 @@ let package = Package(
261262 " SuggestionModel " ,
262263 " Preferences " ,
263264 " KeychainAccess " ,
264- " Terminal "
265+ " Terminal " ,
266+ " Configs " ,
265267 ]
266268 ) ,
267269 ]
Original file line number Diff line number Diff line change 1+ import Configs
12import Foundation
23import KeychainAccess
34
@@ -6,10 +7,7 @@ public final class CodeiumAuthService {
67 let codeiumKeyKey = " codeiumKey "
78 let keychain : Keychain = {
89 let info = Bundle . main. infoDictionary
9- return Keychain (
10- service: info ? [ " BUNDLE_IDENTIFIER_BASE " ] as? String ?? " " ,
11- accessGroup: " \( info ? [ " APP_ID_PREFIX " ] as? String ?? " " ) \( info ? [ " BUNDLE_IDENTIFIER_BASE " ] as? String ?? " " ) .Shared "
12- )
10+ return Keychain ( service: keychainService, accessGroup: keychainAccessGroup)
1311 } ( )
1412
1513 var key : String ? { try ? keychain. getString ( codeiumKeyKey) }
Original file line number Diff line number Diff line change 1+ import Foundation
2+
3+ public var userDefaultSuiteName : String {
4+ " 5YKZ4Y3DAW.group.com.intii.CopilotForXcode "
5+ }
6+
7+ public var keychainAccessGroup : String {
8+ #if DEBUG
9+ return " 5YKZ4Y3DAW.dev.com.intii.CopilotForXcode.Shared "
10+ #else
11+ return " 5YKZ4Y3DAW.com.intii.CopilotForXcode.Shared "
12+ #endif
13+ }
14+
15+ public var keychainService : String {
16+ #if DEBUG
17+ return " dev.com.intii.CopilotForXcode "
18+ #else
19+ return " com.intii.CopilotForXcode "
20+ #endif
21+ }
22+
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ protocol GitHubCopilotLSP {
4040
4141enum GitHubCopilotError : Error , LocalizedError {
4242 case languageServerNotInstalled
43-
43+
4444 var errorDescription : String ? {
4545 switch self {
4646 case . languageServerNotInstalled:
@@ -68,7 +68,7 @@ public class GitHubCopilotBaseService {
6868 }
6969 let executionParams : Process . ExecutionParameters
7070 let runner = UserDefaults . shared. value ( for: \. runNodeWith)
71-
71+
7272 let agentJSURL = urls. executableURL. appendingPathComponent ( " copilot/dist/agent.js " )
7373 guard FileManager . default. fileExists ( atPath: agentJSURL. path) else {
7474 throw GitHubCopilotError . languageServerNotInstalled
@@ -141,7 +141,11 @@ public class GitHubCopilotBaseService {
141141
142142 return InitializeParams (
143143 processId: Int ( ProcessInfo . processInfo. processIdentifier) ,
144- clientInfo: . init( name: " Copilot for Xcode " ) ,
144+ clientInfo: . init(
145+ name: Bundle . main
146+ . object ( forInfoDictionaryKey: " HOST_APP_NAME " ) as? String
147+ ?? " Copilot for Xcode "
148+ ) ,
145149 locale: nil ,
146150 rootPath: projectRootURL. path,
147151 rootUri: projectRootURL. path,
Original file line number Diff line number Diff line change @@ -26,8 +26,12 @@ struct AppInfoView: View {
2626 var body : some View {
2727 VStack ( alignment: . leading) {
2828 HStack ( alignment: . top) {
29- Text ( " Copilot For Xcode " )
30- . font ( . title)
29+ Text (
30+ Bundle . main
31+ . object ( forInfoDictionaryKey: " HOST_APP_NAME " ) as? String
32+ ?? " Copilot for Xcode "
33+ )
34+ . font ( . title)
3135 Text ( appVersion ?? " " )
3236 . font ( . footnote)
3337 . foregroundColor ( . secondary)
@@ -228,7 +232,7 @@ struct GeneralSettingsView: View {
228232 ) ) {
229233 Text ( " Automatically Check for Update " )
230234 }
231-
235+
232236 Picker ( selection: $settings. suggestionWidgetPositionMode) {
233237 ForEach ( SuggestionWidgetPositionMode . allCases, id: \. rawValue) {
234238 switch $0 {
Original file line number Diff line number Diff line change 11import Foundation
2+ import Configs
23
34public extension UserDefaults {
4- static var shared = UserDefaults ( suiteName: " 5YKZ4Y3DAW.group.com.intii.CopilotForXcode " ) !
5+ static var shared = UserDefaults ( suiteName: userDefaultSuiteName ) !
56
67 static func setupDefaultSettings( ) {
78 shared. setupDefaultValue ( for: \. quitXPCServiceOnXcodeAndAppQuit)
Original file line number Diff line number Diff line change 99 <key >CFBundleDevelopmentRegion </key >
1010 <string >$(DEVELOPMENT_LANGUAGE) </string >
1111 <key >CFBundleDisplayName </key >
12- <string >$(EXTENSION_BUNDLE_NAME ) </string >
12+ <string >$(EXTENSION_BUNDLE_DISPLAY_NAME ) </string >
1313 <key >CFBundleExecutable </key >
1414 <string >$(EXECUTABLE_NAME) </string >
1515 <key >CFBundleIdentifier </key >
You can’t perform that action at this time.
0 commit comments