diff --git a/.travis.yml b/.travis.yml index 8bdd6b738..f08e1cf71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ matrix: - script: make spm_test env: JOB=SPM before_install: + - make bootstrap - make swift_snapshot_install - - make spm_bootstrap exclude: - script: placeholder # workaround for https://github.com/travis-ci/travis-ci/issues/4681 notifications: diff --git a/CHANGELOG.md b/CHANGELOG.md index ca8ea45db..2b3d1c0c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,22 @@ ##### Breaking -* None. +* Now `libclang.dylib` and `sourcekitd.framework` are dynamically loaded at + runtime by SourceKittenFramework to use the versions included in the Xcode + version specified by `xcode-select -p` or custom toolchains. If + SourceKittenFramework clients previously accessed either of these libraries + directly using their APIs, those are no longer available. + [Norio Nomura](https://github.com/norio-nomura) + [#167](https://github.com/jpsim/SourceKitten/issues/167) ##### Enhancements -* None. +* Simplify the process of generating library wrappers and validate library + wrappers in unit tests. + [JP Simard](https://github.com/jpsim) + +* Support `swift test` on OS X. + [Norio Nomura](https://github.com/norio-nomura) ##### Bug Fixes @@ -45,7 +56,7 @@ * Fix crash when offset points end of string. [Norio Nomura](https://github.com/norio-nomura) - [#164](https://github.com/realm/SwiftLint/issues/164) + [SwiftLint#164](https://github.com/realm/SwiftLint/issues/164) ## 0.9.0 diff --git a/Makefile b/Makefile index a4fd344a2..892dcd541 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,10 @@ OUTPUT_PACKAGE=SourceKitten.pkg VERSION_STRING=$(shell agvtool what-marketing-version -terse1) COMPONENTS_PLIST=Source/sourcekitten/Components.plist -SWIFT_SNAPSHOT=swift-DEVELOPMENT-SNAPSHOT-2016-02-08-a -SWIFT_BUILD_COMMAND=/Library/Developer/Toolchains/$(SWIFT_SNAPSHOT).xctoolchain/usr/bin/swift build +SWIFT_SNAPSHOT=swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a +SWIFT_COMMAND=/Library/Developer/Toolchains/$(SWIFT_SNAPSHOT).xctoolchain/usr/bin/swift +SWIFT_BUILD_COMMAND=$(SWIFT_COMMAND) build +SWIFT_TEST_COMMAND=$(SWIFT_COMMAND) test .PHONY: all bootstrap clean install package test uninstall @@ -74,17 +76,12 @@ swift_snapshot_install: curl https://swift.org/builds/development/xcode/$(SWIFT_SNAPSHOT)/$(SWIFT_SNAPSHOT)-osx.pkg -o swift.pkg sudo installer -pkg swift.pkg -target / -spm_bootstrap: spm_teardown - script/spm_bootstrap "$(SWIFT_SNAPSHOT)" - -spm_teardown: - script/spm_teardown - spm: - $(SWIFT_BUILD_COMMAND) + $(SWIFT_BUILD_COMMAND) -v +spm_test: PATH:=/Library/Developer/Toolchains/$(SWIFT_SNAPSHOT).xctoolchain/usr/bin/:$(PATH) spm_test: spm - .build/Debug/SourceKittenFrameworkTests + $(SWIFT_TEST_COMMAND) spm_clean: $(SWIFT_BUILD_COMMAND) --clean diff --git a/Package.swift b/Package.swift index a63e5f81f..8320fc456 100644 --- a/Package.swift +++ b/Package.swift @@ -6,14 +6,12 @@ let package = Package( Target(name: "SourceKittenFramework"), Target(name: "sourcekitten", dependencies: [.Target(name: "SourceKittenFramework")]), - Target(name: "SourceKittenFrameworkTests", - dependencies: [.Target(name: "SourceKittenFramework")]), ], dependencies: [ .Package(url: "https://github.com/antitypical/Result.git", majorVersion: 1), - .Package(url: "https://github.com/jpsim/SourceKit.git", majorVersion: 1), + .Package(url: "https://github.com/norio-nomura/SourceKit.git", majorVersion: 1), + .Package(url: "https://github.com/norio-nomura/Clang_C.git", majorVersion: 1), .Package(url: "https://github.com/drmohundro/SWXMLHash.git", majorVersion: 2), .Package(url: "https://github.com/Carthage/Commandant.git", majorVersion: 0, minor: 8), - .Package(url: "https://github.com/norio-nomura/swift-corelibs-xctest.git", majorVersion: 0), ] ) diff --git a/Source/SourceKittenFramework/Request.swift b/Source/SourceKittenFramework/Request.swift index 5c88af174..230d4f9ef 100644 --- a/Source/SourceKittenFramework/Request.swift +++ b/Source/SourceKittenFramework/Request.swift @@ -349,3 +349,52 @@ extension Request: CustomStringConvertible { /// A textual representation of `Request`. public var description: String { return String(UTF8String: sourcekitd_request_description_copy(sourcekitObject))! } } + +private func interfaceForModule(module: String, compilerArguments: [String]) -> [String: SourceKitRepresentable] { + var compilerargs = compilerArguments.map({ sourcekitd_request_string_create($0) }) + let dict = [ + sourcekitd_uid_get_from_cstr("key.request"): sourcekitd_request_uid_create(sourcekitd_uid_get_from_cstr("source.request.editor.open.interface")), + sourcekitd_uid_get_from_cstr("key.name"): sourcekitd_request_string_create(NSUUID().UUIDString), + sourcekitd_uid_get_from_cstr("key.compilerargs"): sourcekitd_request_array_create(&compilerargs, compilerargs.count), + sourcekitd_uid_get_from_cstr("key.modulename"): sourcekitd_request_string_create("SourceKittenFramework.\(module)") + ] + var keys = Array(dict.keys) + var values = Array(dict.values) + return Request.CustomRequest(sourcekitd_request_dictionary_create(&keys, &values, dict.count)).send() +} + +internal func libraryWrapperForModule(module: String, loadPath: String, spmModule: String, compilerArguments: [String]) -> String { + let sourceKitResponse = interfaceForModule(module, compilerArguments: compilerArguments) + let substructure = SwiftDocKey.getSubstructure(Structure(sourceKitResponse: sourceKitResponse).dictionary)!.map({ $0 as! [String: SourceKitRepresentable] }) + let source = sourceKitResponse["key.sourcetext"] as! String + let freeFunctions = substructure.filter({ + SwiftDeclarationKind(rawValue: SwiftDocKey.getKind($0)!) == .FunctionFree + }).flatMap { function -> String? in + let fullFunctionName = function["key.name"] as! String + let name = fullFunctionName.substringToIndex(fullFunctionName.rangeOfString("(")!.startIndex) + guard name != "clang_executeOnThread" else { // unsupported format + return nil + } + + var parameters = [String]() + if let functionSubstructure = SwiftDocKey.getSubstructure(function) { + for parameterStructure in functionSubstructure { + parameters.append((parameterStructure as! [String: SourceKitRepresentable])["key.typename"] as! String) + } + } + var returnTypes = [String]() + if let offset = SwiftDocKey.getOffset(function), length = SwiftDocKey.getLength(function) { + let start = source.startIndex.advancedBy(Int(offset)) + let end = start.advancedBy(Int(length)) + let functionDeclaration = source.substringWithRange(start..", options: NSStringCompareOptions.BackwardsSearch, range: nil, locale: nil)?.startIndex { + returnTypes.append(functionDeclaration.substringFromIndex(startOfReturnArrow.advancedBy(3))) + } + } + + return "internal let \(name): @convention(c) (\(parameters.joinWithSeparator(", "))) -> (\(returnTypes.joinWithSeparator(", "))) = library.loadSymbol(\"\(name)\")" + } + let spmImport = "#if SWIFT_PACKAGE\nimport \(spmModule)\n#endif\n" + let library = "private let library = toolchainLoader.load(\"\(loadPath)\")\n" + return spmImport + library + freeFunctions.joinWithSeparator("\n") + "\n" +} diff --git a/Source/SourceKittenFramework/library_wrapper.swift b/Source/SourceKittenFramework/library_wrapper.swift new file mode 100644 index 000000000..547dcf88f --- /dev/null +++ b/Source/SourceKittenFramework/library_wrapper.swift @@ -0,0 +1,140 @@ +// +// library_wrapper.swift +// sourcekitten +// +// Created by Norio Nomura on 2/20/16. +// Copyright © 2016 SourceKitten. All rights reserved. +// + +import Foundation + +struct DynamicLinkLibrary { + let path: String + let handle: UnsafeMutablePointer + + func loadSymbol(symbol: String) -> T { + let sym = Darwin.dlsym(handle, symbol) + if sym == nil { + let errorString = String(UTF8String: dlerror()) + fatalError("Finding symbol \(symbol) failed: \(errorString)") + } + return unsafeBitCast(sym, T.self) + } +} + +let toolchainLoader = Loader(searchPaths: [ + xcodeDefaultToolchainOverride, + toolchainDir, + xcodeSelectPath?.toolchainDir, + /* + These search paths are used when `xcode-select -p` points to + "Command Line Tools OS X for Xcode", but Xcode.app exists. + */ + applicationsDir?.xcodeDeveloperDir.toolchainDir, + applicationsDir?.xcodeBetaDeveloperDir.toolchainDir, + userApplicationsDir?.xcodeDeveloperDir.toolchainDir, + userApplicationsDir?.xcodeBetaDeveloperDir.toolchainDir, + ].flatMap { path in + if let fullPath = path?.usrLibDir where fullPath.isFile { + return fullPath + } + return nil + }) + +struct Loader { + let searchPaths: [String] + + func load(path: String) -> DynamicLinkLibrary { + let fullPaths = searchPaths.map { $0.stringByAppendingPathComponent(path) }.filter { $0.isFile } + + // try all fullPaths that contains target file, + // then try loading with simple path that depends resolving to DYLD + for fullPath in fullPaths + [path] { + let handle = dlopen(fullPath, RTLD_LAZY) + if handle != nil { + return DynamicLinkLibrary(path: path, handle: handle) + } + } + + fatalError("Loading \(path) failed") + } +} + +/// Returns "XCODE_DEFAULT_TOOLCHAIN_OVERRIDE" environment variable +/// +/// `launch-with-toolchain` sets the toolchain path to the +/// "XCODE_DEFAULT_TOOLCHAIN_OVERRIDE" environment variable. +private let xcodeDefaultToolchainOverride: String? = + NSProcessInfo.processInfo().environment["XCODE_DEFAULT_TOOLCHAIN_OVERRIDE"] + +/// Returns "TOOLCHAIN_DIR" environment variable +/// +/// `Xcode`/`xcodebuild` sets the toolchain path to the +/// "TOOLCHAIN_DIR" environment variable. +private let toolchainDir: String? = + NSProcessInfo.processInfo().environment["TOOLCHAIN_DIR"] + +/// Returns result string of `xcode-select -p` +private let xcodeSelectPath: String? = { + let pathOfXcodeSelect = "/usr/bin/xcode-select" + + if !NSFileManager.defaultManager().isExecutableFileAtPath(pathOfXcodeSelect) { + return nil + } + + let task = NSTask() + task.launchPath = pathOfXcodeSelect + task.arguments = ["-p"] + + let pipe = NSPipe() + task.standardOutput = pipe + task.launch() // if xcode-select does not exist, crash with `NSInvalidArgumentException`. + + let data = pipe.fileHandleForReading.readDataToEndOfFile() + guard let output = String(data: data, encoding: NSUTF8StringEncoding) else { + return nil + } + + var start = output.startIndex + var contentsEnd = output.startIndex + output.getLineStart(&start, end: nil, contentsEnd: &contentsEnd, forRange: start.. String { + return (self as NSString).stringByAppendingPathComponent(str) + } +} diff --git a/Source/SourceKittenFramework/library_wrapper_CXString.swift b/Source/SourceKittenFramework/library_wrapper_CXString.swift new file mode 100644 index 000000000..f697c97aa --- /dev/null +++ b/Source/SourceKittenFramework/library_wrapper_CXString.swift @@ -0,0 +1,6 @@ +#if SWIFT_PACKAGE +import Clang_C +#endif +private let library = toolchainLoader.load("libclang.dylib") +internal let clang_getCString: @convention(c) (CXString) -> (UnsafePointer) = library.loadSymbol("clang_getCString") +internal let clang_disposeString: @convention(c) (CXString) -> () = library.loadSymbol("clang_disposeString") diff --git a/Source/SourceKittenFramework/library_wrapper_Documentation.swift b/Source/SourceKittenFramework/library_wrapper_Documentation.swift new file mode 100644 index 000000000..e7d31365e --- /dev/null +++ b/Source/SourceKittenFramework/library_wrapper_Documentation.swift @@ -0,0 +1,38 @@ +#if SWIFT_PACKAGE +import Clang_C +#endif +private let library = toolchainLoader.load("libclang.dylib") +internal let clang_Cursor_getParsedComment: @convention(c) (CXCursor) -> (CXComment) = library.loadSymbol("clang_Cursor_getParsedComment") +internal let clang_Comment_getKind: @convention(c) (CXComment) -> (CXCommentKind) = library.loadSymbol("clang_Comment_getKind") +internal let clang_Comment_getNumChildren: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_Comment_getNumChildren") +internal let clang_Comment_getChild: @convention(c) (CXComment, UInt32) -> (CXComment) = library.loadSymbol("clang_Comment_getChild") +internal let clang_Comment_isWhitespace: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_Comment_isWhitespace") +internal let clang_InlineContentComment_hasTrailingNewline: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_InlineContentComment_hasTrailingNewline") +internal let clang_TextComment_getText: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_TextComment_getText") +internal let clang_InlineCommandComment_getCommandName: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_InlineCommandComment_getCommandName") +internal let clang_InlineCommandComment_getRenderKind: @convention(c) (CXComment) -> (CXCommentInlineCommandRenderKind) = library.loadSymbol("clang_InlineCommandComment_getRenderKind") +internal let clang_InlineCommandComment_getNumArgs: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_InlineCommandComment_getNumArgs") +internal let clang_InlineCommandComment_getArgText: @convention(c) (CXComment, UInt32) -> (CXString) = library.loadSymbol("clang_InlineCommandComment_getArgText") +internal let clang_HTMLTagComment_getTagName: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_HTMLTagComment_getTagName") +internal let clang_HTMLStartTagComment_isSelfClosing: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_HTMLStartTagComment_isSelfClosing") +internal let clang_HTMLStartTag_getNumAttrs: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_HTMLStartTag_getNumAttrs") +internal let clang_HTMLStartTag_getAttrName: @convention(c) (CXComment, UInt32) -> (CXString) = library.loadSymbol("clang_HTMLStartTag_getAttrName") +internal let clang_HTMLStartTag_getAttrValue: @convention(c) (CXComment, UInt32) -> (CXString) = library.loadSymbol("clang_HTMLStartTag_getAttrValue") +internal let clang_BlockCommandComment_getCommandName: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_BlockCommandComment_getCommandName") +internal let clang_BlockCommandComment_getNumArgs: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_BlockCommandComment_getNumArgs") +internal let clang_BlockCommandComment_getArgText: @convention(c) (CXComment, UInt32) -> (CXString) = library.loadSymbol("clang_BlockCommandComment_getArgText") +internal let clang_BlockCommandComment_getParagraph: @convention(c) (CXComment) -> (CXComment) = library.loadSymbol("clang_BlockCommandComment_getParagraph") +internal let clang_ParamCommandComment_getParamName: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_ParamCommandComment_getParamName") +internal let clang_ParamCommandComment_isParamIndexValid: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_ParamCommandComment_isParamIndexValid") +internal let clang_ParamCommandComment_getParamIndex: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_ParamCommandComment_getParamIndex") +internal let clang_ParamCommandComment_isDirectionExplicit: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_ParamCommandComment_isDirectionExplicit") +internal let clang_ParamCommandComment_getDirection: @convention(c) (CXComment) -> (CXCommentParamPassDirection) = library.loadSymbol("clang_ParamCommandComment_getDirection") +internal let clang_TParamCommandComment_getParamName: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_TParamCommandComment_getParamName") +internal let clang_TParamCommandComment_isParamPositionValid: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_TParamCommandComment_isParamPositionValid") +internal let clang_TParamCommandComment_getDepth: @convention(c) (CXComment) -> (UInt32) = library.loadSymbol("clang_TParamCommandComment_getDepth") +internal let clang_TParamCommandComment_getIndex: @convention(c) (CXComment, UInt32) -> (UInt32) = library.loadSymbol("clang_TParamCommandComment_getIndex") +internal let clang_VerbatimBlockLineComment_getText: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_VerbatimBlockLineComment_getText") +internal let clang_VerbatimLineComment_getText: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_VerbatimLineComment_getText") +internal let clang_HTMLTagComment_getAsString: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_HTMLTagComment_getAsString") +internal let clang_FullComment_getAsHTML: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_FullComment_getAsHTML") +internal let clang_FullComment_getAsXML: @convention(c) (CXComment) -> (CXString) = library.loadSymbol("clang_FullComment_getAsXML") diff --git a/Source/SourceKittenFramework/library_wrapper_Index.swift b/Source/SourceKittenFramework/library_wrapper_Index.swift new file mode 100644 index 000000000..493af191c --- /dev/null +++ b/Source/SourceKittenFramework/library_wrapper_Index.swift @@ -0,0 +1,259 @@ +#if SWIFT_PACKAGE +import Clang_C +#endif +private let library = toolchainLoader.load("libclang.dylib") +internal let clang_createIndex: @convention(c) (Int32, Int32) -> (CXIndex) = library.loadSymbol("clang_createIndex") +internal let clang_disposeIndex: @convention(c) (CXIndex) -> () = library.loadSymbol("clang_disposeIndex") +internal let clang_CXIndex_setGlobalOptions: @convention(c) (CXIndex, UInt32) -> () = library.loadSymbol("clang_CXIndex_setGlobalOptions") +internal let clang_CXIndex_getGlobalOptions: @convention(c) (CXIndex) -> (UInt32) = library.loadSymbol("clang_CXIndex_getGlobalOptions") +internal let clang_getFileName: @convention(c) (CXFile) -> (CXString) = library.loadSymbol("clang_getFileName") +internal let clang_getFileTime: @convention(c) (CXFile) -> (time_t) = library.loadSymbol("clang_getFileTime") +internal let clang_getFileUniqueID: @convention(c) (CXFile, UnsafeMutablePointer) -> (Int32) = library.loadSymbol("clang_getFileUniqueID") +internal let clang_isFileMultipleIncludeGuarded: @convention(c) (CXTranslationUnit, CXFile) -> (UInt32) = library.loadSymbol("clang_isFileMultipleIncludeGuarded") +internal let clang_getFile: @convention(c) (CXTranslationUnit, UnsafePointer) -> (CXFile) = library.loadSymbol("clang_getFile") +internal let clang_File_isEqual: @convention(c) (CXFile, CXFile) -> (Int32) = library.loadSymbol("clang_File_isEqual") +internal let clang_getNullLocation: @convention(c) () -> (CXSourceLocation) = library.loadSymbol("clang_getNullLocation") +internal let clang_equalLocations: @convention(c) (CXSourceLocation, CXSourceLocation) -> (UInt32) = library.loadSymbol("clang_equalLocations") +internal let clang_getLocation: @convention(c) (CXTranslationUnit, CXFile, UInt32, UInt32) -> (CXSourceLocation) = library.loadSymbol("clang_getLocation") +internal let clang_getLocationForOffset: @convention(c) (CXTranslationUnit, CXFile, UInt32) -> (CXSourceLocation) = library.loadSymbol("clang_getLocationForOffset") +internal let clang_Location_isInSystemHeader: @convention(c) (CXSourceLocation) -> (Int32) = library.loadSymbol("clang_Location_isInSystemHeader") +internal let clang_Location_isFromMainFile: @convention(c) (CXSourceLocation) -> (Int32) = library.loadSymbol("clang_Location_isFromMainFile") +internal let clang_getNullRange: @convention(c) () -> (CXSourceRange) = library.loadSymbol("clang_getNullRange") +internal let clang_getRange: @convention(c) (CXSourceLocation, CXSourceLocation) -> (CXSourceRange) = library.loadSymbol("clang_getRange") +internal let clang_equalRanges: @convention(c) (CXSourceRange, CXSourceRange) -> (UInt32) = library.loadSymbol("clang_equalRanges") +internal let clang_Range_isNull: @convention(c) (CXSourceRange) -> (Int32) = library.loadSymbol("clang_Range_isNull") +internal let clang_getExpansionLocation: @convention(c) (CXSourceLocation, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getExpansionLocation") +internal let clang_getPresumedLocation: @convention(c) (CXSourceLocation, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getPresumedLocation") +internal let clang_getInstantiationLocation: @convention(c) (CXSourceLocation, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getInstantiationLocation") +internal let clang_getSpellingLocation: @convention(c) (CXSourceLocation, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getSpellingLocation") +internal let clang_getFileLocation: @convention(c) (CXSourceLocation, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getFileLocation") +internal let clang_getRangeStart: @convention(c) (CXSourceRange) -> (CXSourceLocation) = library.loadSymbol("clang_getRangeStart") +internal let clang_getRangeEnd: @convention(c) (CXSourceRange) -> (CXSourceLocation) = library.loadSymbol("clang_getRangeEnd") +internal let clang_getSkippedRanges: @convention(c) (CXTranslationUnit, CXFile) -> (UnsafeMutablePointer) = library.loadSymbol("clang_getSkippedRanges") +internal let clang_disposeSourceRangeList: @convention(c) (UnsafeMutablePointer) -> () = library.loadSymbol("clang_disposeSourceRangeList") +internal let clang_getNumDiagnosticsInSet: @convention(c) (CXDiagnosticSet) -> (UInt32) = library.loadSymbol("clang_getNumDiagnosticsInSet") +internal let clang_getDiagnosticInSet: @convention(c) (CXDiagnosticSet, UInt32) -> (CXDiagnostic) = library.loadSymbol("clang_getDiagnosticInSet") +internal let clang_loadDiagnostics: @convention(c) (UnsafePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> (CXDiagnosticSet) = library.loadSymbol("clang_loadDiagnostics") +internal let clang_disposeDiagnosticSet: @convention(c) (CXDiagnosticSet) -> () = library.loadSymbol("clang_disposeDiagnosticSet") +internal let clang_getChildDiagnostics: @convention(c) (CXDiagnostic) -> (CXDiagnosticSet) = library.loadSymbol("clang_getChildDiagnostics") +internal let clang_getNumDiagnostics: @convention(c) (CXTranslationUnit) -> (UInt32) = library.loadSymbol("clang_getNumDiagnostics") +internal let clang_getDiagnostic: @convention(c) (CXTranslationUnit, UInt32) -> (CXDiagnostic) = library.loadSymbol("clang_getDiagnostic") +internal let clang_getDiagnosticSetFromTU: @convention(c) (CXTranslationUnit) -> (CXDiagnosticSet) = library.loadSymbol("clang_getDiagnosticSetFromTU") +internal let clang_disposeDiagnostic: @convention(c) (CXDiagnostic) -> () = library.loadSymbol("clang_disposeDiagnostic") +internal let clang_formatDiagnostic: @convention(c) (CXDiagnostic, UInt32) -> (CXString) = library.loadSymbol("clang_formatDiagnostic") +internal let clang_defaultDiagnosticDisplayOptions: @convention(c) () -> (UInt32) = library.loadSymbol("clang_defaultDiagnosticDisplayOptions") +internal let clang_getDiagnosticSeverity: @convention(c) (CXDiagnostic) -> (CXDiagnosticSeverity) = library.loadSymbol("clang_getDiagnosticSeverity") +internal let clang_getDiagnosticLocation: @convention(c) (CXDiagnostic) -> (CXSourceLocation) = library.loadSymbol("clang_getDiagnosticLocation") +internal let clang_getDiagnosticSpelling: @convention(c) (CXDiagnostic) -> (CXString) = library.loadSymbol("clang_getDiagnosticSpelling") +internal let clang_getDiagnosticOption: @convention(c) (CXDiagnostic, UnsafeMutablePointer) -> (CXString) = library.loadSymbol("clang_getDiagnosticOption") +internal let clang_getDiagnosticCategory: @convention(c) (CXDiagnostic) -> (UInt32) = library.loadSymbol("clang_getDiagnosticCategory") +internal let clang_getDiagnosticCategoryName: @convention(c) (UInt32) -> (CXString) = library.loadSymbol("clang_getDiagnosticCategoryName") +internal let clang_getDiagnosticCategoryText: @convention(c) (CXDiagnostic) -> (CXString) = library.loadSymbol("clang_getDiagnosticCategoryText") +internal let clang_getDiagnosticNumRanges: @convention(c) (CXDiagnostic) -> (UInt32) = library.loadSymbol("clang_getDiagnosticNumRanges") +internal let clang_getDiagnosticRange: @convention(c) (CXDiagnostic, UInt32) -> (CXSourceRange) = library.loadSymbol("clang_getDiagnosticRange") +internal let clang_getDiagnosticNumFixIts: @convention(c) (CXDiagnostic) -> (UInt32) = library.loadSymbol("clang_getDiagnosticNumFixIts") +internal let clang_getDiagnosticFixIt: @convention(c) (CXDiagnostic, UInt32, UnsafeMutablePointer) -> (CXString) = library.loadSymbol("clang_getDiagnosticFixIt") +internal let clang_getTranslationUnitSpelling: @convention(c) (CXTranslationUnit) -> (CXString) = library.loadSymbol("clang_getTranslationUnitSpelling") +internal let clang_createTranslationUnitFromSourceFile: @convention(c) (CXIndex, UnsafePointer, Int32, UnsafePointer>, UInt32, UnsafeMutablePointer) -> (CXTranslationUnit) = library.loadSymbol("clang_createTranslationUnitFromSourceFile") +internal let clang_createTranslationUnit: @convention(c) (CXIndex, UnsafePointer) -> (CXTranslationUnit) = library.loadSymbol("clang_createTranslationUnit") +internal let clang_createTranslationUnit2: @convention(c) (CXIndex, UnsafePointer, UnsafeMutablePointer) -> (CXErrorCode) = library.loadSymbol("clang_createTranslationUnit2") +internal let clang_defaultEditingTranslationUnitOptions: @convention(c) () -> (UInt32) = library.loadSymbol("clang_defaultEditingTranslationUnitOptions") +internal let clang_parseTranslationUnit: @convention(c) (CXIndex, UnsafePointer, UnsafePointer>, Int32, UnsafeMutablePointer, UInt32, UInt32) -> (CXTranslationUnit) = library.loadSymbol("clang_parseTranslationUnit") +internal let clang_parseTranslationUnit2: @convention(c) (CXIndex, UnsafePointer, UnsafePointer>, Int32, UnsafeMutablePointer, UInt32, UInt32, UnsafeMutablePointer) -> (CXErrorCode) = library.loadSymbol("clang_parseTranslationUnit2") +internal let clang_defaultSaveOptions: @convention(c) (CXTranslationUnit) -> (UInt32) = library.loadSymbol("clang_defaultSaveOptions") +internal let clang_saveTranslationUnit: @convention(c) (CXTranslationUnit, UnsafePointer, UInt32) -> (Int32) = library.loadSymbol("clang_saveTranslationUnit") +internal let clang_disposeTranslationUnit: @convention(c) (CXTranslationUnit) -> () = library.loadSymbol("clang_disposeTranslationUnit") +internal let clang_defaultReparseOptions: @convention(c) (CXTranslationUnit) -> (UInt32) = library.loadSymbol("clang_defaultReparseOptions") +internal let clang_reparseTranslationUnit: @convention(c) (CXTranslationUnit, UInt32, UnsafeMutablePointer, UInt32) -> (Int32) = library.loadSymbol("clang_reparseTranslationUnit") +internal let clang_getTUResourceUsageName: @convention(c) (CXTUResourceUsageKind) -> (UnsafePointer) = library.loadSymbol("clang_getTUResourceUsageName") +internal let clang_getCXTUResourceUsage: @convention(c) (CXTranslationUnit) -> (CXTUResourceUsage) = library.loadSymbol("clang_getCXTUResourceUsage") +internal let clang_disposeCXTUResourceUsage: @convention(c) (CXTUResourceUsage) -> () = library.loadSymbol("clang_disposeCXTUResourceUsage") +internal let clang_getNullCursor: @convention(c) () -> (CXCursor) = library.loadSymbol("clang_getNullCursor") +internal let clang_getTranslationUnitCursor: @convention(c) (CXTranslationUnit) -> (CXCursor) = library.loadSymbol("clang_getTranslationUnitCursor") +internal let clang_equalCursors: @convention(c) (CXCursor, CXCursor) -> (UInt32) = library.loadSymbol("clang_equalCursors") +internal let clang_Cursor_isNull: @convention(c) (CXCursor) -> (Int32) = library.loadSymbol("clang_Cursor_isNull") +internal let clang_hashCursor: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_hashCursor") +internal let clang_getCursorKind: @convention(c) (CXCursor) -> (CXCursorKind) = library.loadSymbol("clang_getCursorKind") +internal let clang_isDeclaration: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isDeclaration") +internal let clang_isReference: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isReference") +internal let clang_isExpression: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isExpression") +internal let clang_isStatement: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isStatement") +internal let clang_isAttribute: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isAttribute") +internal let clang_isInvalid: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isInvalid") +internal let clang_isTranslationUnit: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isTranslationUnit") +internal let clang_isPreprocessing: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isPreprocessing") +internal let clang_isUnexposed: @convention(c) (CXCursorKind) -> (UInt32) = library.loadSymbol("clang_isUnexposed") +internal let clang_getCursorLinkage: @convention(c) (CXCursor) -> (CXLinkageKind) = library.loadSymbol("clang_getCursorLinkage") +internal let clang_getCursorAvailability: @convention(c) (CXCursor) -> (CXAvailabilityKind) = library.loadSymbol("clang_getCursorAvailability") +internal let clang_getCursorPlatformAvailability: @convention(c) (CXCursor, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, Int32) -> (Int32) = library.loadSymbol("clang_getCursorPlatformAvailability") +internal let clang_disposeCXPlatformAvailability: @convention(c) (UnsafeMutablePointer) -> () = library.loadSymbol("clang_disposeCXPlatformAvailability") +internal let clang_getCursorLanguage: @convention(c) (CXCursor) -> (CXLanguageKind) = library.loadSymbol("clang_getCursorLanguage") +internal let clang_Cursor_getTranslationUnit: @convention(c) (CXCursor) -> (CXTranslationUnit) = library.loadSymbol("clang_Cursor_getTranslationUnit") +internal let clang_createCXCursorSet: @convention(c) () -> (CXCursorSet) = library.loadSymbol("clang_createCXCursorSet") +internal let clang_disposeCXCursorSet: @convention(c) (CXCursorSet) -> () = library.loadSymbol("clang_disposeCXCursorSet") +internal let clang_CXCursorSet_contains: @convention(c) (CXCursorSet, CXCursor) -> (UInt32) = library.loadSymbol("clang_CXCursorSet_contains") +internal let clang_CXCursorSet_insert: @convention(c) (CXCursorSet, CXCursor) -> (UInt32) = library.loadSymbol("clang_CXCursorSet_insert") +internal let clang_getCursorSemanticParent: @convention(c) (CXCursor) -> (CXCursor) = library.loadSymbol("clang_getCursorSemanticParent") +internal let clang_getCursorLexicalParent: @convention(c) (CXCursor) -> (CXCursor) = library.loadSymbol("clang_getCursorLexicalParent") +internal let clang_getOverriddenCursors: @convention(c) (CXCursor, UnsafeMutablePointer>, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getOverriddenCursors") +internal let clang_disposeOverriddenCursors: @convention(c) (UnsafeMutablePointer) -> () = library.loadSymbol("clang_disposeOverriddenCursors") +internal let clang_getIncludedFile: @convention(c) (CXCursor) -> (CXFile) = library.loadSymbol("clang_getIncludedFile") +internal let clang_getCursor: @convention(c) (CXTranslationUnit, CXSourceLocation) -> (CXCursor) = library.loadSymbol("clang_getCursor") +internal let clang_getCursorLocation: @convention(c) (CXCursor) -> (CXSourceLocation) = library.loadSymbol("clang_getCursorLocation") +internal let clang_getCursorExtent: @convention(c) (CXCursor) -> (CXSourceRange) = library.loadSymbol("clang_getCursorExtent") +internal let clang_getCursorType: @convention(c) (CXCursor) -> (CXType) = library.loadSymbol("clang_getCursorType") +internal let clang_getTypeSpelling: @convention(c) (CXType) -> (CXString) = library.loadSymbol("clang_getTypeSpelling") +internal let clang_getTypedefDeclUnderlyingType: @convention(c) (CXCursor) -> (CXType) = library.loadSymbol("clang_getTypedefDeclUnderlyingType") +internal let clang_getEnumDeclIntegerType: @convention(c) (CXCursor) -> (CXType) = library.loadSymbol("clang_getEnumDeclIntegerType") +internal let clang_getEnumConstantDeclValue: @convention(c) (CXCursor) -> (Int64) = library.loadSymbol("clang_getEnumConstantDeclValue") +internal let clang_getEnumConstantDeclUnsignedValue: @convention(c) (CXCursor) -> (UInt64) = library.loadSymbol("clang_getEnumConstantDeclUnsignedValue") +internal let clang_getFieldDeclBitWidth: @convention(c) (CXCursor) -> (Int32) = library.loadSymbol("clang_getFieldDeclBitWidth") +internal let clang_Cursor_getNumArguments: @convention(c) (CXCursor) -> (Int32) = library.loadSymbol("clang_Cursor_getNumArguments") +internal let clang_Cursor_getArgument: @convention(c) (CXCursor, UInt32) -> (CXCursor) = library.loadSymbol("clang_Cursor_getArgument") +internal let clang_Cursor_getNumTemplateArguments: @convention(c) (CXCursor) -> (Int32) = library.loadSymbol("clang_Cursor_getNumTemplateArguments") +internal let clang_Cursor_getTemplateArgumentKind: @convention(c) (CXCursor, UInt32) -> (CXTemplateArgumentKind) = library.loadSymbol("clang_Cursor_getTemplateArgumentKind") +internal let clang_Cursor_getTemplateArgumentType: @convention(c) (CXCursor, UInt32) -> (CXType) = library.loadSymbol("clang_Cursor_getTemplateArgumentType") +internal let clang_Cursor_getTemplateArgumentValue: @convention(c) (CXCursor, UInt32) -> (Int64) = library.loadSymbol("clang_Cursor_getTemplateArgumentValue") +internal let clang_Cursor_getTemplateArgumentUnsignedValue: @convention(c) (CXCursor, UInt32) -> (UInt64) = library.loadSymbol("clang_Cursor_getTemplateArgumentUnsignedValue") +internal let clang_equalTypes: @convention(c) (CXType, CXType) -> (UInt32) = library.loadSymbol("clang_equalTypes") +internal let clang_getCanonicalType: @convention(c) (CXType) -> (CXType) = library.loadSymbol("clang_getCanonicalType") +internal let clang_isConstQualifiedType: @convention(c) (CXType) -> (UInt32) = library.loadSymbol("clang_isConstQualifiedType") +internal let clang_isVolatileQualifiedType: @convention(c) (CXType) -> (UInt32) = library.loadSymbol("clang_isVolatileQualifiedType") +internal let clang_isRestrictQualifiedType: @convention(c) (CXType) -> (UInt32) = library.loadSymbol("clang_isRestrictQualifiedType") +internal let clang_getPointeeType: @convention(c) (CXType) -> (CXType) = library.loadSymbol("clang_getPointeeType") +internal let clang_getTypeDeclaration: @convention(c) (CXType) -> (CXCursor) = library.loadSymbol("clang_getTypeDeclaration") +internal let clang_getDeclObjCTypeEncoding: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_getDeclObjCTypeEncoding") +internal let clang_getTypeKindSpelling: @convention(c) (CXTypeKind) -> (CXString) = library.loadSymbol("clang_getTypeKindSpelling") +internal let clang_getFunctionTypeCallingConv: @convention(c) (CXType) -> (CXCallingConv) = library.loadSymbol("clang_getFunctionTypeCallingConv") +internal let clang_getResultType: @convention(c) (CXType) -> (CXType) = library.loadSymbol("clang_getResultType") +internal let clang_getNumArgTypes: @convention(c) (CXType) -> (Int32) = library.loadSymbol("clang_getNumArgTypes") +internal let clang_getArgType: @convention(c) (CXType, UInt32) -> (CXType) = library.loadSymbol("clang_getArgType") +internal let clang_isFunctionTypeVariadic: @convention(c) (CXType) -> (UInt32) = library.loadSymbol("clang_isFunctionTypeVariadic") +internal let clang_getCursorResultType: @convention(c) (CXCursor) -> (CXType) = library.loadSymbol("clang_getCursorResultType") +internal let clang_isPODType: @convention(c) (CXType) -> (UInt32) = library.loadSymbol("clang_isPODType") +internal let clang_getElementType: @convention(c) (CXType) -> (CXType) = library.loadSymbol("clang_getElementType") +internal let clang_getNumElements: @convention(c) (CXType) -> (Int64) = library.loadSymbol("clang_getNumElements") +internal let clang_getArrayElementType: @convention(c) (CXType) -> (CXType) = library.loadSymbol("clang_getArrayElementType") +internal let clang_getArraySize: @convention(c) (CXType) -> (Int64) = library.loadSymbol("clang_getArraySize") +internal let clang_Type_getAlignOf: @convention(c) (CXType) -> (Int64) = library.loadSymbol("clang_Type_getAlignOf") +internal let clang_Type_getClassType: @convention(c) (CXType) -> (CXType) = library.loadSymbol("clang_Type_getClassType") +internal let clang_Type_getSizeOf: @convention(c) (CXType) -> (Int64) = library.loadSymbol("clang_Type_getSizeOf") +internal let clang_Type_getOffsetOf: @convention(c) (CXType, UnsafePointer) -> (Int64) = library.loadSymbol("clang_Type_getOffsetOf") +internal let clang_Cursor_getOffsetOfField: @convention(c) (CXCursor) -> (Int64) = library.loadSymbol("clang_Cursor_getOffsetOfField") +internal let clang_Cursor_isAnonymous: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_Cursor_isAnonymous") +internal let clang_Type_getNumTemplateArguments: @convention(c) (CXType) -> (Int32) = library.loadSymbol("clang_Type_getNumTemplateArguments") +internal let clang_Type_getTemplateArgumentAsType: @convention(c) (CXType, UInt32) -> (CXType) = library.loadSymbol("clang_Type_getTemplateArgumentAsType") +internal let clang_Type_getCXXRefQualifier: @convention(c) (CXType) -> (CXRefQualifierKind) = library.loadSymbol("clang_Type_getCXXRefQualifier") +internal let clang_Cursor_isBitField: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_Cursor_isBitField") +internal let clang_isVirtualBase: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_isVirtualBase") +internal let clang_getCXXAccessSpecifier: @convention(c) (CXCursor) -> (CX_CXXAccessSpecifier) = library.loadSymbol("clang_getCXXAccessSpecifier") +internal let clang_Cursor_getStorageClass: @convention(c) (CXCursor) -> (CX_StorageClass) = library.loadSymbol("clang_Cursor_getStorageClass") +internal let clang_getNumOverloadedDecls: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_getNumOverloadedDecls") +internal let clang_getOverloadedDecl: @convention(c) (CXCursor, UInt32) -> (CXCursor) = library.loadSymbol("clang_getOverloadedDecl") +internal let clang_getIBOutletCollectionType: @convention(c) (CXCursor) -> (CXType) = library.loadSymbol("clang_getIBOutletCollectionType") +internal let clang_visitChildren: @convention(c) (CXCursor, CXCursorVisitor!, CXClientData) -> (UInt32) = library.loadSymbol("clang_visitChildren") +internal let clang_visitChildrenWithBlock: @convention(c) (CXCursor, CXCursorVisitorBlock!) -> (UInt32) = library.loadSymbol("clang_visitChildrenWithBlock") +internal let clang_getCursorUSR: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_getCursorUSR") +internal let clang_constructUSR_ObjCClass: @convention(c) (UnsafePointer) -> (CXString) = library.loadSymbol("clang_constructUSR_ObjCClass") +internal let clang_constructUSR_ObjCCategory: @convention(c) (UnsafePointer, UnsafePointer) -> (CXString) = library.loadSymbol("clang_constructUSR_ObjCCategory") +internal let clang_constructUSR_ObjCProtocol: @convention(c) (UnsafePointer) -> (CXString) = library.loadSymbol("clang_constructUSR_ObjCProtocol") +internal let clang_constructUSR_ObjCIvar: @convention(c) (UnsafePointer, CXString) -> (CXString) = library.loadSymbol("clang_constructUSR_ObjCIvar") +internal let clang_constructUSR_ObjCMethod: @convention(c) (UnsafePointer, UInt32, CXString) -> (CXString) = library.loadSymbol("clang_constructUSR_ObjCMethod") +internal let clang_constructUSR_ObjCProperty: @convention(c) (UnsafePointer, CXString) -> (CXString) = library.loadSymbol("clang_constructUSR_ObjCProperty") +internal let clang_getCursorSpelling: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_getCursorSpelling") +internal let clang_Cursor_getSpellingNameRange: @convention(c) (CXCursor, UInt32, UInt32) -> (CXSourceRange) = library.loadSymbol("clang_Cursor_getSpellingNameRange") +internal let clang_getCursorDisplayName: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_getCursorDisplayName") +internal let clang_getCursorReferenced: @convention(c) (CXCursor) -> (CXCursor) = library.loadSymbol("clang_getCursorReferenced") +internal let clang_getCursorDefinition: @convention(c) (CXCursor) -> (CXCursor) = library.loadSymbol("clang_getCursorDefinition") +internal let clang_isCursorDefinition: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_isCursorDefinition") +internal let clang_getCanonicalCursor: @convention(c) (CXCursor) -> (CXCursor) = library.loadSymbol("clang_getCanonicalCursor") +internal let clang_Cursor_getObjCSelectorIndex: @convention(c) (CXCursor) -> (Int32) = library.loadSymbol("clang_Cursor_getObjCSelectorIndex") +internal let clang_Cursor_isDynamicCall: @convention(c) (CXCursor) -> (Int32) = library.loadSymbol("clang_Cursor_isDynamicCall") +internal let clang_Cursor_getReceiverType: @convention(c) (CXCursor) -> (CXType) = library.loadSymbol("clang_Cursor_getReceiverType") +internal let clang_Cursor_getObjCPropertyAttributes: @convention(c) (CXCursor, UInt32) -> (UInt32) = library.loadSymbol("clang_Cursor_getObjCPropertyAttributes") +internal let clang_Cursor_getObjCDeclQualifiers: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_Cursor_getObjCDeclQualifiers") +internal let clang_Cursor_isObjCOptional: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_Cursor_isObjCOptional") +internal let clang_Cursor_isVariadic: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_Cursor_isVariadic") +internal let clang_Cursor_getCommentRange: @convention(c) (CXCursor) -> (CXSourceRange) = library.loadSymbol("clang_Cursor_getCommentRange") +internal let clang_Cursor_getRawCommentText: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_Cursor_getRawCommentText") +internal let clang_Cursor_getBriefCommentText: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_Cursor_getBriefCommentText") +internal let clang_Cursor_getMangling: @convention(c) (CXCursor) -> (CXString) = library.loadSymbol("clang_Cursor_getMangling") +internal let clang_Cursor_getModule: @convention(c) (CXCursor) -> (CXModule) = library.loadSymbol("clang_Cursor_getModule") +internal let clang_getModuleForFile: @convention(c) (CXTranslationUnit, CXFile) -> (CXModule) = library.loadSymbol("clang_getModuleForFile") +internal let clang_Module_getASTFile: @convention(c) (CXModule) -> (CXFile) = library.loadSymbol("clang_Module_getASTFile") +internal let clang_Module_getParent: @convention(c) (CXModule) -> (CXModule) = library.loadSymbol("clang_Module_getParent") +internal let clang_Module_getName: @convention(c) (CXModule) -> (CXString) = library.loadSymbol("clang_Module_getName") +internal let clang_Module_getFullName: @convention(c) (CXModule) -> (CXString) = library.loadSymbol("clang_Module_getFullName") +internal let clang_Module_isSystem: @convention(c) (CXModule) -> (Int32) = library.loadSymbol("clang_Module_isSystem") +internal let clang_Module_getNumTopLevelHeaders: @convention(c) (CXTranslationUnit, CXModule) -> (UInt32) = library.loadSymbol("clang_Module_getNumTopLevelHeaders") +internal let clang_Module_getTopLevelHeader: @convention(c) (CXTranslationUnit, CXModule, UInt32) -> (CXFile) = library.loadSymbol("clang_Module_getTopLevelHeader") +internal let clang_CXXField_isMutable: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_CXXField_isMutable") +internal let clang_CXXMethod_isPureVirtual: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_CXXMethod_isPureVirtual") +internal let clang_CXXMethod_isStatic: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_CXXMethod_isStatic") +internal let clang_CXXMethod_isVirtual: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_CXXMethod_isVirtual") +internal let clang_CXXMethod_isConst: @convention(c) (CXCursor) -> (UInt32) = library.loadSymbol("clang_CXXMethod_isConst") +internal let clang_getTemplateCursorKind: @convention(c) (CXCursor) -> (CXCursorKind) = library.loadSymbol("clang_getTemplateCursorKind") +internal let clang_getSpecializedCursorTemplate: @convention(c) (CXCursor) -> (CXCursor) = library.loadSymbol("clang_getSpecializedCursorTemplate") +internal let clang_getCursorReferenceNameRange: @convention(c) (CXCursor, UInt32, UInt32) -> (CXSourceRange) = library.loadSymbol("clang_getCursorReferenceNameRange") +internal let clang_getTokenKind: @convention(c) (CXToken) -> (CXTokenKind) = library.loadSymbol("clang_getTokenKind") +internal let clang_getTokenSpelling: @convention(c) (CXTranslationUnit, CXToken) -> (CXString) = library.loadSymbol("clang_getTokenSpelling") +internal let clang_getTokenLocation: @convention(c) (CXTranslationUnit, CXToken) -> (CXSourceLocation) = library.loadSymbol("clang_getTokenLocation") +internal let clang_getTokenExtent: @convention(c) (CXTranslationUnit, CXToken) -> (CXSourceRange) = library.loadSymbol("clang_getTokenExtent") +internal let clang_tokenize: @convention(c) (CXTranslationUnit, CXSourceRange, UnsafeMutablePointer>, UnsafeMutablePointer) -> () = library.loadSymbol("clang_tokenize") +internal let clang_annotateTokens: @convention(c) (CXTranslationUnit, UnsafeMutablePointer, UInt32, UnsafeMutablePointer) -> () = library.loadSymbol("clang_annotateTokens") +internal let clang_disposeTokens: @convention(c) (CXTranslationUnit, UnsafeMutablePointer, UInt32) -> () = library.loadSymbol("clang_disposeTokens") +internal let clang_getCursorKindSpelling: @convention(c) (CXCursorKind) -> (CXString) = library.loadSymbol("clang_getCursorKindSpelling") +internal let clang_getDefinitionSpellingAndExtent: @convention(c) (CXCursor, UnsafeMutablePointer>, UnsafeMutablePointer>, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_getDefinitionSpellingAndExtent") +internal let clang_enableStackTraces: @convention(c) () -> () = library.loadSymbol("clang_enableStackTraces") +internal let clang_getCompletionChunkKind: @convention(c) (CXCompletionString, UInt32) -> (CXCompletionChunkKind) = library.loadSymbol("clang_getCompletionChunkKind") +internal let clang_getCompletionChunkText: @convention(c) (CXCompletionString, UInt32) -> (CXString) = library.loadSymbol("clang_getCompletionChunkText") +internal let clang_getCompletionChunkCompletionString: @convention(c) (CXCompletionString, UInt32) -> (CXCompletionString) = library.loadSymbol("clang_getCompletionChunkCompletionString") +internal let clang_getNumCompletionChunks: @convention(c) (CXCompletionString) -> (UInt32) = library.loadSymbol("clang_getNumCompletionChunks") +internal let clang_getCompletionPriority: @convention(c) (CXCompletionString) -> (UInt32) = library.loadSymbol("clang_getCompletionPriority") +internal let clang_getCompletionAvailability: @convention(c) (CXCompletionString) -> (CXAvailabilityKind) = library.loadSymbol("clang_getCompletionAvailability") +internal let clang_getCompletionNumAnnotations: @convention(c) (CXCompletionString) -> (UInt32) = library.loadSymbol("clang_getCompletionNumAnnotations") +internal let clang_getCompletionAnnotation: @convention(c) (CXCompletionString, UInt32) -> (CXString) = library.loadSymbol("clang_getCompletionAnnotation") +internal let clang_getCompletionParent: @convention(c) (CXCompletionString, UnsafeMutablePointer) -> (CXString) = library.loadSymbol("clang_getCompletionParent") +internal let clang_getCompletionBriefComment: @convention(c) (CXCompletionString) -> (CXString) = library.loadSymbol("clang_getCompletionBriefComment") +internal let clang_getCursorCompletionString: @convention(c) (CXCursor) -> (CXCompletionString) = library.loadSymbol("clang_getCursorCompletionString") +internal let clang_defaultCodeCompleteOptions: @convention(c) () -> (UInt32) = library.loadSymbol("clang_defaultCodeCompleteOptions") +internal let clang_codeCompleteAt: @convention(c) (CXTranslationUnit, UnsafePointer, UInt32, UInt32, UnsafeMutablePointer, UInt32, UInt32) -> (UnsafeMutablePointer) = library.loadSymbol("clang_codeCompleteAt") +internal let clang_sortCodeCompletionResults: @convention(c) (UnsafeMutablePointer, UInt32) -> () = library.loadSymbol("clang_sortCodeCompletionResults") +internal let clang_disposeCodeCompleteResults: @convention(c) (UnsafeMutablePointer) -> () = library.loadSymbol("clang_disposeCodeCompleteResults") +internal let clang_codeCompleteGetNumDiagnostics: @convention(c) (UnsafeMutablePointer) -> (UInt32) = library.loadSymbol("clang_codeCompleteGetNumDiagnostics") +internal let clang_codeCompleteGetDiagnostic: @convention(c) (UnsafeMutablePointer, UInt32) -> (CXDiagnostic) = library.loadSymbol("clang_codeCompleteGetDiagnostic") +internal let clang_codeCompleteGetContexts: @convention(c) (UnsafeMutablePointer) -> (UInt64) = library.loadSymbol("clang_codeCompleteGetContexts") +internal let clang_codeCompleteGetContainerKind: @convention(c) (UnsafeMutablePointer, UnsafeMutablePointer) -> (CXCursorKind) = library.loadSymbol("clang_codeCompleteGetContainerKind") +internal let clang_codeCompleteGetContainerUSR: @convention(c) (UnsafeMutablePointer) -> (CXString) = library.loadSymbol("clang_codeCompleteGetContainerUSR") +internal let clang_codeCompleteGetObjCSelector: @convention(c) (UnsafeMutablePointer) -> (CXString) = library.loadSymbol("clang_codeCompleteGetObjCSelector") +internal let clang_getClangVersion: @convention(c) () -> (CXString) = library.loadSymbol("clang_getClangVersion") +internal let clang_toggleCrashRecovery: @convention(c) (UInt32) -> () = library.loadSymbol("clang_toggleCrashRecovery") +internal let clang_getInclusions: @convention(c) (CXTranslationUnit, CXInclusionVisitor!, CXClientData) -> () = library.loadSymbol("clang_getInclusions") +internal let clang_getRemappings: @convention(c) (UnsafePointer) -> (CXRemapping) = library.loadSymbol("clang_getRemappings") +internal let clang_getRemappingsFromFileList: @convention(c) (UnsafeMutablePointer>, UInt32) -> (CXRemapping) = library.loadSymbol("clang_getRemappingsFromFileList") +internal let clang_remap_getNumFiles: @convention(c) (CXRemapping) -> (UInt32) = library.loadSymbol("clang_remap_getNumFiles") +internal let clang_remap_getFilenames: @convention(c) (CXRemapping, UInt32, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_remap_getFilenames") +internal let clang_remap_dispose: @convention(c) (CXRemapping) -> () = library.loadSymbol("clang_remap_dispose") +internal let clang_findReferencesInFile: @convention(c) (CXCursor, CXFile, CXCursorAndRangeVisitor) -> (CXResult) = library.loadSymbol("clang_findReferencesInFile") +internal let clang_findIncludesInFile: @convention(c) (CXTranslationUnit, CXFile, CXCursorAndRangeVisitor) -> (CXResult) = library.loadSymbol("clang_findIncludesInFile") +internal let clang_findReferencesInFileWithBlock: @convention(c) (CXCursor, CXFile, CXCursorAndRangeVisitorBlock!) -> (CXResult) = library.loadSymbol("clang_findReferencesInFileWithBlock") +internal let clang_findIncludesInFileWithBlock: @convention(c) (CXTranslationUnit, CXFile, CXCursorAndRangeVisitorBlock!) -> (CXResult) = library.loadSymbol("clang_findIncludesInFileWithBlock") +internal let clang_index_isEntityObjCContainerKind: @convention(c) (CXIdxEntityKind) -> (Int32) = library.loadSymbol("clang_index_isEntityObjCContainerKind") +internal let clang_index_getObjCContainerDeclInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getObjCContainerDeclInfo") +internal let clang_index_getObjCInterfaceDeclInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getObjCInterfaceDeclInfo") +internal let clang_index_getObjCCategoryDeclInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getObjCCategoryDeclInfo") +internal let clang_index_getObjCProtocolRefListInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getObjCProtocolRefListInfo") +internal let clang_index_getObjCPropertyDeclInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getObjCPropertyDeclInfo") +internal let clang_index_getIBOutletCollectionAttrInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getIBOutletCollectionAttrInfo") +internal let clang_index_getCXXClassDeclInfo: @convention(c) (UnsafePointer) -> (UnsafePointer) = library.loadSymbol("clang_index_getCXXClassDeclInfo") +internal let clang_index_getClientContainer: @convention(c) (UnsafePointer) -> (CXIdxClientContainer) = library.loadSymbol("clang_index_getClientContainer") +internal let clang_index_setClientContainer: @convention(c) (UnsafePointer, CXIdxClientContainer) -> () = library.loadSymbol("clang_index_setClientContainer") +internal let clang_index_getClientEntity: @convention(c) (UnsafePointer) -> (CXIdxClientEntity) = library.loadSymbol("clang_index_getClientEntity") +internal let clang_index_setClientEntity: @convention(c) (UnsafePointer, CXIdxClientEntity) -> () = library.loadSymbol("clang_index_setClientEntity") +internal let clang_IndexAction_create: @convention(c) (CXIndex) -> (CXIndexAction) = library.loadSymbol("clang_IndexAction_create") +internal let clang_IndexAction_dispose: @convention(c) (CXIndexAction) -> () = library.loadSymbol("clang_IndexAction_dispose") +internal let clang_indexSourceFile: @convention(c) (CXIndexAction, CXClientData, UnsafeMutablePointer, UInt32, UInt32, UnsafePointer, UnsafePointer>, Int32, UnsafeMutablePointer, UInt32, UnsafeMutablePointer, UInt32) -> (Int32) = library.loadSymbol("clang_indexSourceFile") +internal let clang_indexTranslationUnit: @convention(c) (CXIndexAction, CXClientData, UnsafeMutablePointer, UInt32, UInt32, CXTranslationUnit) -> (Int32) = library.loadSymbol("clang_indexTranslationUnit") +internal let clang_indexLoc_getFileLocation: @convention(c) (CXIdxLoc, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer, UnsafeMutablePointer) -> () = library.loadSymbol("clang_indexLoc_getFileLocation") +internal let clang_indexLoc_getCXSourceLocation: @convention(c) (CXIdxLoc) -> (CXSourceLocation) = library.loadSymbol("clang_indexLoc_getCXSourceLocation") +internal let clang_Type_visitFields: @convention(c) (CXType, CXFieldVisitor!, CXClientData) -> (UInt32) = library.loadSymbol("clang_Type_visitFields") diff --git a/Source/SourceKittenFramework/library_wrapper_sourcekitd.swift b/Source/SourceKittenFramework/library_wrapper_sourcekitd.swift new file mode 100644 index 000000000..50fdd9009 --- /dev/null +++ b/Source/SourceKittenFramework/library_wrapper_sourcekitd.swift @@ -0,0 +1,69 @@ +#if SWIFT_PACKAGE +import SourceKit +#endif +private let library = toolchainLoader.load("sourcekitd.framework/Versions/A/sourcekitd") +internal let sourcekitd_initialize: @convention(c) () -> () = library.loadSymbol("sourcekitd_initialize") +internal let sourcekitd_shutdown: @convention(c) () -> () = library.loadSymbol("sourcekitd_shutdown") +internal let sourcekitd_set_interrupted_connection_handler: @convention(c) (sourcekitd_interrupted_connection_handler_t) -> () = library.loadSymbol("sourcekitd_set_interrupted_connection_handler") +internal let sourcekitd_uid_get_from_cstr: @convention(c) (UnsafePointer) -> (sourcekitd_uid_t) = library.loadSymbol("sourcekitd_uid_get_from_cstr") +internal let sourcekitd_uid_get_from_buf: @convention(c) (UnsafePointer, Int) -> (sourcekitd_uid_t) = library.loadSymbol("sourcekitd_uid_get_from_buf") +internal let sourcekitd_uid_get_length: @convention(c) (sourcekitd_uid_t) -> (Int) = library.loadSymbol("sourcekitd_uid_get_length") +internal let sourcekitd_uid_get_string_ptr: @convention(c) (sourcekitd_uid_t) -> (UnsafePointer) = library.loadSymbol("sourcekitd_uid_get_string_ptr") +internal let sourcekitd_request_retain: @convention(c) (sourcekitd_object_t) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_retain") +internal let sourcekitd_request_release: @convention(c) (sourcekitd_object_t) -> () = library.loadSymbol("sourcekitd_request_release") +internal let sourcekitd_request_dictionary_create: @convention(c) (UnsafePointer, UnsafePointer, Int) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_dictionary_create") +internal let sourcekitd_request_dictionary_set_value: @convention(c) (sourcekitd_object_t, sourcekitd_uid_t, sourcekitd_object_t) -> () = library.loadSymbol("sourcekitd_request_dictionary_set_value") +internal let sourcekitd_request_dictionary_set_string: @convention(c) (sourcekitd_object_t, sourcekitd_uid_t, UnsafePointer) -> () = library.loadSymbol("sourcekitd_request_dictionary_set_string") +internal let sourcekitd_request_dictionary_set_stringbuf: @convention(c) (sourcekitd_object_t, sourcekitd_uid_t, UnsafePointer, Int) -> () = library.loadSymbol("sourcekitd_request_dictionary_set_stringbuf") +internal let sourcekitd_request_dictionary_set_int64: @convention(c) (sourcekitd_object_t, sourcekitd_uid_t, Int64) -> () = library.loadSymbol("sourcekitd_request_dictionary_set_int64") +internal let sourcekitd_request_dictionary_set_uid: @convention(c) (sourcekitd_object_t, sourcekitd_uid_t, sourcekitd_uid_t) -> () = library.loadSymbol("sourcekitd_request_dictionary_set_uid") +internal let sourcekitd_request_array_create: @convention(c) (UnsafePointer, Int) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_array_create") +internal let sourcekitd_request_array_set_value: @convention(c) (sourcekitd_object_t, Int, sourcekitd_object_t) -> () = library.loadSymbol("sourcekitd_request_array_set_value") +internal let sourcekitd_request_array_set_string: @convention(c) (sourcekitd_object_t, Int, UnsafePointer) -> () = library.loadSymbol("sourcekitd_request_array_set_string") +internal let sourcekitd_request_array_set_stringbuf: @convention(c) (sourcekitd_object_t, Int, UnsafePointer, Int) -> () = library.loadSymbol("sourcekitd_request_array_set_stringbuf") +internal let sourcekitd_request_array_set_int64: @convention(c) (sourcekitd_object_t, Int, Int64) -> () = library.loadSymbol("sourcekitd_request_array_set_int64") +internal let sourcekitd_request_array_set_uid: @convention(c) (sourcekitd_object_t, Int, sourcekitd_uid_t) -> () = library.loadSymbol("sourcekitd_request_array_set_uid") +internal let sourcekitd_request_int64_create: @convention(c) (Int64) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_int64_create") +internal let sourcekitd_request_string_create: @convention(c) (UnsafePointer) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_string_create") +internal let sourcekitd_request_uid_create: @convention(c) (sourcekitd_uid_t) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_uid_create") +internal let sourcekitd_request_create_from_yaml: @convention(c) (UnsafePointer, UnsafeMutablePointer>) -> (sourcekitd_object_t) = library.loadSymbol("sourcekitd_request_create_from_yaml") +internal let sourcekitd_request_description_dump: @convention(c) (sourcekitd_object_t) -> () = library.loadSymbol("sourcekitd_request_description_dump") +internal let sourcekitd_request_description_copy: @convention(c) (sourcekitd_object_t) -> (UnsafeMutablePointer) = library.loadSymbol("sourcekitd_request_description_copy") +internal let sourcekitd_response_dispose: @convention(c) (sourcekitd_response_t) -> () = library.loadSymbol("sourcekitd_response_dispose") +internal let sourcekitd_response_is_error: @convention(c) (sourcekitd_response_t) -> (Bool) = library.loadSymbol("sourcekitd_response_is_error") +internal let sourcekitd_response_error_get_kind: @convention(c) (sourcekitd_response_t) -> (sourcekitd_error_t) = library.loadSymbol("sourcekitd_response_error_get_kind") +internal let sourcekitd_response_error_get_description: @convention(c) (sourcekitd_response_t) -> (UnsafePointer) = library.loadSymbol("sourcekitd_response_error_get_description") +internal let sourcekitd_response_get_value: @convention(c) (sourcekitd_response_t) -> (sourcekitd_variant_t) = library.loadSymbol("sourcekitd_response_get_value") +internal let sourcekitd_variant_get_type: @convention(c) (sourcekitd_variant_t) -> (sourcekitd_variant_type_t) = library.loadSymbol("sourcekitd_variant_get_type") +internal let sourcekitd_variant_dictionary_get_value: @convention(c) (sourcekitd_variant_t, sourcekitd_uid_t) -> (sourcekitd_variant_t) = library.loadSymbol("sourcekitd_variant_dictionary_get_value") +internal let sourcekitd_variant_dictionary_get_string: @convention(c) (sourcekitd_variant_t, sourcekitd_uid_t) -> (UnsafePointer) = library.loadSymbol("sourcekitd_variant_dictionary_get_string") +internal let sourcekitd_variant_dictionary_get_int64: @convention(c) (sourcekitd_variant_t, sourcekitd_uid_t) -> (Int64) = library.loadSymbol("sourcekitd_variant_dictionary_get_int64") +internal let sourcekitd_variant_dictionary_get_bool: @convention(c) (sourcekitd_variant_t, sourcekitd_uid_t) -> (Bool) = library.loadSymbol("sourcekitd_variant_dictionary_get_bool") +internal let sourcekitd_variant_dictionary_get_uid: @convention(c) (sourcekitd_variant_t, sourcekitd_uid_t) -> (sourcekitd_uid_t) = library.loadSymbol("sourcekitd_variant_dictionary_get_uid") +internal let sourcekitd_variant_dictionary_apply: @convention(c) (sourcekitd_variant_t, sourcekitd_variant_dictionary_applier_t) -> (Bool) = library.loadSymbol("sourcekitd_variant_dictionary_apply") +internal let sourcekitd_variant_dictionary_apply_f: @convention(c) (sourcekitd_variant_t, sourcekitd_variant_dictionary_applier_f_t, UnsafeMutablePointer) -> (Bool) = library.loadSymbol("sourcekitd_variant_dictionary_apply_f") +internal let sourcekitd_variant_array_get_count: @convention(c) (sourcekitd_variant_t) -> (Int) = library.loadSymbol("sourcekitd_variant_array_get_count") +internal let sourcekitd_variant_array_get_value: @convention(c) (sourcekitd_variant_t, Int) -> (sourcekitd_variant_t) = library.loadSymbol("sourcekitd_variant_array_get_value") +internal let sourcekitd_variant_array_get_string: @convention(c) (sourcekitd_variant_t, Int) -> (UnsafePointer) = library.loadSymbol("sourcekitd_variant_array_get_string") +internal let sourcekitd_variant_array_get_int64: @convention(c) (sourcekitd_variant_t, Int) -> (Int64) = library.loadSymbol("sourcekitd_variant_array_get_int64") +internal let sourcekitd_variant_array_get_bool: @convention(c) (sourcekitd_variant_t, Int) -> (Bool) = library.loadSymbol("sourcekitd_variant_array_get_bool") +internal let sourcekitd_variant_array_get_uid: @convention(c) (sourcekitd_variant_t, Int) -> (sourcekitd_uid_t) = library.loadSymbol("sourcekitd_variant_array_get_uid") +internal let sourcekitd_variant_array_apply: @convention(c) (sourcekitd_variant_t, sourcekitd_variant_array_applier_t) -> (Bool) = library.loadSymbol("sourcekitd_variant_array_apply") +internal let sourcekitd_variant_array_apply_f: @convention(c) (sourcekitd_variant_t, sourcekitd_variant_array_applier_f_t, UnsafeMutablePointer) -> (Bool) = library.loadSymbol("sourcekitd_variant_array_apply_f") +internal let sourcekitd_variant_int64_get_value: @convention(c) (sourcekitd_variant_t) -> (Int64) = library.loadSymbol("sourcekitd_variant_int64_get_value") +internal let sourcekitd_variant_bool_get_value: @convention(c) (sourcekitd_variant_t) -> (Bool) = library.loadSymbol("sourcekitd_variant_bool_get_value") +internal let sourcekitd_variant_string_get_length: @convention(c) (sourcekitd_variant_t) -> (Int) = library.loadSymbol("sourcekitd_variant_string_get_length") +internal let sourcekitd_variant_string_get_ptr: @convention(c) (sourcekitd_variant_t) -> (UnsafePointer) = library.loadSymbol("sourcekitd_variant_string_get_ptr") +internal let sourcekitd_variant_uid_get_value: @convention(c) (sourcekitd_variant_t) -> (sourcekitd_uid_t) = library.loadSymbol("sourcekitd_variant_uid_get_value") +internal let sourcekitd_response_description_dump: @convention(c) (sourcekitd_response_t) -> () = library.loadSymbol("sourcekitd_response_description_dump") +internal let sourcekitd_response_description_dump_filedesc: @convention(c) (sourcekitd_response_t, Int32) -> () = library.loadSymbol("sourcekitd_response_description_dump_filedesc") +internal let sourcekitd_response_description_copy: @convention(c) (sourcekitd_response_t) -> (UnsafeMutablePointer) = library.loadSymbol("sourcekitd_response_description_copy") +internal let sourcekitd_variant_description_dump: @convention(c) (sourcekitd_variant_t) -> () = library.loadSymbol("sourcekitd_variant_description_dump") +internal let sourcekitd_variant_description_dump_filedesc: @convention(c) (sourcekitd_variant_t, Int32) -> () = library.loadSymbol("sourcekitd_variant_description_dump_filedesc") +internal let sourcekitd_variant_description_copy: @convention(c) (sourcekitd_variant_t) -> (UnsafeMutablePointer) = library.loadSymbol("sourcekitd_variant_description_copy") +internal let sourcekitd_send_request_sync: @convention(c) (sourcekitd_object_t) -> (sourcekitd_response_t) = library.loadSymbol("sourcekitd_send_request_sync") +internal let sourcekitd_send_request: @convention(c) (sourcekitd_object_t, UnsafeMutablePointer, sourcekitd_response_receiver_t!) -> () = library.loadSymbol("sourcekitd_send_request") +internal let sourcekitd_cancel_request: @convention(c) (sourcekitd_request_handle_t) -> () = library.loadSymbol("sourcekitd_cancel_request") +internal let sourcekitd_set_notification_handler: @convention(c) (sourcekitd_response_receiver_t!) -> () = library.loadSymbol("sourcekitd_set_notification_handler") +internal let sourcekitd_set_uid_handler: @convention(c) (sourcekitd_uid_handler_t!) -> () = library.loadSymbol("sourcekitd_set_uid_handler") +internal let sourcekitd_set_uid_handlers: @convention(c) (sourcekitd_uid_from_str_handler_t!, sourcekitd_str_from_uid_handler_t!) -> () = library.loadSymbol("sourcekitd_set_uid_handlers") diff --git a/Source/SourceKittenFrameworkTests/main.swift b/Source/SourceKittenFrameworkTests/main.swift deleted file mode 100644 index 04939e957..000000000 --- a/Source/SourceKittenFrameworkTests/main.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// main.swift -// sourcekitten -// -// Created by 野村 憲男 on 2/3/16. -// Copyright © 2016 SourceKitten. All rights reserved. -// - -import XCTest - -XCTMain([ - ClangTranslationUnitTests(), - CodeCompletionTests(), - FileTests(), - ModuleTests(), - OffsetMapTests(), - SourceKitTests(), - StringTests(), - StructureTests(), - SwiftDocsTests(), - SyntaxTests(), - ]) diff --git a/Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift b/Tests/SourceKittenFramework/ClangTranslationUnitTests.swift similarity index 86% rename from Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift rename to Tests/SourceKittenFramework/ClangTranslationUnitTests.swift index 076d428cb..75c911425 100644 --- a/Source/SourceKittenFrameworkTests/ClangTranslationUnitTests.swift +++ b/Tests/SourceKittenFramework/ClangTranslationUnitTests.swift @@ -14,15 +14,6 @@ let fixturesDirectory = (__FILE__ as NSString).stringByDeletingLastPathComponent class ClangTranslationUnitTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testParsesObjectiveCHeaderFilesAndXcodebuildArguments", - self.testParsesObjectiveCHeaderFilesAndXcodebuildArguments), - ("testBasicObjectiveCDocs", self.testBasicObjectiveCDocs), - ("testUnicodeInObjectiveCDocs", self.testUnicodeInObjectiveCDocs), - // ("testRealmObjectiveCDocs", self.testRealmObjectiveCDocs), FIXME: Failing on SPM - ] - func testParsesObjectiveCHeaderFilesAndXcodebuildArguments() { let headerFiles = [ "a.h", diff --git a/Source/SourceKittenFrameworkTests/CodeCompletionTests.swift b/Tests/SourceKittenFramework/CodeCompletionTests.swift similarity index 77% rename from Source/SourceKittenFrameworkTests/CodeCompletionTests.swift rename to Tests/SourceKittenFramework/CodeCompletionTests.swift index 48b45d555..2a18344bc 100644 --- a/Source/SourceKittenFrameworkTests/CodeCompletionTests.swift +++ b/Tests/SourceKittenFramework/CodeCompletionTests.swift @@ -12,11 +12,6 @@ import XCTest class CodeCompletionTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - // ("testSimpleCodeCompletion", self.testSimpleCodeCompletion), FIXME: Failing on SPM - ] - func testSimpleCodeCompletion() { let file = "\(NSUUID().UUIDString).swift" let completionItems = CodeCompletionItem.parseResponse( diff --git a/Source/SourceKittenFrameworkTests/FileTests.swift b/Tests/SourceKittenFramework/FileTests.swift similarity index 66% rename from Source/SourceKittenFrameworkTests/FileTests.swift rename to Tests/SourceKittenFramework/FileTests.swift index d62265eaf..4819e42cf 100644 --- a/Source/SourceKittenFrameworkTests/FileTests.swift +++ b/Tests/SourceKittenFramework/FileTests.swift @@ -11,11 +11,6 @@ import XCTest class FileTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testUnreadablePath", self.testUnreadablePath) - ] - func testUnreadablePath() { XCTAssert(File(path: "/dev/null") == nil) } diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json b/Tests/SourceKittenFramework/Fixtures/Bicycle.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Bicycle.json rename to Tests/SourceKittenFramework/Fixtures/Bicycle.json diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Bicycle.swift b/Tests/SourceKittenFramework/Fixtures/Bicycle.swift similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Bicycle.swift rename to Tests/SourceKittenFramework/Fixtures/Bicycle.swift diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Commandant.json b/Tests/SourceKittenFramework/Fixtures/Commandant.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Commandant.json rename to Tests/SourceKittenFramework/Fixtures/Commandant.json diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Musician.h b/Tests/SourceKittenFramework/Fixtures/Musician.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Musician.h rename to Tests/SourceKittenFramework/Fixtures/Musician.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Musician.json b/Tests/SourceKittenFramework/Fixtures/Musician.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Musician.json rename to Tests/SourceKittenFramework/Fixtures/Musician.json diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm.json b/Tests/SourceKittenFramework/Fixtures/Realm.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm.json rename to Tests/SourceKittenFramework/Fixtures/Realm.json diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMAccessor.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMAccessor.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMAccessor.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMAccessor.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMArray.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMArray.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMArray.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMArray.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMArray_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMArray_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMArray_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMArray_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMCollection.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMCollection.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMCollection.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMCollection.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMConstants.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMConstants.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMConstants.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMConstants.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMDefines.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMDefines.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMDefines.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMDefines.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMListBase.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMListBase.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMListBase.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMListBase.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMMigration.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMMigration.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMMigration.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMMigration.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMMigration_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMMigration_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMMigration_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMMigration_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObject.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObject.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObject.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObject.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectBase.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectBase.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectBase.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectBase.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectBase_Dynamic.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectBase_Dynamic.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectBase_Dynamic.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectBase_Dynamic.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectSchema.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectSchema.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectSchema.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectSchema.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectSchema_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectSchema_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectSchema_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectSchema_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectStore.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectStore.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObjectStore.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObjectStore.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObject_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMObject_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMObject_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMObject_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMOptionalBase.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMOptionalBase.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMOptionalBase.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMOptionalBase.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMPlatform.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMPlatform.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMPlatform.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMPlatform.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMPrefix.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMPrefix.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMPrefix.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMPrefix.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMProperty.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMProperty.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMProperty.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMProperty.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMProperty_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMProperty_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMProperty_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMProperty_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealm.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMRealm.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealm.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMRealm.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealmConfiguration.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMRealmConfiguration.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealmConfiguration.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMRealmConfiguration.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealmConfiguration_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMRealmConfiguration_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealmConfiguration_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMRealmConfiguration_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealm_Dynamic.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMRealm_Dynamic.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealm_Dynamic.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMRealm_Dynamic.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealm_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMRealm_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMRealm_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMRealm_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMResults.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMResults.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMResults.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMResults.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMResults_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMResults_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMResults_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMResults_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSchema.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMSchema.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSchema.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMSchema.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSchema_Private.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMSchema_Private.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSchema_Private.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMSchema_Private.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSwiftBridgingHeader.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMSwiftBridgingHeader.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSwiftBridgingHeader.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMSwiftBridgingHeader.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSwiftSupport.h b/Tests/SourceKittenFramework/Fixtures/Realm/RLMSwiftSupport.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/RLMSwiftSupport.h rename to Tests/SourceKittenFramework/Fixtures/Realm/RLMSwiftSupport.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Realm/Realm.h b/Tests/SourceKittenFramework/Fixtures/Realm/Realm.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Realm/Realm.h rename to Tests/SourceKittenFramework/Fixtures/Realm/Realm.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/SimpleCodeCompletion.json b/Tests/SourceKittenFramework/Fixtures/SimpleCodeCompletion.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/SimpleCodeCompletion.json rename to Tests/SourceKittenFramework/Fixtures/SimpleCodeCompletion.json diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Subscript.json b/Tests/SourceKittenFramework/Fixtures/Subscript.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Subscript.json rename to Tests/SourceKittenFramework/Fixtures/Subscript.json diff --git a/Source/SourceKittenFrameworkTests/Fixtures/Subscript.swift b/Tests/SourceKittenFramework/Fixtures/Subscript.swift similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/Subscript.swift rename to Tests/SourceKittenFramework/Fixtures/Subscript.swift diff --git a/Source/SourceKittenFrameworkTests/Fixtures/SuperScript.h b/Tests/SourceKittenFramework/Fixtures/SuperScript.h similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/SuperScript.h rename to Tests/SourceKittenFramework/Fixtures/SuperScript.h diff --git a/Source/SourceKittenFrameworkTests/Fixtures/SuperScript.json b/Tests/SourceKittenFramework/Fixtures/SuperScript.json similarity index 100% rename from Source/SourceKittenFrameworkTests/Fixtures/SuperScript.json rename to Tests/SourceKittenFramework/Fixtures/SuperScript.json diff --git a/Source/SourceKittenFrameworkTests/Info.plist b/Tests/SourceKittenFramework/Info.plist similarity index 100% rename from Source/SourceKittenFrameworkTests/Info.plist rename to Tests/SourceKittenFramework/Info.plist diff --git a/Source/SourceKittenFrameworkTests/ModuleTests.swift b/Tests/SourceKittenFramework/ModuleTests.swift similarity index 72% rename from Source/SourceKittenFrameworkTests/ModuleTests.swift rename to Tests/SourceKittenFramework/ModuleTests.swift index 132cfdc2b..ff205db77 100644 --- a/Source/SourceKittenFrameworkTests/ModuleTests.swift +++ b/Tests/SourceKittenFramework/ModuleTests.swift @@ -10,16 +10,13 @@ import Foundation import SourceKittenFramework import XCTest +let projectRoot = (((__FILE__ as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent as NSString) + .stringByDeletingLastPathComponent + class ModuleTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testModuleNilInPathWithNoXcodeProject", self.testModuleNilInPathWithNoXcodeProject), - // ("testSourceKittenFrameworkDocsAreValidJSON", - // self.testSourceKittenFrameworkDocsAreValidJSON), FIXME: Failing on SPM - // ("testCommandantDocs", self.testCommandantDocs), FIXME: Failing on SPM - ] - func testModuleNilInPathWithNoXcodeProject() { let pathWithNoXcodeProject = (__FILE__ as NSString).stringByDeletingLastPathComponent let model = Module(xcodeBuildArguments: [], name: nil, inPath: pathWithNoXcodeProject) @@ -27,10 +24,6 @@ class ModuleTests: XCTestCase { } func testSourceKittenFrameworkDocsAreValidJSON() { - let projectRoot = (((__FILE__ as NSString) - .stringByDeletingLastPathComponent as NSString) - .stringByDeletingLastPathComponent as NSString) - .stringByDeletingLastPathComponent let sourceKittenModule = Module(xcodeBuildArguments: ["-workspace", "SourceKitten.xcworkspace", "-scheme", "SourceKittenFramework"], name: nil, inPath: projectRoot)! let docsJSON = sourceKittenModule.docs.description XCTAssert(docsJSON.rangeOfString("error type") == nil) @@ -43,10 +36,6 @@ class ModuleTests: XCTestCase { } func testCommandantDocs() { - let projectRoot = (((__FILE__ as NSString) - .stringByDeletingLastPathComponent as NSString) - .stringByDeletingLastPathComponent as NSString) - .stringByDeletingLastPathComponent let commandantPath = projectRoot + "/Carthage/Checkouts/Commandant/" let commandantModule = Module(xcodeBuildArguments: ["-workspace", "Commandant.xcworkspace", "-scheme", "Commandant"], name: nil, inPath: commandantPath)! let escapedCommandantPath = commandantPath.stringByReplacingOccurrencesOfString("/", withString: "\\/") diff --git a/Source/SourceKittenFrameworkTests/OffsetMapTests.swift b/Tests/SourceKittenFramework/OffsetMapTests.swift similarity index 79% rename from Source/SourceKittenFrameworkTests/OffsetMapTests.swift rename to Tests/SourceKittenFramework/OffsetMapTests.swift index f151b9999..98787d8b8 100644 --- a/Source/SourceKittenFrameworkTests/OffsetMapTests.swift +++ b/Tests/SourceKittenFramework/OffsetMapTests.swift @@ -12,14 +12,6 @@ import XCTest class OffsetMapTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testOffsetMapContainsDeclarationOffsetWithDocCommentButNotAlreadyDocumented", - self.testOffsetMapContainsDeclarationOffsetWithDocCommentButNotAlreadyDocumented), - ("testOffsetMapDoesntContainAlreadyDocumentedDeclarationOffset", - self.testOffsetMapDoesntContainAlreadyDocumentedDeclarationOffset), - ] - func testOffsetMapContainsDeclarationOffsetWithDocCommentButNotAlreadyDocumented() { // Subscripts aren't parsed by SourceKit, so OffsetMap should contain its offset. let file = File(contents: diff --git a/Source/SourceKittenFrameworkTests/SourceKitTests.swift b/Tests/SourceKittenFramework/SourceKitTests.swift similarity index 76% rename from Source/SourceKittenFrameworkTests/SourceKitTests.swift rename to Tests/SourceKittenFramework/SourceKitTests.swift index af7a90c7b..fd448eeb3 100644 --- a/Source/SourceKittenFrameworkTests/SourceKitTests.swift +++ b/Tests/SourceKittenFramework/SourceKitTests.swift @@ -7,7 +7,7 @@ // import Foundation -import SourceKittenFramework +@testable import SourceKittenFramework import XCTest private func run(executable: String, arguments: [String]) -> String? { @@ -39,13 +39,6 @@ private func sourcekitStringsStartingWith(pattern: String) -> Set { class SourceKitTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testStatementKinds", self.testStatementKinds), - ("testSyntaxKinds", self.testSyntaxKinds), - ("testSwiftDeclarationKind", self.testSwiftDeclarationKind), - ] - func testStatementKinds() { let expected: [StatementKind] = [ .Brace, @@ -153,4 +146,24 @@ class SourceKitTests: XCTestCase { print("the following strings were removed: \(expectedStrings.subtract(actual))") } } + + func testLibraryWrappersAreUpToDate() { + let sourceKittenFrameworkModule = Module(xcodeBuildArguments: ["-workspace", "SourceKitten.xcworkspace", "-scheme", "SourceKittenFramework"], name: nil, inPath: projectRoot)! + let modules: [(module: String, path: String, spmModule: String)] = [ + ("CXString", "libclang.dylib", "Clang_C"), + ("Documentation", "libclang.dylib", "Clang_C"), + ("Index", "libclang.dylib", "Clang_C"), + ("sourcekitd", "sourcekitd.framework/Versions/A/sourcekitd", "SourceKit") + ] + for (module, path, spmModule) in modules { + let wrapperPath = "\(projectRoot)/Source/SourceKittenFramework/library_wrapper_\(module).swift" + let existingWrapper = try! String(contentsOfFile: wrapperPath) + let generatedWrapper = libraryWrapperForModule(module, loadPath: path, spmModule: spmModule, compilerArguments: sourceKittenFrameworkModule.compilerArguments) + XCTAssertEqual(existingWrapper, generatedWrapper) + let overwrite = false // set this to true to overwrite existing wrappers with the generated ones + if existingWrapper != generatedWrapper && overwrite { + generatedWrapper.dataUsingEncoding(NSUTF8StringEncoding)?.writeToFile(wrapperPath, atomically: true) + } + } + } } diff --git a/Source/SourceKittenFrameworkTests/StringTests.swift b/Tests/SourceKittenFramework/StringTests.swift similarity index 85% rename from Source/SourceKittenFrameworkTests/StringTests.swift rename to Tests/SourceKittenFramework/StringTests.swift index e0eaab0b4..6f68f6d77 100644 --- a/Source/SourceKittenFrameworkTests/StringTests.swift +++ b/Tests/SourceKittenFramework/StringTests.swift @@ -12,26 +12,6 @@ import XCTest class StringTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testStringByRemovingCommonLeadingWhitespaceFromLines", - self.testStringByRemovingCommonLeadingWhitespaceFromLines), - ("testStringByTrimmingTrailingCharactersInSet", - self.testStringByTrimmingTrailingCharactersInSet), - ("testCommentBody", self.testCommentBody), - ("testIsSwiftFile", self.testIsSwiftFile), - ("testIsObjectiveCHeaderFile", self.testIsObjectiveCHeaderFile), - ("testAbsolutePath", self.testAbsolutePath), - ("testIsTokenDocumentable", self.testIsTokenDocumentable), - ("testParseDeclaration", self.testParseDeclaration), - ("testGenerateDocumentedTokenOffsets", self.testGenerateDocumentedTokenOffsets), - ("testDocumentedTokenOffsetsWithSubscript", self.testDocumentedTokenOffsetsWithSubscript), - ("testGenerateDocumentedTokenOffsetsEmpty", self.testGenerateDocumentedTokenOffsetsEmpty), - ("testSubstringWithByteRange", self.testSubstringWithByteRange), - ("testSubstringLinesWithByteRange", self.testSubstringLinesWithByteRange), - ("testLineRangeWithByteRange", self.testLineRangeWithByteRange), - ] - func testStringByRemovingCommonLeadingWhitespaceFromLines() { var input = "a\n b\n c" XCTAssertEqual(input.stringByRemovingCommonLeadingWhitespaceFromLines(), input) diff --git a/Source/SourceKittenFrameworkTests/StructureTests.swift b/Tests/SourceKittenFramework/StructureTests.swift similarity index 92% rename from Source/SourceKittenFrameworkTests/StructureTests.swift rename to Tests/SourceKittenFramework/StructureTests.swift index eba9a262b..2a8900ea8 100644 --- a/Source/SourceKittenFrameworkTests/StructureTests.swift +++ b/Tests/SourceKittenFramework/StructureTests.swift @@ -12,14 +12,6 @@ import XCTest class StructureTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testPrintEmptyStructure", self.testPrintEmptyStructure), - // ("testGenerateSameStructureFileAndContents", self.testGenerateSameStructureFileAndContents), FIXME: Failing on SPM - ("testEnum", self.testEnum), - ("testStructurePrintValidJSON", self.testStructurePrintValidJSON), - ] - func testPrintEmptyStructure() { let expected: NSDictionary = [ "key.offset": 0, diff --git a/Source/SourceKittenFrameworkTests/SwiftDocsTests.swift b/Tests/SourceKittenFramework/SwiftDocsTests.swift similarity index 90% rename from Source/SourceKittenFrameworkTests/SwiftDocsTests.swift rename to Tests/SourceKittenFramework/SwiftDocsTests.swift index b3b77537e..d1c68978a 100644 --- a/Source/SourceKittenFrameworkTests/SwiftDocsTests.swift +++ b/Tests/SourceKittenFramework/SwiftDocsTests.swift @@ -39,13 +39,6 @@ func compareDocsWithFixturesName(name: String) { class SwiftDocsTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - // ("testSubscript", self.testSubscript), FIXME: Failing on SPM - // ("testBicycle", self.testBicycle), FIXME: Failing on SPM - ("testParseFullXMLDocs", self.testParseFullXMLDocs), - ] - func testSubscript() { compareDocsWithFixturesName("Subscript") } diff --git a/Source/SourceKittenFrameworkTests/SyntaxTests.swift b/Tests/SourceKittenFramework/SyntaxTests.swift similarity index 85% rename from Source/SourceKittenFrameworkTests/SyntaxTests.swift rename to Tests/SourceKittenFramework/SyntaxTests.swift index 919e3dcac..ffee6c965 100644 --- a/Source/SourceKittenFrameworkTests/SyntaxTests.swift +++ b/Tests/SourceKittenFramework/SyntaxTests.swift @@ -25,14 +25,6 @@ func compareSyntax(file: File, _ expectedTokens: [(SyntaxKind, Int, Int)]) { class SyntaxTests: XCTestCase { - // protocol XCTestCaseProvider - lazy var allTests: [(String, () throws -> Void)] = [ - ("testPrintEmptySyntax", self.testPrintEmptySyntax), - ("testGenerateSameSyntaxMapFileAndContents", self.testGenerateSameSyntaxMapFileAndContents), - ("testSubscript", self.testSubscript), - ("testSyntaxMapPrintValidJSON", self.testSyntaxMapPrintValidJSON), - ] - func testPrintEmptySyntax() { XCTAssertEqual(SyntaxMap(file: File(contents: "")).description, "[\n\n]", "should print empty syntax") } diff --git a/Source/Clang_C/module.modulemap b/script/module.modulemap similarity index 100% rename from Source/Clang_C/module.modulemap rename to script/module.modulemap diff --git a/script/spm_bootstrap b/script/spm_bootstrap index ae0de4d3c..9d93094be 100755 --- a/script/spm_bootstrap +++ b/script/spm_bootstrap @@ -3,7 +3,7 @@ SWIFT_SNAPSHOT=$1 cp -r /Library/Developer/Toolchains/$SWIFT_SNAPSHOT.xctoolchain/usr/local/include/clang-c /usr/local/include/clang-c -curl https://raw.githubusercontent.com/jpsim/SourceKitten/master/Source/Clang_C/module.modulemap -o /usr/local/include/clang-c/module.modulemap +curl https://raw.githubusercontent.com/jpsim/SourceKitten/master/script/module.modulemap -o /usr/local/include/clang-c/module.modulemap ln -s /Library/Developer/Toolchains/$SWIFT_SNAPSHOT.xctoolchain/usr/lib/libclang.dylib /usr/local/lib/libclang.dylib mkdir -p /usr/local/include/sourcekitdInProc ln -s /Library/Developer/Toolchains/$SWIFT_SNAPSHOT.xctoolchain/usr/lib/sourcekitd.framework/Headers/sourcekitd.h /usr/local/include/sourcekitdInProc/sourcekitd.h diff --git a/sourcekitten.xcodeproj/project.pbxproj b/sourcekitten.xcodeproj/project.pbxproj index 2ce36b89a..73465336b 100644 --- a/sourcekitten.xcodeproj/project.pbxproj +++ b/sourcekitten.xcodeproj/project.pbxproj @@ -14,6 +14,11 @@ 2E8FF7101C6268C100F280F0 /* StatementKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2ED279151C61E2A100084460 /* StatementKind.swift */; }; 3F0CBB411BAAFF160015BBA8 /* Clang+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F0CBB401BAAFF160015BBA8 /* Clang+SourceKitten.swift */; }; 3F56EAD01BAB251C006433D0 /* JSONOutput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F56EACF1BAB251C006433D0 /* JSONOutput.swift */; }; + 6C4CF5761C78B47F008532C5 /* library_wrapper_sourcekitd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4CF5721C78B47F008532C5 /* library_wrapper_sourcekitd.swift */; }; + 6C4CF5771C78B47F008532C5 /* library_wrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4CF5741C78B47F008532C5 /* library_wrapper.swift */; }; + 6C4CF6521C798082008532C5 /* library_wrapper_CXString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4CF6481C79802A008532C5 /* library_wrapper_CXString.swift */; }; + 6C4CF6551C798086008532C5 /* library_wrapper_Documentation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4CF6491C79802A008532C5 /* library_wrapper_Documentation.swift */; }; + 6C4CF6581C79808C008532C5 /* library_wrapper_Index.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C4CF6471C79802A008532C5 /* library_wrapper_Index.swift */; }; D0AAAB5019FB0960007B24B3 /* SourceKittenFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D0D1216D19E87B05005E4BAA /* SourceKittenFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; D0D1217219E87B05005E4BAA /* SourceKittenFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = D0D1217119E87B05005E4BAA /* SourceKittenFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; D0D1217819E87B05005E4BAA /* SourceKittenFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0D1216D19E87B05005E4BAA /* SourceKittenFramework.framework */; }; @@ -40,7 +45,6 @@ E847636A1A5A0651000EAE22 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = E84763691A5A0651000EAE22 /* File.swift */; }; E852418F1A5F4FB3007099FB /* Dictionary+Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E852418E1A5F4FB3007099FB /* Dictionary+Merge.swift */; }; E868473A1A587B4D0043DC65 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86847391A587B4D0043DC65 /* Request.swift */; }; - E868473C1A587C6E0043DC65 /* sourcekitd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E868473B1A587C6E0043DC65 /* sourcekitd.framework */; }; E86F588E1C4DC49000426E78 /* sourcekitd.h in Headers */ = {isa = PBXBuildFile; fileRef = E86F588D1C4DC49000426E78 /* sourcekitd.h */; settings = {ATTRIBUTES = (Public, ); }; }; E872121A1AD2FFCD00A484F4 /* Array+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = E87212191AD2FFCD00A484F4 /* Array+SourceKitten.swift */; }; E877D9271B5693E70095BB2B /* ObjCDeclarationKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = E877D9261B5693E70095BB2B /* ObjCDeclarationKind.swift */; }; @@ -50,7 +54,6 @@ E8A18A3F1A592246000362B7 /* SwiftDocs.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A18A3E1A592246000362B7 /* SwiftDocs.swift */; }; E8A9B8901B56CB5500CD17D4 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A9B88F1B56CB5500CD17D4 /* Xcode.swift */; }; E8A9B8921B56D1B100CD17D4 /* SourceDeclaration.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8A9B8911B56D1B100CD17D4 /* SourceDeclaration.swift */; }; - E8AB1A2E1A649F2100452012 /* libclang.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E8AB1A2D1A649F2100452012 /* libclang.dylib */; }; E8AB1A301A64A21400452012 /* ClangTranslationUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8AB1A2F1A64A21400452012 /* ClangTranslationUnitTests.swift */; }; E8AE53C71A5B5FCA0092D24A /* String+SourceKitten.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8AE53C61A5B5FCA0092D24A /* String+SourceKitten.swift */; }; E8C0DFCD1AD349DB007EE3D4 /* SWXMLHash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E8C0DFCC1AD349DB007EE3D4 /* SWXMLHash.framework */; }; @@ -127,7 +130,12 @@ 3F56EACF1BAB251C006433D0 /* JSONOutput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONOutput.swift; sourceTree = ""; }; 5499CA961A2394B700783309 /* Components.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Components.plist; sourceTree = ""; }; 5499CA971A2394B700783309 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6CDD63421C61DB840094A198 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 6C4CF5721C78B47F008532C5 /* library_wrapper_sourcekitd.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = library_wrapper_sourcekitd.swift; sourceTree = ""; }; + 6C4CF5741C78B47F008532C5 /* library_wrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = library_wrapper.swift; sourceTree = ""; }; + 6C4CF6471C79802A008532C5 /* library_wrapper_Index.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = library_wrapper_Index.swift; sourceTree = ""; }; + 6C4CF6481C79802A008532C5 /* library_wrapper_CXString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = library_wrapper_CXString.swift; sourceTree = ""; }; + 6C4CF6491C79802A008532C5 /* library_wrapper_Documentation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = library_wrapper_Documentation.swift; sourceTree = ""; }; + 6CFC18F01C7F2FB900CD70E1 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; D0D1211B19E87861005E4BAA /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; usesTabs = 0; }; D0D1212419E878CC005E4BAA /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; D0D1212619E878CC005E4BAA /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; @@ -212,8 +220,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - E8AB1A2E1A649F2100452012 /* libclang.dylib in Frameworks */, - E868473C1A587C6E0043DC65 /* sourcekitd.framework in Frameworks */, E8C0DFCD1AD349DB007EE3D4 /* SWXMLHash.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -368,6 +374,11 @@ E84763691A5A0651000EAE22 /* File.swift */, 3F56EACF1BAB251C006433D0 /* JSONOutput.swift */, E8A18A3A1A58971D000362B7 /* Language.swift */, + 6C4CF5741C78B47F008532C5 /* library_wrapper.swift */, + 6C4CF6481C79802A008532C5 /* library_wrapper_CXString.swift */, + 6C4CF6491C79802A008532C5 /* library_wrapper_Documentation.swift */, + 6C4CF6471C79802A008532C5 /* library_wrapper_Index.swift */, + 6C4CF5721C78B47F008532C5 /* library_wrapper_sourcekitd.swift */, E8241CA41A5E01A10047687E /* Module.swift */, E877D9261B5693E70095BB2B /* ObjCDeclarationKind.swift */, E83748C21A5BCD7900862B1B /* OffsetMap.swift */, @@ -410,7 +421,6 @@ E8AB1A2F1A64A21400452012 /* ClangTranslationUnitTests.swift */, E845EFEB1B9941AA00CFA57B /* CodeCompletionTests.swift */, E805A0491B560FCA00EA654A /* FileTests.swift */, - 6CDD63421C61DB840094A198 /* main.swift */, E8241CA21A5E01840047687E /* ModuleTests.swift */, E8C9EA091A5C9A2900A6D4D1 /* OffsetMapTests.swift */, E805A0471B55CBAF00EA654A /* SourceKitTests.swift */, @@ -420,7 +430,7 @@ D0DB09A319EA354200234B16 /* SyntaxTests.swift */, ); name = SourceKittenFrameworkTests; - path = Source/SourceKittenFrameworkTests; + path = Tests/SourceKittenFramework; sourceTree = ""; }; D0D1217C19E87B05005E4BAA /* Supporting Files */ = { @@ -441,6 +451,7 @@ E8D474301A648ED10011A49C /* Documentation.h */, E8D474311A648ED10011A49C /* Index.h */, E8D474321A648ED10011A49C /* Platform.h */, + 6CFC18F01C7F2FB900CD70E1 /* module.modulemap */, ); path = "clang-c"; sourceTree = ""; @@ -529,7 +540,7 @@ isa = PBXProject; attributes = { LastSwiftMigration = 0700; - LastSwiftUpdateCheck = 0700; + LastSwiftUpdateCheck = 0720; LastUpgradeCheck = 0700; ORGANIZATIONNAME = SourceKitten; TargetAttributes = { @@ -544,7 +555,7 @@ }; }; }; - buildConfigurationList = D0D1211319E87861005E4BAA /* Build configuration list for PBXProject "sourcekitten" */; + buildConfigurationList = D0D1211319E87861005E4BAA /* Build configuration list for PBXProject "SourceKitten" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -606,15 +617,18 @@ E872121A1AD2FFCD00A484F4 /* Array+SourceKitten.swift in Sources */, 3F0CBB411BAAFF160015BBA8 /* Clang+SourceKitten.swift in Sources */, 2E8FF7101C6268C100F280F0 /* StatementKind.swift in Sources */, + 6C4CF6551C798086008532C5 /* library_wrapper_Documentation.swift in Sources */, E8D4743B1A648F290011A49C /* ClangTranslationUnit.swift in Sources */, E8EE34BF1B9A502F00947605 /* CodeCompletionItem.swift in Sources */, E852418F1A5F4FB3007099FB /* Dictionary+Merge.swift in Sources */, E847636A1A5A0651000EAE22 /* File.swift in Sources */, + 6C4CF5771C78B47F008532C5 /* library_wrapper.swift in Sources */, 3F56EAD01BAB251C006433D0 /* JSONOutput.swift in Sources */, E8A18A3B1A58971D000362B7 /* Language.swift in Sources */, E806D28F1BE058B100D1BE41 /* Text.swift in Sources */, E8241CA51A5E01A10047687E /* Module.swift in Sources */, E877D9271B5693E70095BB2B /* ObjCDeclarationKind.swift in Sources */, + 6C4CF6521C798082008532C5 /* library_wrapper_CXString.swift in Sources */, E83748C31A5BCD7900862B1B /* OffsetMap.swift in Sources */, E806D2911BE058C400D1BE41 /* Parameter.swift in Sources */, E868473A1A587B4D0043DC65 /* Request.swift in Sources */, @@ -626,7 +640,9 @@ E89291A71A5B7FF800D91568 /* SwiftDocKey.swift in Sources */, E8A18A3F1A592246000362B7 /* SwiftDocs.swift in Sources */, E80F23691A5CB01A00FD2352 /* SyntaxKind.swift in Sources */, + 6C4CF5761C78B47F008532C5 /* library_wrapper_sourcekitd.swift in Sources */, E8CC8A2D1A587FD300D1FEC7 /* SyntaxMap.swift in Sources */, + 6C4CF6581C79808C008532C5 /* library_wrapper_Index.swift in Sources */, E80F236B1A5CB04100FD2352 /* SyntaxToken.swift in Sources */, E8A9B8901B56CB5500CD17D4 /* Xcode.swift in Sources */, ); @@ -710,17 +726,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = Source/SourceKittenFramework/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -742,17 +750,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = Source/SourceKittenFramework/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -769,12 +769,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); GCC_GENERATE_TEST_COVERAGE_FILES = YES; - INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + INFOPLIST_FILE = Tests/SourceKittenFramework/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; @@ -784,12 +780,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); GCC_GENERATE_TEST_COVERAGE_FILES = YES; - INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + INFOPLIST_FILE = Tests/SourceKittenFramework/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; @@ -814,17 +806,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = Source/SourceKittenFramework/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -841,12 +825,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); GCC_GENERATE_TEST_COVERAGE_FILES = YES; - INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + INFOPLIST_FILE = Tests/SourceKittenFramework/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; @@ -871,17 +851,9 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); FRAMEWORK_VERSION = A; INFOPLIST_FILE = Source/SourceKittenFramework/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks $(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/lib", - ); + LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFramework; VERSIONING_SYSTEM = "apple-generic"; @@ -898,12 +870,8 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(DEVELOPER_FRAMEWORKS_DIR)", - "$(inherited)", - ); GCC_GENERATE_TEST_COVERAGE_FILES = YES; - INFOPLIST_FILE = Source/SourceKittenFrameworkTests/Info.plist; + INFOPLIST_FILE = Tests/SourceKittenFramework/Info.plist; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = SourceKittenFrameworkTests; }; @@ -913,7 +881,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; @@ -925,7 +892,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; @@ -937,7 +903,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; @@ -949,7 +914,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = D0D1213419E878CC005E4BAA /* Mac-Application.xcconfig */; buildSettings = { - FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Source/sourcekitten/Info.plist; LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks/SourceKittenFramework.framework/Versions/Current/Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.sourcekitten.$(PRODUCT_NAME:rfc1034identifier)"; @@ -960,7 +924,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - D0D1211319E87861005E4BAA /* Build configuration list for PBXProject "sourcekitten" */ = { + D0D1211319E87861005E4BAA /* Build configuration list for PBXProject "SourceKitten" */ = { isa = XCConfigurationList; buildConfigurations = ( D0D1211D19E87861005E4BAA /* Debug */,