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
