Split UI-free logic into a RunnerCore swift_library and cover it with a swift_test suite using the Swift Testing library (import Testing / @Test / #expect), matching Tests/m323Tests. Runs via `bazel test`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
59 lines
1.5 KiB
Text
59 lines
1.5 KiB
Text
load("@rules_swift//swift:swift.bzl", "swift_binary", "swift_library", "swift_test")
|
|
|
|
# Pure, UI-free logic (models, parsing, transforms, formatting). Kept out of the
|
|
# binary so it can be exercised by //m323/Sources/MiniProject:RunnerCoreTests.
|
|
swift_library(
|
|
name = "RunnerCore",
|
|
srcs = ["RunnerCore.swift"],
|
|
module_name = "RunnerCore",
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
swift_binary(
|
|
name = "StadtRundlauf",
|
|
srcs = ["main.swift"],
|
|
data = glob(["data/*.txt"]),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":RunnerCore",
|
|
"@swifttui//:SwiftTUI",
|
|
],
|
|
)
|
|
|
|
swift_test(
|
|
name = "RunnerCoreTests",
|
|
srcs = ["RunnerCoreTests.swift"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [":RunnerCore"],
|
|
)
|
|
|
|
# BEGIN GENERATED XCODEPROJ
|
|
load("@rules_xcodeproj//xcodeproj:defs.bzl", "top_level_target", "xcodeproj")
|
|
|
|
filegroup(
|
|
name = "xcodeproj_extra_files",
|
|
srcs = glob(
|
|
["**/*"],
|
|
exclude = [
|
|
"BUILD.bazel",
|
|
"BUILD",
|
|
"**/*.xcodeproj/**",
|
|
"**/.*",
|
|
"**/.*/**",
|
|
],
|
|
allow_empty = True,
|
|
),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
xcodeproj(
|
|
name = "xcodeproj",
|
|
project_name = "MiniProject",
|
|
tags = ["manual"],
|
|
extra_files = [":xcodeproj_extra_files"],
|
|
top_level_targets = [
|
|
"//m323/Sources/MiniProject:RunnerCoreTests",
|
|
"//m323/Sources/MiniProject:StadtRundlauf",
|
|
],
|
|
)
|
|
# END GENERATED XCODEPROJ
|