Невозможно создать подпроект с использованием Xcode 8.0 и Swift 3

Я использую сборку Xcode 8.0 версии 8S174q и Apple Swift версии 3.0 (swiftlang-800.0.34.6 clang-800.0.33).

Pauls-Mac-mini:~ paul$ xcrun xcodebuild -version
Xcode 8.0
Build version 8S174q
Pauls-Mac-mini:~ paul$ xcrun swift -version
Apple Swift version 3.0 (swiftlang-800.0.34.6 clang-800.0.33)
Target: x86_64-apple-macosx10.9
Pauls-Mac-mini:~ paul$ xcrun --find swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

С https://github.com/stephencelis/SQLite.swift я установил версию 0.11. 0 (обратите внимание, что он написан на Swift 3). Я пробовал три метода установки на этой веб-странице и после целого дня возни по-прежнему не могу скомпилировать sqlite.swift. Через навигатор отчетов Xcode (CMD-8) я вижу сотни ошибок компиляции, пару из которых я вставил ниже.

/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:69:9: error: expected declaration
        fileprivate init(rawValue:Int32) {
        ^
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:58:17: note: in declaration of 'Operation'
    public enum Operation {
                ^
/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift:69:20: error: consecutive declarations on a line must be separated by ';'
        fileprivate init(rawValue:Int32) {
                   ^

Сначала я подозревал, что компилятор swift 3.0 не используется, но, посмотрев на команду компиляции (ниже), похоже, что это не так.

Я пробовал 3 способа установить SQLite.swift - используя Carthage, cocoapods и устанавливая SQLite.swift в качестве подпроекта Xcode. Я не могу собрать SQlite.swift.

Пожалуйста помоги! Я новичок в разработке iOS, Xcode и инструментах, поэтому меня это озадачивает. Ниже я добавил более подробную информацию, такую ​​как команда компиляции, которая генерирует ошибки. Можете ли вы предложить возможное решение или даже что-то, что я могу попытаться создать для этого подпроекта?

CompileSwift normal x86_64 /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CoreFunctions.swift
    cd /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift
    /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CoreFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/RTree.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Blob.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Foundation.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Connection.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Expression.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Helpers.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Collation.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Setter.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/CustomFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/FTS4.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Value.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Operators.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Schema.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/Query.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Core/Statement.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Typed/AggregateFunctions.swift /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/SQLite/Extensions/FTS5.swift -target x86_64-apple-ios10.0 -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -I /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator -I /Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift/CocoaPods/iphonesimulator-10.0 -F /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator -application-extension -enable-testing -g -import-underlying-module -module-cache-path /Users/paul/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/swift-overrides.hmap" -Xcc -iquote -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-generated-files.hmap" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-own-target-headers.hmap" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-all-non-framework-target-headers.hmap" -Xcc -ivfsoverlay -Xcc /Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/all-product-headers.yaml -Xcc -iquote -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/SQLite-project-headers.hmap" -Xcc -I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Products/Debug-iphonesimulator/include -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/DerivedSources/x86_64" -Xcc "-I/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/DerivedSources" -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/unextended-module-overlay.yaml" -Xcc -working-directory/Users/paul/Documents/MySandbox/TestThreeSqlite/SQLite.swift -emit-module-doc-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions~partial.swiftdoc" -Onone -module-name SQLite -emit-module-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions~partial.swiftmodule" -serialize-diagnostics-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.dia" -emit-dependencies-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.d" -emit-reference-dependencies-path "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.swiftdeps" -o "/Users/paul/Library/Developer/Xcode/DerivedData/TestThreeSqlite-hfrusllbfhbivxajwyfswvzejkpl/Build/Intermediates/SQLite.build/Debug-iphonesimulator/SQLite iOS.build/Objects-normal/x86_64/CoreFunctions.o"

person pbm    schedule 27.10.2016    source источник


Ответы (1)


Проблема была вызвана использованием версии swift, которая не поддерживала некоторые новые функции быстрого языка, имеющиеся в версии 0.11.0 из https://github.com/stephencelis/SQLite.swift (например, модификатор уровня доступа fileprivate). Было сложно соотнести бета-версию Xcode с быстрой версией (в данном случае swiftlang-800.0.34.6 clang-800.0.33) с примечаниями к выпуску быстрого языка (https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/RevisionHistory.html).

Я обновился до Xcode 8.1, который использует Swift 3.0.1, и теперь не вижу проблем со сборкой. Теперь, когда Xcode больше не является бета-версией, я надеюсь, что перекрестные ссылки между версиями xcode, быстрыми языковыми кодами и быстрыми примечаниями к выпуску будут проще.

person pbm    schedule 31.10.2016