Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for rules_swift 2.x. #816

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
MacOS:
strategy:
matrix:
xcode_version: ['14.3.1', '15.2', '15.3']
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 14.3.1 job was failing on Bazel because of diff in fixtures. I'm not able to install that version on my OS. If we're okay with bumping this this should be ready now

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a fairly old version now, fine to remove from CI

xcode_version: ['15.2', '15.3']
runs-on: macos-14
steps:
- uses: actions/checkout@v2
Expand Down
9 changes: 5 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ module(

bazel_dep(name = "platforms", version = "0.0.8", dev_dependency = True)
bazel_dep(name = "apple_support", version = "1.11.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_swift", version = "1.15.1", repo_name = "build_bazel_rules_swift")
bazel_dep(name = "swift_argument_parser", version = "1.2.1", repo_name = "sourcekitten_com_github_apple_swift_argument_parser")
bazel_dep(name = "swxmlhash", version = "7.0.2", repo_name = "sourcekitten_com_github_drmohundro_SWXMLHash")
bazel_dep(name = "yams", version = "5.0.6", repo_name = "sourcekitten_com_github_jpsim_yams")
bazel_dep(name = "rules_swift", version = "2.0.0", repo_name = "build_bazel_rules_swift")
bazel_dep(name = "swift_argument_parser", version = "1.3.1.1", repo_name = "sourcekitten_com_github_apple_swift_argument_parser")
bazel_dep(name = "swxmlhash", version = "7.0.2.1", repo_name = "sourcekitten_com_github_drmohundro_SWXMLHash")
bazel_dep(name = "yams", version = "5.1.3", repo_name = "sourcekitten_com_github_jpsim_yams")
bazel_dep(name = "rules_cc", version = "0.0.2")

apple_cc_configure = use_extension("@build_bazel_apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc")
25 changes: 18 additions & 7 deletions Source/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_c_module")
load("@build_bazel_rules_swift//swift:swift_interop_hint.bzl", "swift_interop_hint")
load("@rules_cc//cc:defs.bzl", "cc_library")

exports_files(glob(["SourceKittenFramework/**/*.swift"]))

Expand All @@ -11,14 +12,19 @@ cc_library(
visibility = ["//visibility:public"],
)

swift_c_module(
cc_library(
name = "Clang_C",
module_map = "Clang_C/Clang_C.modulemap",
module_name = "Clang_C",
aspect_hints = [":Clang_C_SwiftInterop"],
visibility = ["//visibility:public"],
deps = [":Clang_CLibrary"],
)

swift_interop_hint(
name = "Clang_C_SwiftInterop",
module_map = "Clang_C/Clang_C.modulemap",
module_name = "Clang_C",
)

cc_library(
name = "SourceKitLibrary",
hdrs = glob(
Expand All @@ -28,14 +34,19 @@ cc_library(
visibility = ["//visibility:public"],
)

swift_c_module(
cc_library(
name = "SourceKit",
module_map = "SourceKit/SourceKit.modulemap",
module_name = "SourceKit",
aspect_hints = [":SourceKit_SwiftInterop"],
visibility = ["//visibility:public"],
deps = [":SourceKitLibrary"],
)

swift_interop_hint(
name = "SourceKit_SwiftInterop",
module_map = "SourceKit/SourceKit.modulemap",
module_name = "SourceKit",
)

filegroup(
name = "SourceKittenFrameworkSources",
srcs = glob(
Expand Down
Loading