Skip to content

Commit

Permalink
feat: Add Swift example
Browse files Browse the repository at this point in the history
  • Loading branch information
satreix committed Feb 19, 2023
1 parent b86160d commit 931fe38
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ http_archive(
url = "https://github.com/bazelbuild/rules_rust/releases/download/0.18.0/rules_rust-v0.18.0.tar.gz",
)

http_archive(
name = "build_bazel_rules_swift",
sha256 = "51efdaf85e04e51174de76ef563f255451d5a5cd24c61ad902feeadafc7046d9",
url = "https://github.com/bazelbuild/rules_swift/releases/download/1.2.0/rules_swift.1.2.0.tar.gz",
)

http_archive(
name = "uncrustify",
build_file_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""",
Expand Down Expand Up @@ -456,3 +462,11 @@ container_deps()
load("@io_bazel_rules_docker//go:image.bzl", _go_image_repos = "repositories")

_go_image_repos()

load("@build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies")

swift_rules_dependencies()

load("@build_bazel_rules_swift//swift:extras.bzl", "swift_rules_extra_dependencies")

swift_rules_extra_dependencies()
13 changes: 13 additions & 0 deletions src/swift/hello_world/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_binary")
load("//tools/test/binary:binary.bzl", "binary_test")

binary_test(
name = "hello_world_test",
binary = ":hello_world",
)


swift_binary(
name = "hello_world",
srcs = ["main.swift"],
)
1 change: 1 addition & 0 deletions src/swift/hello_world/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello, World!")
Empty file added third_party/swift/BUILD.bazel
Empty file.

0 comments on commit 931fe38

Please sign in to comment.