Skip to content

Commit

Permalink
Add some tiny examples to the README (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith authored Aug 22, 2023
1 parent 5e58cfc commit 270c989
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,32 @@ watchOS), they can be combined with the
If you run into any problems with these rules, please
[file an issue!](https://github.com/bazelbuild/rules_swift/issues/new)

## Basic Examples

Create a simple CLI that can run on macOS, Linux, or Windows:

```bzl
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_binary")

swift_binary(
name = "cli",
srcs = ["CLI.swift"],
)
```

Create a single library target that can be used by other targets in your
build:

```bzl
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")

swift_library(
name = "MyLibrary",
srcs = ["MyLibrary.swift"],
tags = ["manual"],
)
```

## Reference Documentation

[Click here](https://github.com/bazelbuild/rules_swift/tree/master/doc)
Expand Down

0 comments on commit 270c989

Please sign in to comment.