我有一個錯誤,當我試圖在Linux上建立一個快捷包:生成錯誤:missingLinuxMain
> swift build -v
lsb_release -r
which clang
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/4 -lPackageDescription -swift-version 4 -I /opt/swift/usr/lib/swift/pm/4 -sdk//home/me/SwiftProject/Package.swift -fileno 5
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/3 -lPackageDescription -swift-version 3 -I /opt/swift/usr/lib/swift/pm/3 -sdk//home/me/SwiftProject/.build/checkouts/siesta-3156441904511450749/Package.swift -fileno 5
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/3 -lPackageDescription -swift-version 3 -I /opt/swift/usr/lib/swift/pm/3 -sdk//home/me/SwiftProject/.build/checkouts/SwiftyJSON-6376406316629445150/Package.swift -fileno 5
error: missingLinuxMain
我沒有錯誤,當我運行的最後一個命令:
/opt/swift/usr/bin/swiftc --driver-mode=swift -L /opt/swift/usr/lib/swift/pm/3 -lPackageDescription -swift-version 3 -I /opt/swift/usr/lib/swift/pm/3 -sdk//home/me/SwiftProject/.build/checkouts/SwiftyJSON-6376406316629445150/Package.swift -fileno 5
我有一個在測試目錄中的文件LinuxMain.swift:
Tests
├── ProjectTests
│ ├── SomeTests.swift
└── LinuxMain.swift
LinuxMain.swift:
import XCTest
@testable import ProjectTests
XCTMain([
testCase(SomeTests.allTests),
])
我使用SWIFT 4.0在Ubuntu 17.04
你在建什麼包?是你自己創建的還是你從GitHub克隆的東西? –
一個我自己創建的 – Hugal31