Skip to content

Commit

Permalink
Remove Bazel support (#222)
Browse files Browse the repository at this point in the history
This removes the BUILD files and Bazel infra.
Bazel users should consume via SPM using https://github.com/cgrindel/rules_swift_package_manager
  • Loading branch information
luispadron authored Sep 20, 2024
1 parent c77ebd0 commit 4ea8cbf
Show file tree
Hide file tree
Showing 21 changed files with 7 additions and 381 deletions.
8 changes: 0 additions & 8 deletions .bazelrc

This file was deleted.

1 change: 0 additions & 1 deletion .bazelversion

This file was deleted.

8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ jobs:
uses: actions/checkout@v4
- name: Build
run: carthage build --no-skip-current --platform iOS --use-xcframeworks --verbose
bazel:
name: Bazel Build
runs-on: macOS-13
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Build
run: bazel build //...
validate-strings:
name: Validate Localized Strings
runs-on: macOS-13
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,3 @@ Pods/
generated/
.build/
.swiftpm/

# Bazel
bazel-*
20 changes: 0 additions & 20 deletions Bazel/0001-Patch-testonly-swift_library.patch

This file was deleted.

Empty file removed Bazel/BUILD.bazel
Empty file.
37 changes: 0 additions & 37 deletions Bazel/non_bzlmod_deps.bzl

This file was deleted.

14 changes: 0 additions & 14 deletions Bazel/swift_snapshot_testing.BUILD.bazel

This file was deleted.

33 changes: 0 additions & 33 deletions MODULE.bazel

This file was deleted.

65 changes: 0 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,71 +86,6 @@ github "cashapp/AccessibilitySnapshot"
```
</details>

<details>
<summary>Bazel</summary>

Add the following to your `MODULE.bazel` file:

```starlark
bazel_dep(
name = "accessibility_snapshot",
version = "x.x.x",
)
```

Use the provided targets in the `BUILD.bazel` files. There is a `*_library` target for each target suffixed with `.lib` that can be used as a dependency. Without the suffix you will get an `ios_framework` target (dynamic).

```starlark

swift_library(
name = "MyLibrary",
...,
deps = [
"//Sources/AccessibilitySnapshot/Core:AccessibilitySnapshotCore.lib",
],
)
```

To use [iOSSnapshotTestCase](https://github.com/uber/ios-snapshot-test-case) you can add a dependency on the `//Sources/AccessibilitySnapshot/iOSSnapshotTestCase:AccessibilitySnapshot_iOSSnapshotTestCase` targets.

For example:

```starlark
swift_test(
name = "MyLibraryTests",
...,
deps = [
"//Sources/AccessibilitySnapshot/Core:AccessibilitySnapshotCore.lib",
"//Sources/AccessibilitySnapshot/iOSSnapshotTestCase:AccessibilitySnapshot_iOSSnapshotTestCase",
],
)
```

```swift
import AccessibilitySnapshot_iOSSnapshotTestCase
```

To use [SnapshotTesting](https://github.com/pointfreeco/swift-snapshot-testing) you can add a dependency on the `//Sources/AccessibilitySnapshot/SnapshotTesting:AccessibilitySnapshot_SnapshotTesting` targets.

For example:

```starlark
swift_test(
name = "MyLibraryTests",
...,
deps = [
"//Sources/AccessibilitySnapshot/Core:AccessibilitySnapshotCore.lib",
"//Sources/AccessibilitySnapshot/SnapshotTesting:AccessibilitySnapshot_SnapshotTesting",
],
)
```

```swift
import AccessibilitySnapshot_SnapshotTesting
```

</details>

## Usage

AccessibilitySnapshot builds on top of existing snapshot frameworks to add support for snapshotting your app's accessibility. By default it uses the [SnapshotTesting](https://github.com/pointfreeco/swift-snapshot-testing) framework for snapshotting, but can be switched over to [iOSSnapshotTestCase](https://github.com/uber/ios-snapshot-test-case) as well.
Expand Down
73 changes: 0 additions & 73 deletions Sources/AccessibilitySnapshot/Core/BUILD.bazel

This file was deleted.

37 changes: 0 additions & 37 deletions Sources/AccessibilitySnapshot/SnapshotTesting/BUILD.bazel

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import SnapshotTesting
import UIKit

#if SWIFT_PACKAGE || BAZEL_PACKAGE
#if SWIFT_PACKAGE
import AccessibilitySnapshotCore
import AccessibilitySnapshotCore_ObjC
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import SnapshotTesting
import SwiftUI
import UIKit

#if SWIFT_PACKAGE || BAZEL_PACKAGE
#if SWIFT_PACKAGE
import AccessibilitySnapshotCore
import AccessibilitySnapshotCore_ObjC
#endif
Expand Down
Loading

0 comments on commit 4ea8cbf

Please sign in to comment.