Build on linux environment (ubuntu 20.4)

This commit is contained in:
2023-05-29 00:14:08 +09:00
parent 325ab5fe1f
commit 54eca408c7
5 changed files with 39 additions and 1 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.build
.swiftpm
.DS_Store
bin

View File

@@ -37,3 +37,28 @@ extension Date {
ProcessInfo.processInfo.systemUptime
}
}
#if os(Linux)
extension URL {
public static func currentDirectory() -> URL {
URL(fileURLWithPath: FileManager.default.currentDirectoryPath)
}
public mutating func append(path: String) {
appendPathComponent(path)
}
public func appending(path: String) -> URL {
appendingPathComponent(path)
}
public mutating func append(queryItems: [URLQueryItem]) {
var components = URLComponents(url: self, resolvingAgainstBaseURL: true)
components?.queryItems = queryItems
if let url = components?.url {
self = url
}
}
}
#endif

View File

@@ -7,6 +7,10 @@
import Foundation
#if os(Linux)
import FoundationNetworking
#endif
public enum Method {
case `get`

View File

@@ -7,6 +7,11 @@
import Foundation
#if os(Linux)
import FoundationNetworking
import FoundationXML
#endif
protocol SeibroRequest: Request {
var openApiKey: String { get }

View File

@@ -22,7 +22,7 @@ let package = Package(
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
.executableTarget(
name: "KissMeConsole",
dependencies: ["KissMe"],
path: "Sources"),