Skip to content

Commit 0457392

Browse files
authored
feat(patch): Support building with bazel and add to bazel build registry (#7)
1 parent c3f0557 commit 0457392

File tree

6 files changed

+343
-0
lines changed

6 files changed

+343
-0
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
8.3.1

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ fastlane/test_output
9999
# https://github.com/johnno1962/injectionforxcode
100100

101101
iOSInjectionProject/
102+
103+
# Ignore all bazel-* symlinks. There is no full list since this can change
104+
# based on the name of the directory bazel is cloned into.
105+
/bazel-*

BUILD.bazel

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
load("@rules_swift//swift:swift_compiler_plugin.bzl", "swift_compiler_plugin")
2+
load("@rules_swift//swift:swift_library.bzl", "swift_library")
3+
4+
swift_library(
5+
name = "Equatable",
6+
package_name = "Equatable",
7+
srcs = glob(["Sources/Equatable/**/*.swift"]),
8+
module_name = "Equatable",
9+
plugins = [":EquatableMacros"],
10+
visibility = ["//visibility:public"],
11+
)
12+
13+
swift_compiler_plugin(
14+
name = "EquatableMacros",
15+
package_name = "Equatable",
16+
srcs = glob(["Sources/EquatableMacros/**/*.swift"]),
17+
module_name = "EquatableMacros",
18+
deps = [
19+
"@swift-syntax//:SwiftCompilerPlugin",
20+
"@swift-syntax//:SwiftSyntax",
21+
"@swift-syntax//:SwiftSyntaxMacros",
22+
],
23+
)

MODULE.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module(
2+
name = "swift_equatable_macro",
3+
version = "0",
4+
bazel_compatibility = [">=7.0.0"],
5+
compatibility_level = 1,
6+
)
7+
8+
bazel_dep(name = "rules_swift", version = "3.0.2")
9+
bazel_dep(name = "swift-syntax", version = "601.0.1.1")

0 commit comments

Comments
 (0)