Skip to content

Commit cd8fb5c

Browse files
committed
Enhance the default main.swift contents
1 parent ef42361 commit cd8fb5c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,23 @@ jobs:
147147
mkdir hello
148148
cd hello
149149
swiftly run swift package init --type executable
150+
151+
# make the contents a bit more interesting
152+
cat > Sources/hello/hello.swift << "EOF"
153+
import Foundation
154+
import FoundationNetworking
155+
import FoundationXML
156+
157+
@main
158+
struct hello {
159+
static func main() async throws {
160+
print("Hello, world!")
161+
let (data, _) = try await URLSession.shared.data(from: URL(fileURLWithPath: "/etc/hosts"))
162+
print(String(data: data, encoding: .utf8) ?? "")
163+
}
164+
}
165+
EOF
166+
150167
swiftly run swift build --swift-sdk "${ANDROID_EMULATOR_ARCH_TRIPLE}-unknown-linux-android${ANDROID_API}" --static-swift-stdlib
151168
file .build/debug/hello
152169

0 commit comments

Comments
 (0)