Skip to content

Commit

Permalink
Merge pull request #104 from square/luis/migrate-to-bzlmod
Browse files Browse the repository at this point in the history
Migrate to bzlmod
  • Loading branch information
luispadron authored Jan 18, 2024
2 parents 49477f8 + 2db0ac2 commit 7fd14b0
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 53 deletions.
9 changes: 8 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
build --apple_platform_type=ios
# TODO: remove when using Bazel 7 where bzlmod is on by default
common --enable_bzlmod

# Use the apple_support macOS toolchains
common --enable_platform_specific_config
common:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain
common:macos --crosstool_top=@local_config_apple_cc//:toolchain
common:macos --host_crosstool_top=@local_config_apple_cc//:toolchain
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
6.4.0
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Build and Test
run: bazel test ParalayoutTests
run: bazel test //...
34 changes: 19 additions & 15 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
load(
"@build_bazel_rules_swift//swift:swift.bzl",
"swift_library",
"swift_test",
)

load(
"@build_bazel_rules_apple//apple:ios.bzl",
"@rules_apple//apple:ios.bzl",
"ios_framework",
"ios_unit_test",
)
load(
"@rules_swift//swift:swift.bzl",
"swift_library",
)

swift_library(
name = "Paralayout.lib",
module_name = "Paralayout",
srcs = glob(["Paralayout/**/*.swift"]),
module_name = "Paralayout",
tags = ["manual"],
visibility = ["//visibility:public"],
deps = [],
)

swift_library(
name = "ParalayoutTests.lib",
testonly = True,
srcs = glob(["ParalayoutTests/**/*.swift"]),
module_name = "ParalayoutTests",
tags = ["manual"],
deps = [":Paralayout.lib"],
srcs = glob(["ParalayoutTests/**/*.swift"]),
testonly = True,
)

ios_framework(
name = "Paralayout",
deps = [":Paralayout.lib"],
visibility = ["//visibility:public"],
bundle_id = "com.squareup.Paralayout",
families = [
"iphone",
"ipad",
],
infoplists = ["Paralayout/Info.plist"],
minimum_os_version = "12.0",
families = ["iphone", "ipad"],
visibility = ["//visibility:public"],
deps = [":Paralayout.lib"],
)

ios_unit_test(
name = "ParalayoutTests",
deps = [":ParalayoutTests.lib"],
bundle_name = "ParalayoutTests",
minimum_os_version = "12.0",
runner = "@build_bazel_rules_apple//apple/testing/default_runner:ios_xctestrun_ordered_runner",
runner = "@rules_apple//apple/testing/default_runner:ios_xctestrun_ordered_runner",
deps = [":ParalayoutTests.lib"],
)
23 changes: 23 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Defines the Bazel module."""

module(
name = "paralayout",
version = "0.0.0",
compatibility_level = 1,
)

bazel_dep(
name = "apple_support",
version = "1.11.1",
)
bazel_dep(
name = "rules_apple",
version = "3.1.1",
)
bazel_dep(
name = "rules_swift",
version = "1.14.0",
)

apple_cc_configure = use_extension("@apple_support//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc")
35 changes: 0 additions & 35 deletions WORKSPACE.bazel

This file was deleted.

1 change: 1 addition & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Defines the WORKSPACE when using bzlmod, this should be empty. Use MODULE.bazel instead"""

0 comments on commit 7fd14b0

Please sign in to comment.