Skip to content

Commit

Permalink
Merge pull request #6 from kishikawakatsumi/xcode-114
Browse files Browse the repository at this point in the history
Use Xcode 11.4 default tools path
  • Loading branch information
kishikawakatsumi committed Mar 24, 2020
2 parents 3fe6a0e + 73f2c69 commit 8bd3b2e
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 32 deletions.
2 changes: 1 addition & 1 deletion ChromeExtension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "SourceKit for Chrome",
"version": "0.3.1",
"version": "0.3.2",
"description": "A browser extension for GitHub, that enables IDE features on your browser such as symbol navigator, go to definition and documentation on hover.",
"icons": {
"16": "icon16.png",
Expand Down
4 changes: 2 additions & 2 deletions ChromeExtension/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function restoreOptions() {
{
"sourcekit-lsp.serverPathOption": "default",
"sourcekit-lsp.serverPath":
"/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
"sourcekit-lsp.SDKOption": "iphonesimulator",
"sourcekit-lsp.SDKPath":
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk",
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk",
"sourcekit-lsp.target": "x86_64-apple-ios13-simulator"
},
function(items) {
Expand Down
4 changes: 2 additions & 2 deletions SafariExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.3.1</string>
<string>0.3.2</string>
<key>CFBundleVersion</key>
<string>9</string>
<string>10</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
Expand Down
4 changes: 0 additions & 4 deletions SafariExtension/SourceKitServiceProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ final class SourceKitServiceProxy {

func defaultLanguageServerPath(completion: @escaping (Bool, String) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand All @@ -164,7 +163,6 @@ final class SourceKitServiceProxy {

func defaultSDKPath(for SDK: String, completion: @escaping (Bool, String) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand All @@ -179,7 +177,6 @@ final class SourceKitServiceProxy {

func synchronizeRepository(_ repository: URL, force: Bool = false, completion: @escaping (Bool, URL?) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand All @@ -194,7 +191,6 @@ final class SourceKitServiceProxy {

func deleteLocalRepository(_ repository: URL, completion: @escaping (Bool, URL?) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand Down
16 changes: 7 additions & 9 deletions SourceKitForSafari.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
1493110D241C310B00CF87D3 /* Workspace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1493110C241C310B00CF87D3 /* Workspace.swift */; };
1493110F241CF44200CF87D3 /* style.css in Resources */ = {isa = PBXBuildFile; fileRef = 1493110E241CF44200CF87D3 /* style.css */; };
14931111241D4EC400CF87D3 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14931110241D4EC400CF87D3 /* Settings.swift */; };
14DB8099241F06E600728A29 /* LSPBindings in Frameworks */ = {isa = PBXBuildFile; productRef = 14DB8098241F06E600728A29 /* LSPBindings */; };
14DB80B7241F096A00728A29 /* LSPBindings in Frameworks */ = {isa = PBXBuildFile; productRef = 14DB80B6241F096A00728A29 /* LSPBindings */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -178,7 +177,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
14DB8099241F06E600728A29 /* LSPBindings in Frameworks */,
145B31A924295B3200660469 /* Swifter in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -367,7 +365,6 @@
);
name = SourceKitForSafari;
packageProductDependencies = (
14DB8098241F06E600728A29 /* LSPBindings */,
145B31A824295B3200660469 /* Swifter */,
);
productName = SourceKitForSafari;
Expand Down Expand Up @@ -419,7 +416,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1130;
LastUpgradeCheck = 1130;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = "Kishikawa Katsumi";
TargetAttributes = {
140460DE240BEE79004FE328 = {
Expand Down Expand Up @@ -705,6 +702,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SourceKitForSafari/SourceKitForSafari.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 27AEDK3C9F;
Expand All @@ -730,6 +728,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SourceKitForSafari/SourceKitForSafari.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 27AEDK3C9F;
Expand All @@ -752,6 +751,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SafariExtension/SafariExtension.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 27AEDK3C9F;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -776,6 +776,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SafariExtension/SafariExtension.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 27AEDK3C9F;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -799,6 +800,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SourceKitService/SourceKitService.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 27AEDK3C9F;
Expand All @@ -823,6 +825,7 @@
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SourceKitService/SourceKitService.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 27AEDK3C9F;
Expand Down Expand Up @@ -907,11 +910,6 @@
package = 145B31A724295B3200660469 /* XCRemoteSwiftPackageReference "swifter" */;
productName = Swifter;
};
14DB8098241F06E600728A29 /* LSPBindings */ = {
isa = XCSwiftPackageProductDependency;
package = 14DB8097241F06E600728A29 /* XCRemoteSwiftPackageReference "sourcekit-lsp" */;
productName = LSPBindings;
};
14DB80B6241F096A00728A29 /* LSPBindings */ = {
isa = XCSwiftPackageProductDependency;
package = 14DB8097241F06E600728A29 /* XCRemoteSwiftPackageReference "sourcekit-lsp" */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1140"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1140"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions SourceKitForSafari/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
guard let userDefaults = UserDefaults(suiteName: "27AEDK3C9F.kishikawakatsumi.SourceKitForSafari") else { return }
userDefaults.register(defaults: [
"sourcekit-lsp.serverPath": "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
"sourcekit-lsp.SDKPath": "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk",
"sourcekit-lsp.serverPath": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp",
"sourcekit-lsp.SDKPath": "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.4.sdk",
"sourcekit-lsp.target": "x86_64-apple-ios13-simulator",
])

Expand Down
4 changes: 2 additions & 2 deletions SourceKitForSafari/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.3.1</string>
<string>0.3.2</string>
<key>CFBundleVersion</key>
<string>9</string>
<string>10</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>LSMinimumSystemVersion</key>
Expand Down
4 changes: 0 additions & 4 deletions SourceKitForSafari/SourceKitServiceProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ final class SourceKitServiceProxy {

func defaultLanguageServerPath(completion: @escaping (Bool, String) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand All @@ -164,7 +163,6 @@ final class SourceKitServiceProxy {

func defaultSDKPath(for SDK: String, completion: @escaping (Bool, String) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand All @@ -179,7 +177,6 @@ final class SourceKitServiceProxy {

func synchronizeRepository(_ repository: URL, force: Bool = false, completion: @escaping (Bool, URL?) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand All @@ -194,7 +191,6 @@ final class SourceKitServiceProxy {

func deleteLocalRepository(_ repository: URL, completion: @escaping (Bool, URL?) -> Void) {
let connection = self.connection
let context = self.context

queue.async {
connection.resume()
Expand Down
4 changes: 2 additions & 2 deletions SourceKitService/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>0.3.1</string>
<string>0.3.2</string>
<key>CFBundleVersion</key>
<string>9</string>
<string>10</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020 Kishikawa Katsumi. All rights reserved.</string>
<key>XPCService</key>
Expand Down
21 changes: 20 additions & 1 deletion SourceKitService/SourceKitService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,26 @@ class SourceKitService: NSObject, SourceKitServiceProtocol {
}

func defaultLanguageServerPath(reply: @escaping (Bool, String) -> Void) {
reply(true, "/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp")
let process = Process()
process.launchPath = "/usr/bin/xcrun"
process.arguments = [
"-find",
"sourcekit-lsp",
]

let standardOutput = Pipe()
process.standardOutput = standardOutput

process.launch()
process.waitUntilExit()

if process.terminationStatus == 0 {
if let result = String(data: standardOutput.fileHandleForReading.availableData, encoding: .utf8)?.trimmingCharacters(in: .whitespacesAndNewlines) {
reply(true, result)
return
}
}
reply(false, "")
}

func defaultSDKPath(for SDK: String, reply: @escaping (Bool, String) -> Void) {
Expand Down

0 comments on commit 8bd3b2e

Please sign in to comment.