Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Image target with SwiftGD #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,42 @@
"args": [],
"cwd": "${workspaceFolder:starter-kit}",
"preLaunchTask": "swift: Build Release Proxy"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Rest",
"program": "${workspaceFolder:starter-kit}/.build/debug/Rest",
"args": [],
"cwd": "${workspaceFolder:starter-kit}",
"preLaunchTask": "swift: Build Debug Rest"
},
{
"type": "lldb",
"request": "launch",
"name": "Release Rest",
"program": "${workspaceFolder:starter-kit}/.build/release/Rest",
"args": [],
"cwd": "${workspaceFolder:starter-kit}",
"preLaunchTask": "swift: Build Release Rest"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug Image",
"program": "${workspaceFolder:starter-kit}/.build/debug/Image",
"args": [],
"cwd": "${workspaceFolder:starter-kit}",
"preLaunchTask": "swift: Build Debug Image"
},
{
"type": "lldb",
"request": "launch",
"name": "Release Image",
"program": "${workspaceFolder:starter-kit}/.build/release/Image",
"args": [],
"cwd": "${workspaceFolder:starter-kit}",
"preLaunchTask": "swift: Build Release Image"
}
]
}
9 changes: 9 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"branch" : "main",
"revision" : "8c84156b144fc44ce758ea7745f9d0c902520904"
}
},
{
"identity" : "swiftgd",
"kind" : "remoteSourceControl",
"location" : "https://github.com/swift-cloud/SwiftGD",
"state" : {
"branch" : "main",
"revision" : "9c07060d36c52adcfa9c32af07df6b94eb6a067a"
}
}
],
"version" : 2
Expand Down
5 changes: 5 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/AndrewBarba/swift-compute-runtime", branch: "main"),
.package(url: "https://github.com/swift-cloud/SwiftGD", branch: "main"),
],
targets: [
.executableTarget(
name: "Hello",
dependencies: [.product(name: "Compute", package: "swift-compute-runtime")]
),
.executableTarget(
name: "Image",
dependencies: [.product(name: "Compute", package: "swift-compute-runtime"), "SwiftGD"]
),
.executableTarget(
name: "Proxy",
dependencies: [.product(name: "Compute", package: "swift-compute-runtime")]
Expand Down
13 changes: 13 additions & 0 deletions Sources/Image/App.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Compute
import SwiftGD

@main
struct App {
static func main() async throws {
try await onIncomingRequest(handleIncomingRequest)
}

static func handleIncomingRequest(req: IncomingRequest, res: OutgoingResponse) async throws {
try await res.send("Hello, Swift.")
}
}